Continuous Integration

Setup

Emerge determines the commits based on the sha and baseSha params set in your upload. We also require repoName and prNumberto be set in order to correctly display status checks and comments. We also suggest including the previousSha param to enable Snapshot History!. For more information, please check out our Uploading Basics documentation.

Please reach out to our team if you are having any difficult setting up your CI!

Android

Emerge will automatically diff snapshots based onsha/baseSha parameters. By default Emerge automatically sets these parameters based on local Git information, however, these params can also be specified explicitly through the vcs block of the Emerge Gradle plugin extension.

emerge {
  // ...
  
  vcs {
    sha.set("...")
    baseSha.set("...")
    previousSha.set("...")
  }
}

Overview

Emerge's snapshotting solution is designed to fit seamlessly into your CI workflow, catching regressions in pull requests early before they make it into production. Emerge compares pull requests against the base branch and automatically diffs the result, giving developers a simple summary of what changed in their UI.

Let's start with this example:

1442

Example of using Github flow with snapshot testing

Here the developer is working on myFeature and has branched off of Commit 1 from the main branch. Commit 1 has already run its snapshot tests and produced a set of base snapshots to be compared against.

While working on the feature, every commit pushed to this branch will have snapshot tests generated and compared against Commit 1. Emerge will automatically flag any differences so they can be reviewed, and this can optionally prevent the pull request from being merged. Once the feature is complete and all the snapshots have been reviewed, the pull request can be merged back into main without worry of unexpected UI regressions.

The resulting commit on main will then trigger a new set of base snapshots to be produced and automatically become the new "golden" set. Unlike other snapshotting libraries, there is no manual recording step, merging into the base branch signals the new set of snapshots are correct going forward.

Status check

We provide a custom status check so developers can easily verify their changes at a glance:

And also get a more detailed breakdown:

Once a pull request is merged into the base branch, that becomes the new "golden" set of snapshots to compare against.