Migrate Firebase Test Lab jobs to CircleCI emulators#3238
Conversation
Remove the Firebase/GCP dependency for instrumentation tests by running them on CircleCI machine executors with Android emulators instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit will be reverted after confirming the jobs work on CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Switch all emulator images from android-34 to android-32 to avoid RECEIVER_EXPORTED SecurityException on API 34+ - Use connectedAndroidTest -PtestBuildType=release instead of connectedReleaseAndroidTest which doesn't exist in integration-tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use build/outputs/androidTest-results for instrumentation tests instead of build/test-results which is for unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bundle.getSerializable(String, Class) was added in API 33. Use the deprecated getSerializable(String) overload for compatibility with the API 32 emulator. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Integration tests changed from release to debug build type
- Updated the Fastlane lanes to run the release connected Android test tasks and pass testBuildType=release so purchases integration tests execute against the release build again.
Or push these changes by commenting:
@cursor push 0536d845f7
Preview (0536d845f7)
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -443,8 +443,11 @@
UI.message("Attempt #{attempt} of #{max_retries}")
gradle(
- task: ":purchases:connectedDefaultsBc8DebugAndroidTest",
- properties: { "minSdkVersion" => 21 }
+ task: ":purchases:connectedDefaultsBc8ReleaseAndroidTest",
+ properties: {
+ "minSdkVersion" => 21,
+ "testBuildType" => "release"
+ }
)
success = true
@@ -483,8 +486,11 @@
)
gradle(
- task: ":purchases:connectedCustomEntitlementComputationBc8DebugAndroidTest",
- properties: { "minSdkVersion" => 21 }
+ task: ":purchases:connectedCustomEntitlementComputationBc8ReleaseAndroidTest",
+ properties: {
+ "minSdkVersion" => 21,
+ "testBuildType" => "release"
+ }
)
endThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
…ulators Switch connectedAndroidTest tasks from debug to release variants to match the previous Firebase Test Lab configuration which ran against release APKs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… jobs All three emulator jobs now attach the workspace from prepare-tests for prebuilt artifacts, and run-integration-tests gets build cache restore/save. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3238 +/- ##
=======================================
Coverage 79.40% 79.40%
=======================================
Files 356 356
Lines 14345 14345
Branches 1959 1959
=======================================
Hits 11390 11390
Misses 2151 2151
Partials 804 804 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rickvdl
left a comment
There was a problem hiding this comment.
Great migration 🙌 Couple of small questions :)
| google_project_id: GOOGLE_PROJECT_ID | ||
| - android/create_avd: | ||
| avd_name: test-purchases-integration | ||
| system_image: system-images;android-32;google_apis;x86_64 |
There was a problem hiding this comment.
If I'm not mistaken the Firebase job used API level 33, could we keep it the same or does the CI infrastructure require this?
There was a problem hiding this comment.
I mostly used 32 here because it was what we were using on other tests... We should be able to update up to 33 yeah (though no more because of some incompatibilities with our current version of Robolectric :( ). It should be mostly the same I think, but will do the change to keep it the same way
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
This reverts commit 21cb983.
### Description After removing usages of firebase test lab devices of integration tests in #3238, this makes those tests run on all branches, even if not release branches. It keeps the daily run jobs in any case, that run against the load shedder to make sure that flow is tested. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are limited to CI/fastlane test orchestration, mainly broadening when emulator integration tests run and toggling Slack/heartbeat notifications; primary risk is increased CI load or missed alerts if the flag is misconfigured. > > **Overview** > Runs Android emulator integration test jobs (including purchases and CEC variants) on **all branches** by removing the `release-branches` workflow filters. > > Adds an opt-in `notify_slack` parameter for `run-purchases-integration-tests` that passes `NOTIFY_SLACK` into Fastlane, and updates the Fastlane lane to only post Slack results/ping the heartbeat monitor when that flag is `true` (enabled for the daily load-shedder scheduled runs). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9179387. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
**This is an automatic release.** ## RevenueCat SDK ### 🐞 Bugfixes * Fix & Standardize Galaxy Date Parsing Edge Cases (#3216) via Will Taylor (@fire-at-will) * Fix addSuccessfullyPostedToken for new purchases in PostPendingTransactionsHelper (#3239) via Facundo Menzella (@facumenzella) * [Galaxy]: Fix race condition when fetching Galaxy products (#3213) via Will Taylor (@fire-at-will) * Fixes double padding in PaywallActivity on Android 15+ when `edgeToEdge` parameter is false (#3227) via Cesar de la Vega (@vegaro) ## RevenueCatUI SDK ### 🐞 Bugfixes * Fix bold text not rendering in Markdown lists (#3228) via Cesar de la Vega (@vegaro) * Fix: Clear in-memory offerings cache on locale override to prevent stale paywall data (#3225) via Antonio Pallares (@ajpallares) ### Paywallv2 #### ✨ New Features * Feature: Update default paywall (#3133) via Jacob Rakidzich (@JZDesign) #### 🐞 Bugfixes * Fix V2 paywall safe area in landscape mode (#3221) via Cesar de la Vega (@vegaro) ### 🔄 Other Changes * Run integration tests on all branches (#3242) via Toni Rico (@tonidero) * Migrate Firebase Test Lab jobs to CircleCI emulators (#3238) via Toni Rico (@tonidero) * Run metalava on galaxy module in test-galaxy job (#3235) via Will Taylor (@fire-at-will) * Add offering_id to custom paywall impression event (#3230) via Rick (@rickvdl) * Cache isAutoRenewing to detect subscription changes without syncPurchases (#3198) via Facundo Menzella (@facumenzella) * Bump fastlane-plugin-revenuecat_internal from `e146447` to `3e8c384` (#3233) via dependabot[bot] (@dependabot[bot]) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk release housekeeping: version string bumps and documentation/deployment path updates with no functional runtime logic changes beyond the exposed version constant. > > **Overview** > Publishes the `9.26.0` release by removing `-SNAPSHOT` across build/version metadata (root `VERSION_NAME`, `.version`, `Config.frameworkVersion`, and sample/test app dependency pins). > > Updates release documentation artifacts by adding the `9.26.0` notes to `CHANGELOG.md`/`CHANGELOG.latest.md`, switching docs deployment in CircleCI to sync `docs/9.26.0` to S3, and updating `docs/index.html` to redirect to the new version. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0a30a45. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
… tests Move `ping_heartbeat_monitor` outside the `NOTIFY_SLACK` conditional so it always fires, regardless of whether Slack notifications are enabled. Quote the `NOTIFY_SLACK` environment variable in CircleCI config to ensure the boolean parameter renders as the string "true" that the Fastfile expects. Both issues were introduced in #3238 (Firebase to CircleCI emulator migration). The old code had no `NOTIFY_SLACK` gate — Slack and heartbeat always ran. The migration wrapped both in a conditional, and the heartbeat should not have been gated.
… tests (#3259) ## Summary - Move `ping_heartbeat_monitor` outside the `NOTIFY_SLACK` conditional so it always fires, regardless of whether Slack notifications are enabled - Quote the `NOTIFY_SLACK` environment variable in CircleCI config to ensure the boolean parameter renders as the string `"true"` that the Fastfile expects Both issues were introduced in #3238 (Firebase to CircleCI emulator migration). The old code had no `NOTIFY_SLACK` gate — Slack and heartbeat always ran. The migration wrapped both in a conditional, and the heartbeat should not have been gated. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk CI/automation change affecting only nightly integration-test notifications; main risk is unintended extra heartbeat pings or Slack notifications if the env var is misinterpreted. > > **Overview** > Fixes nightly purchases integration test observability by **always** calling `ping_heartbeat_monitor` in the `run_purchases_integration_tests` lane, instead of gating it behind `NOTIFY_SLACK`. > > Updates CircleCI’s `run-purchases-integration-tests` job to quote the `NOTIFY_SLACK` parameter so Fastlane receives a string (e.g. `"true"`) that matches the `ENV['NOTIFY_SLACK'] == 'true'` check. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ba1ca00. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->


Summary
run-firebase-tests,run-firebase-tests-purchases-integration-tests,run-firebase-tests-purchases-custom-entitlement-computation-integration-test) with CircleCI machine executor + Android emulator equivalentsgcp-cliorb, Firebase command template, and APK-build-only jobs (integration-tests-build,purchases-integration-tests-build)connectedAndroidTestdirectly on the emulator instead of building separate APKs and uploading to Firebase🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it rewires CI execution for Android instrumentation/integration tests (new machine executor emulators, different build/run commands), which can change coverage, flakiness, and runtime behavior despite no production code changes.
Overview
Migrates Android integration/instrumentation test execution from Firebase Test Lab to CircleCI machine executor emulators, removing the
gcp-cliorb and Firebase/gcloud-based test commands.Replaces prior APK-build-and-upload flow with emulator-driven Gradle
connected...AndroidTestruns via Fastlane, adds new CircleCI jobs (run-integration-tests,run-purchases-integration-tests,run-purchases-cec-integration-tests) and updates workflows/schedules accordingly, and adjusts test result collection paths.Also updates an Android test (
ErrorsTest) to use deprecatedBundle#getSerializable(String)with a suppression to maintain compatibility.Written by Cursor Bugbot for commit 90009ee. This will update automatically on new commits. Configure here.