8000 PM-13142: Fix PasteboardService and AutofillCredentialService tests by matt-livefront · Pull Request #1000 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PM-13142: Fix PasteboardService and AutofillCredentialService tests #1000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

matt-livefront
Copy link
Collaborator
@matt-livefront matt-livefront commented Oct 3, 2024

🎟️ Tracking

PM-13142

📔 Objective

The following tests occasionally fail on CI. I think this should fix them from failing in the future.

Error: -[BitwardenSharedTests.PasteboardServiceTests test_error_updating] : XCTAssertEqual failed: ("Optional([BitwardenSharedTests.BitwardenTestError.example, BitwardenSharedTests.BitwardenTestError.example])") is not equal to ("Optional([BitwardenSharedTests.BitwardenTestError.example])")

https://github.com/bitwarden/ios/actions/runs/11129976827/job/30928320511

Error: -[BitwardenSharedTests.AutofillCredentialServiceTests test_syncIdentities_removeError] : XCTAssertEqual failed: ("Optional([BitwardenSharedTests.BitwardenTestError.example, BitwardenSharedTests.BitwardenTestError.example])") is not equal to ("Optional([BitwardenSharedTests.BitwardenTestError.example])")

https://github.com/bitwarden/ios/actions/runs/11128380381/job/30922984525

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link
codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.04%. Comparing base (5fc811a) to head (76145d9).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1000      +/-   ##
==========================================
- Coverage   89.05%   89.04%   -0.01%     
==========================================
  Files         654      654              
  Lines       41057    41057              
==========================================
- Hits        36562    36558       -4     
- Misses       4495     4499       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor
github-actions bot commented Oct 3, 2024

Logo
Checkmarx One – Scan Summary & Detailsbee783a0-9e45-4a72-8b62-411fa0427300

No New Or Fixed Issues Found

// identities for the active account, otherwise there's a potential race condition between
// that and the tests below.
waitFor { identityStore.removeAllCredentialIdentitiesCalled }
identityStore.removeAllCredentialIdentitiesCalled = false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Just a quick for myself, is there a downside to making the init for DefaultAutofillCredentialService async? Or is this something an Actor could help us with?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could make it async, but I'm not sure if that would help us here. Since the init is subscribing to a publisher, we can't wait for it to complete, so how else would we know once it had finished the initial sync?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah great point... I guess we could add another publisher to DefaultAutofillCredentialService which would emit when the the initial sync completes but that seems like overkill.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea would be to use a PassthroughSubject instead so there is no initial value but it doesn't have a buffer of the most-recent published value so maybe it's safer to leave it like it's now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I think we want the behavior in the app to trigger immediately with the initial value though.

@matt-livefront matt-livefront merged commit 6459d13 into main Oct 3, 2024
9 checks passed
@matt-livefront matt-livefront deleted the matt/PM-13142-fix-tests branch October 3, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0