-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add Emerge snapshot testing #1785
Add Emerge snapshot testing #1785
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really sorry for the delay! This is looking great! Just some small questions and I think we can get it merged
sha.set("") | ||
// TODO: RevenueCat to set from CircleCi variables | ||
// Should skip setting for main branch uploads | ||
baseSha.set("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to check, this will be the sha for the latest commit in main
right? I don't think CircleCI gives us this https://circleci.com/docs/variables/? Though we can calculate it through a script of course
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct, needs to be the commit in the default branch (i.e. main) that the PR is based on. Seems we might be able to get it from GitHub data in CircleCI.
Proposition here: let's add this in a future PR. Most snapshots integrations are best as two steps anyway:
- Add uploads from all main branch commits. This way we can ensure everything's running properly and we get snapshots for all base builds.
- In follow up PR, we add support for PR commits. That way diffs we can test that diffs are working properly.
So this PR will be step 1 above, and you or I can follow with step 2 where we add the baseSha just for PR commits. Sound good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes a lot of sense thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Will get this merged so we will start using this soon. Thank you!
f7b77f6
into
RevenueCat:external/rbro112/add-emerge-snapshot-testing
### Checklist - [ ] If applicable, unit tests - [ ] If applicable, create follow-up issues for `purchases-ios` and hybrids ### Motivation Adds Emerge snapshots to purchases UI, as RevenueCat has expressed interest and we figured we'd make the process easier 😄 . ### Description Adds the basic integration necessary for getting up and running with Emerge snapshots: - Adds the Emerge gradle plugin to the `testpurchasesuiandroidcompatibility` module. - Worth noting that Emerge requires the plugin to be set on an `application` module vs a library module. @tonidero had mentioned that the Previews we want to snapshot are in `:ui:revenuecatui`. Given that this application module depends directly on the `:ui:revenuecatui` module and snapshots use a debug variant, all code should be present from that module, giving Emerge all `@Previews` automatically. - Adds what I believe is the necessary fastlane/CircleCI setup to invoke snapshots, but my experience here is a bit more limited. - Updates Compose BOM from `2023.05.01` to `2024.06.00`, as Emerge snapshots rely on compose foundation, which can't be resolved without an update. Happy to help test this! For the best usage, we recommend running snapshots on every commit - all PR commits and main commits. Emerge will run & snapshot all `@Preview` annotated functions, storing the generated snapshots based on the `sha` of that upload. If the commit has a valid `baseSha` set and we have snapshots for that `baseSha`, we'll automatically compare the snapshots and let you know if there's any visual changes directly on the PR. See our [snapshot docs](https://docs.emergetools.com/docs/snapshot-testing) for all functionality! Remaining tasks to implement to complete this: - [ ] Wire up CircleCI variables to see the `sha` & `baseSha` in the Emerge gradle plugin config block. These are what we use for [diffing snapshots](https://docs.emergetools.com/docs/continuous-integration). Will do this in follow up PRs Contributed by @rbro112 in #1785 --------- Co-authored-by: Ryan Brooks <[email protected]>
**This is an automatic release.** ### Bugfixes * Fixes a Paywall Template 7 crash when none of the tiers have any available products. (#1834) via JayShortway (@JayShortway) ### Dependency Updates * Bump fastlane-plugin-revenuecat_internal from `85e1c83` to `5140dbc` (#1835) via dependabot[bot] (@dependabot[bot]) ### Other Changes * [EXTERNAL] Add Emerge snapshot testing (#1785) by @rbro112 (#1831) via Toni Rico (@tonidero) --------- Co-authored-by: revenuecat-ops <[email protected]> Co-authored-by: Toni Rico <[email protected]>
Checklist
purchases-ios
and hybridsMotivation
Adds Emerge snapshots to purchases UI, as RevenueCat has expressed interest and we figured we'd make the process easier 😄 .
Description
Adds the basic integration necessary for getting up and running with Emerge snapshots:
testpurchasesuiandroidcompatibility
module.application
module vs a library module. @tonidero had mentioned that the Previews we want to snapshot are in:ui:revenuecatui
. Given that this application module depends directly on the:ui:revenuecatui
module and snapshots use a debug variant, all code should be present from that module, giving Emerge all@Previews
automatically.2023.05.01
to2024.06.00
, as Emerge snapshots rely on compose foundation, which can't be resolved without an update. Happy to help test this!For the best usage, we recommend running snapshots on every commit - all PR commits and main commits. Emerge will run & snapshot all
@Preview
annotated functions, storing the generated snapshots based on thesha
of that upload.If the commit has a valid
baseSha
set and we have snapshots for thatbaseSha
, we'll automatically compare the snapshots and let you know if there's any visual changes directly on the PR. See our snapshot docs for all functionality!Remaining tasks for RevenueCat to implement to complete this:
EMERGE_API_TOKEN
as a GitHub secretsha
&baseSha
in the Emerge gradle plugin config block. These are what we use for diffing snapshots.