Skip to content
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

chore: SPM unit tests #842

Merged
merged 34 commits into from
Apr 22, 2024
Merged

chore: SPM unit tests #842

merged 34 commits into from
Apr 22, 2024

Conversation

jnewc
Copy link
Contributor

@jnewc jnewc commented Apr 19, 2024

Description

Some changes to CI + testing setup:

  • All relevant unit tests moved to SPM test target
  • Debug app tests remain in Xcode project unit test target
  • Danger step runs in parallel to others
  • Pod lint and unit tests no long run on PR edit

Contributor Checklist

  • All status checks have passed prior to code review
  • I have added unit tests to a reasonable level of coverage where suitable
  • I have added UI tests to new user flows, if applicable
  • I have manually tested newly added UX
  • I have open a documentation PR, if applicable

Reviewer Checklist

  • I have verified that a suitable set of automated tests has been added
  • I have verified that the title prefix aligns to the code changes + whether a release is expected after merging the PR
  • I have verified the documentation PR aligns with this PR, if applicable

Before Merging

  • If introducing a breaking change, I have communicated it internally
  • Any related documentation PRs are ready to merge

Other Stuff

  • You can find out more about our automation checks here
  • Find out more about conventional commits here

Copy link
Contributor

github-actions bot commented Apr 19, 2024

Warnings
⚠️ > Pull Request size seems relatively large. If this Pull Request contains multiple changes, please split each into separate PR will helps faster, easier review.
⚠️ Please assign someone aside from CODEOWNERS (@checkout-pci-reviewers) to review this PR.

Generated by 🚫 Danger Swift against ab16cb8

Copy link
Contributor

@jnewc jnewc requested review from NQuinn27 and borisprimer April 22, 2024 08:07
Copy link
Contributor

@borisprimer borisprimer left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -4,7 +4,6 @@ on:
pull_request:
types:
- opened
- edited
Copy link
Contributor

Choose a reason for hiding this comment

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

🙌 Thanks for this + the above. No more rebuilds for edits 😅

@@ -199,14 +199,21 @@ class WebRedirectPaymentMethodTokenizationViewModel: PaymentMethodTokenizationVi
)

Analytics.Service.record(events: [presentEvent, networkEvent])

guard UIApplication.shared.windows.count > 0 else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we expect this to only fail in tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... yes, in theory. In practice if it can't find a window, the user is stuck anyway and can't proceed. This will at least try to force a completion.

I'm open to other ways of doing it though. Something with an #ifdef would probably be nicer.

@@ -371,7 +371,7 @@ class MockPrimerAPIConfigurationModule: PrimerAPIConfigurationModuleProtocol {

// MARK: - MOCKED PROPERTIES

var mockedNetworkDelay: TimeInterval = 2
var mockedNetworkDelay: TimeInterval = 0.5
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to see it go in this direction 👌

@jnewc jnewc merged commit 64d59e9 into master Apr 22, 2024
7 checks passed
@jnewc jnewc deleted the jn/swiftpm-unit-tests branch April 22, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants