Skip to content

Migrate Firebase Test Lab jobs to CircleCI emulators#3238

Merged
tonidero merged 14 commits into
mainfrom
migrate-firebase-to-circleci-emulators
Mar 16, 2026
Merged

Migrate Firebase Test Lab jobs to CircleCI emulators#3238
tonidero merged 14 commits into
mainfrom
migrate-firebase-to-circleci-emulators

Conversation

@tonidero

@tonidero tonidero commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace three Firebase Test Lab CI jobs (run-firebase-tests, run-firebase-tests-purchases-integration-tests, run-firebase-tests-purchases-custom-entitlement-computation-integration-test) with CircleCI machine executor + Android emulator equivalents
  • Remove gcp-cli orb, Firebase command template, and APK-build-only jobs (integration-tests-build, purchases-integration-tests-build)
  • Update Fastlane lanes to run connectedAndroidTest directly 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-cli orb and Firebase/gcloud-based test commands.

Replaces prior APK-build-and-upload flow with emulator-driven Gradle connected...AndroidTest runs 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 deprecated Bundle#getSerializable(String) with a suppression to maintain compatibility.

Written by Cursor Bugbot for commit 90009ee. This will update automatically on new commits. Configure here.

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>
tonidero and others added 4 commits March 16, 2026 09:38
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>
@tonidero tonidero changed the base branch from main to facundo/fix-auto-renewing-token-caching March 16, 2026 11:45
@tonidero tonidero changed the base branch from facundo/fix-auto-renewing-token-caching to main March 16, 2026 11:45
@tonidero tonidero marked this pull request as ready for review March 16, 2026 13:40
@tonidero tonidero requested a review from a team as a code owner March 16, 2026 13:40

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Create PR

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"
+      }
     )
   end

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread fastlane/Fastfile
…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>
Comment thread .circleci/config.yml
… 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>
Comment thread .circleci/config.yml
@codecov

codecov Bot commented Mar 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.40%. Comparing base (840ce39) to head (90009ee).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rickvdl rickvdl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great migration 🙌 Couple of small questions :)

Comment thread .circleci/config.yml
Comment thread .circleci/config.yml
Comment thread .circleci/config.yml Outdated
google_project_id: GOOGLE_PROJECT_ID
- android/create_avd:
avd_name: test-purchases-integration
system_image: system-images;android-32;google_apis;x86_64

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread .circleci/config.yml Outdated
Comment thread .circleci/config.yml Outdated
@tonidero tonidero enabled auto-merge March 16, 2026 15:14
@tonidero tonidero added this pull request to the merge queue Mar 16, 2026
Merged via the queue into main with commit 81133f3 Mar 16, 2026
31 checks passed
@tonidero tonidero deleted the migrate-firebase-to-circleci-emulators branch March 16, 2026 15:44
github-merge-queue Bot pushed a commit that referenced this pull request Mar 16, 2026
### 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>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 16, 2026
**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 -->
rickvdl added a commit that referenced this pull request Mar 19, 2026
… 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.
github-merge-queue Bot pushed a commit that referenced this pull request Mar 19, 2026
… 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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants