-
Notifications
You must be signed in to change notification settings - Fork 24
Switch from Roborazzi to Paparazzi for snapshot testing #767
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
base: main
Are you sure you want to change the base?
Changes from all commits
6d17252
4b65f59
f3e2489
e6704f3
4e847e8
2173ed5
b1aae4b
dffcc59
c0dc8e3
c9dbe2f
f9297bc
27aca01
58bf55d
e14cbbb
6d06280
a89319a
6a0e416
e016669
adc49e5
d32c041
a86adbe
01a60c9
d13a077
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,31 +8,7 @@ on: | |
| paths: [android/**] | ||
|
|
||
| jobs: | ||
| emerge: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: ./android | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: "21" | ||
| distribution: "temurin" | ||
| - name: Setup Gradle build action | ||
| uses: gradle/actions/setup-gradle@v6 | ||
| - name: Emerge snapshots | ||
| run: ./gradlew :app:bundleDebug :app:emergeUploadSnapshotBundleDebug | ||
| env: | ||
| EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_KEY }} | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }} | ||
|
|
||
| roborazzi: | ||
| paparazzi: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| defaults: | ||
|
|
@@ -62,19 +38,21 @@ jobs: | |
| - name: Setup gems | ||
| run: gem install emerge | ||
|
|
||
| - name: Generate Roborazzi snapshots | ||
| run: ./gradlew :app:recordRoborazziDebug :app:sentryUploadSnapshotsRelease | ||
| - name: Generate Paparazzi snapshots | ||
| run: ./gradlew :app:recordPaparazziDebug :app:sentryUploadSnapshotsDebug | ||
| env: | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }} | ||
| SENTRY_DONT_IGNORE_DEBUG: true | ||
|
Comment on lines
+42
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The CI workflow relies on an undocumented environment variable Suggested FixEither confirm with the Sentry team that Prompt for AI Agent |
||
|
|
||
| - name: Upload snapshots | ||
| env: | ||
| EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_KEY }} | ||
| run: | | ||
| emerge upload snapshots \ | ||
| --name "HackerNews Roborazzi" \ | ||
| --id "com.emerge.hackernews.roborazzi" \ | ||
| --name "Hacker News" \ | ||
| --id "com.emergetools.hackernews.debug" \ | ||
| --repo-name "EmergeTools/hackernews" \ | ||
| --tag "snapshot" \ | ||
| --debug \ | ||
| --client-library roborazzi \ | ||
| --client-library paparazzi \ | ||
| --project-root . | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import io.github.takahirom.roborazzi.RoborazziExtension | ||
| import io.sentry.android.gradle.tasks.SentryUploadSnapshotsTask | ||
| import org.gradle.api.tasks.testing.Test | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
|
||
| plugins { | ||
|
|
@@ -10,7 +10,7 @@ plugins { | |
| alias(libs.plugins.kotlin.ksp) | ||
| alias(libs.plugins.emerge) | ||
| alias(libs.plugins.sentry) | ||
| alias(libs.plugins.roborazzi) | ||
| alias(libs.plugins.paparazzi) | ||
| alias(libs.plugins.androidx.room) | ||
| } | ||
|
|
||
|
|
@@ -56,6 +56,7 @@ android { | |
| getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" | ||
| ) | ||
| signingConfig = signingConfigs.getByName("debug") | ||
| enableUnitTestCoverage = false | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just here in order to test a bug where users could disable unit tests for specific variants and the auto-wiring would fail trying to find a non-existent task. |
||
| } | ||
| create("playStoreRelease") { | ||
| initWith(getByName("release")) | ||
|
|
@@ -99,10 +100,6 @@ ksp { | |
| } | ||
|
|
||
| emerge { | ||
| snapshots { | ||
| tag.set("snapshot") | ||
| } | ||
|
|
||
| vcs { | ||
| gitHub { | ||
| // System.getenv override is for integration tests from the emerge-android repository | ||
|
|
@@ -127,16 +124,13 @@ sentry { | |
| updateSdkVariants.add("beta") | ||
| } | ||
|
|
||
| debug = true | ||
| } | ||
|
|
||
| afterEvaluate { | ||
| tasks.named<SentryUploadSnapshotsTask>("sentryUploadSnapshotsRelease") { | ||
| dependsOn(tasks.named("recordRoborazziDebug")) | ||
| snapshotsPath.set( | ||
| project.extensions.getByType<RoborazziExtension>().outputDir | ||
| ) | ||
| snapshots { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's our API! Everything else is wired up automatically when the paparazzi plugin is detected. |
||
| enabled = true | ||
| includePrivatePreviews = true | ||
| theme = "android:Theme.Transluscent.NoTitleBar" | ||
sentry[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| debug = true | ||
| } | ||
|
|
||
| dependencies { | ||
|
|
@@ -171,18 +165,12 @@ dependencies { | |
| ksp(libs.androidx.room.compiler) | ||
|
|
||
| testImplementation(libs.junit) | ||
| testImplementation(libs.robolectric) | ||
| testImplementation(libs.roborazzi) | ||
| testImplementation(libs.roborazzi.compose) | ||
| testImplementation(libs.roborazzi.rule) | ||
|
|
||
| androidTestImplementation(libs.androidx.junit) | ||
| androidTestImplementation(libs.androidx.espresso.core) | ||
| androidTestImplementation(platform(libs.androidx.compose.bom)) | ||
| androidTestImplementation(libs.androidx.ui.test.junit4) | ||
| androidTestImplementation(libs.emerge.snapshots) | ||
|
|
||
| debugImplementation(libs.androidx.ui.tooling) | ||
| debugImplementation(libs.androidx.ui.test.manifest) | ||
|
|
||
| } | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. paparazzi requires Gradle 9.1+ |
||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.