Skip to content

test: add end-to-end demo smoke test - #1018

Closed
kikoso wants to merge 2 commits into
mainfrom
test/demo-smoke-test
Closed

kikoso wants to merge 2 commits into
mainfrom
test/demo-smoke-test

Conversation

@kikoso

@kikoso kikoso commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds an end-to-end smoke test for the demo app, the same approach as googlemaps/android-maps-utils#1805.

  • DemoSmokeTest (parameterized, one case per demo): starts MainActivity, opens the demo through the menu, waits for its map, zooms out and back in, checks the demo is still in the foreground, and navigates back. StreetViewActivity has no map and is only checked for staying open.
  • DemoCatalogTest: fails if a demo activity is declared in the manifest but missing from the menu (or the other way round), so new demos added to allActivityGroups are covered automatically.
  • The only app change is test tags on the menu cards in Demo.kt.

No new workflow: the existing emulator job (createDebugCoverageReport) runs all of maps-app/src/androidTest, so it picks the tests up. Changes to that job:

  • Passes requireMapLoaded=true when ACTIONS_API_KEY is available, so the smoke test also waits for map tiles to render. Without the secret (forks, Dependabot) the smoke test still runs, it just does not wait for tiles.
  • Runs on API 36 (x86_64) instead of API 29. Emulators never update Google Play services, and in android-maps-utils#1805 the bundled version on older images crashed inside Play services when adding advanced markers. API 36 bundles 25.26, which works. This also moves the existing instrumentation tests to API 36.

Notes

  • Unlike utils, this does not enable Android Test Orchestrator, because the same job collects instrumentation coverage and clearing package data between tests risks losing the coverage files. A crashing demo therefore aborts the rest of the run, though the failure is still reported.
  • The GoogleMap composable registers its loaded callback once, so when waiting for tiles the test replaces it and a demo's own onMapLoaded stops firing for the rest of that case. Demos only use it for UI like loading indicators, which the test does not check.

Testing

On a local API 34 emulator:

  • DemoCatalogTest 1/1 and DemoSmokeTest 22/22 pass without the map-loaded check (about 1:45).
  • Same with requireMapLoaded=true and a real key: 23/23 (about 2:15), including lite mode.
  • :maps-app:lintDebug passes.

Run locally with:

./gradlew :maps-app:connectedDebugAndroidTest \
  -Pandroid.testInstrumentationRunnerArguments.package=com.google.maps.android.compose.smoke

kikoso added 2 commits October 1, 2026 12:34
Opens every demo from the menu on an emulator, waits for its map, zooms
out and back in, and navigates back. DemoCatalogTest keeps the menu and
the manifest in sync so new demos are covered automatically.
Emulators never update Google Play services. The bundled version on older
images crashes inside Play services when adding advanced markers. When the
Maps API key secret is available, the demo smoke test also waits for map
tiles to render.
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Coverage (unit tests)

No unit baseline recorded in coverage/history.csv yet, so this run only reports absolute numbers.

Module Line % Change Branch % Change
maps-compose 0.00% new 0.00% new
maps-compose-utils 2.04% new 0.49% new
maps-compose-widgets 0.00% new 0.00% new
TOTAL 0.42% new 0.09% new

Line and branch coverage from unit test reports. History is recorded in coverage/history.csv after each merge to main.

@kikoso
kikoso marked this pull request as ready for review October 1, 2026 10:47
@kikoso
kikoso requested a review from a team as a code owner October 1, 2026 10:47
@kikoso

kikoso commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Closing as a duplicate of #1007. The CI changes from here (API 36, Ubuntu with KVM, and requireMapLoaded when the key secret is available) and the zoom check have moved there.

@kikoso kikoso closed this Oct 1, 2026
@kikoso
kikoso deleted the test/demo-smoke-test branch October 1, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants