ci: run instrumented ApiDemos tests on an emulator - #2437
Merged
Merged
Conversation
The androidTest sources under ApiDemos have never been executed by any workflow. build.yml covers assembleDebug, testDebugUnitTest and lintDebug, so 18 instrumented test files across java-app and kotlin-app (camera, circle, ground overlay, indoor, visible region and camera clamping demos) have been sitting unrun. These tests drive a real map, so they need a Maps API key. This repository has no such secret today, so the emulator job gates on ACTIONS_API_KEY and skips when it is absent. The workflow stays a no-op until the secret is provisioned, then starts enforcing on its own.
dkhawk
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
androidTestsources underApiDemoshave never been executed by any workflow.build.ymlalready coversassembleDebug,testDebugUnitTestandlintDebug, so JVM unit tests are fine. What has no coverage is the instrumented suite: 18 test files acrossjava-appandkotlin-app, includingCameraDemoActivityTest,CircleDemoActivityTest,GroundOverlayDemoActivityTest,IndoorDemoActivityTest,VisibleRegionDemoActivityTestandCameraClampingDemoActivityTest, plus theMapIdlingResourceand Truth subjects they rely on.This matters right now because #2426 and #2427 add 14 more
androidTestfiles between them. Without this, that new work starts rotting the day it merges.What this adds
.github/workflows/instrumentation-test.yml, modelled on the equivalent workflow inandroid-maps-compose:connectedDebugAndroidTeston an API 29google_apisemulator.:ApiDemos:java-appand:ApiDemos:kotlin-appwithfail-fast: false, so one failing module does not mask the other.MapIdlingResourcetimeouts.The prerequisite, and why this is currently a no-op
These tests render a real map, so they need a Maps API key.
The
googlemaps-samplesorg currently exposes onlySYNCED_GITHUB_TOKEN_REPO, and this repo's own secrets areSONATYPE_TOKEN,SONATYPE_TOKEN_PASSWORDandSYNCED_GPG_KEY_ARMOR. There is no Maps API key available to CI at all, unlike thegooglemapsorg which hasACTIONS_API_KEYandSYNCED_GOOGLE_MAPS_API_KEY_ANDROID.So rather than adding a check that fails on every PR, the emulator job gates on
ACTIONS_API_KEYand skips cleanly when the secret is absent. Secrets cannot be referenced from a job-levelif, hence the smallcheck-api-keyjob that resolves it into an output.Provisioning
ACTIONS_API_KEYfor this repository is the actual unblocking step. Once it exists, this workflow starts enforcing with no further change. Until then it is deliberately inert, and merging it is safe.Worth deciding separately whether the key should be an org-level secret in
googlemaps-samples, which would also serve any other sample app that wants instrumented coverage later.