test: add end-to-end demo smoke test - #1805
Merged
Merged
Conversation
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. Runs with Android Test Orchestrator so a crashing demo fails only its own case. Adds a Demo smoke test workflow that uses ACTIONS_API_KEY and skips when the secret is not available.
Contributor
Code Coverage
|
…polyline demo Found by the demo smoke test on CI. On emulator images with older Google Play services the Maps SDK needs org.apache.http.legacy when targeting API 28+, and PolylineProgressDemoActivity called newLatLngBounds before the map had a size.
The google_apis image only provides the legacy maps renderer, where adding advanced markers crashes inside Google Play services.
Emulators never update Google Play services. The API 34 images bundle 23.18, which only loads the legacy maps renderer, where adding advanced markers crashes inside Play services.
This was referenced Oct 1, 2026
dkhawk
approved these changes
Oct 1, 2026
dkhawk
left a comment
Contributor
There was a problem hiding this comment.
Overall this is fantastic work, @kikoso! Bringing end-to-end smoke testing under Android Test Orchestrator with DemoCatalogTest keeping the manifest and menu in sync is a huge reliability win for the repo. The fact that it already caught the legacy Apache HTTP dependency and the polyline bounds layout race proves its value immediately.
A couple of minor suggestions:
- LazyColumn scroll on group headers: In
DemoSmokeTest.kt, consider adding.performScrollTo()before.performClick()on the group header as well (composeRule.onNodeWithTag(groupTestTag(group)).performScrollTo().performClick()). SinceDemoListusesLazyColumn, on smaller screens or landscape mode, headers near the bottom (like Street View) might not be composed yet when clicked. - Post-merge CI on
main: Consider addingpush: branches: [main]to.github/workflows/demo-smoke-test.ymlso that post-merge commits and automated bot bumps tomainare validated too.
LGTM! 🚀
dkhawk
approved these changes
Oct 1, 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.
Summary
Adds an end-to-end smoke test for the demo app, so a broken demo is caught in CI instead of by users.
DemoSmokeTest(parameterized, one case per demo): startsMainActivity, opens the demo through the menu, waits for its map, zooms out and back in (which exercises the camera-idle path clustering and renderers hook into), checks the demo is still in the foreground, and navigates back. The two Street View demos have no map and are 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 todemoGroups()are covered automatically.Demo smoke testworkflow: runs the suite on an API 36 emulator withACTIONS_API_KEYandrequireMapLoaded=true. Skips with a notice when the secret is not available (forks, Dependabot).Supporting changes: the demo list moved to a top-level
demoGroups()inMainActivity.kt, menu rows got test tags, andAGENTS.mddocuments how to run it.Notes
assumeTrueis reported as a failure by the test platform here, so instead the test generates no cases and logs a warning.class=runner argument only ran the first class of a comma-separated list, so the tests live in asmokepackage and are filtered by package.Found by the test
The first CI runs with a real key caught two demo bugs, fixed here:
org.apache.http.legacy, which the Maps SDK needs when targeting API 28+ on devices with older Play services. 25 demos crashed withNoClassDefFoundError: org/apache/http/ProtocolVersion. The compose demo already declares it.PolylineProgressDemoActivitycallednewLatLngBoundsbefore the map was laid out ("Map size can't be 0"), which shows up on slower devices. It now waits for layout.Testing
CI:
Demo smoke testpasses, 29/29 withACTIONS_API_KEYandrequireMapLoaded=true.On a local API 34 emulator with a fake key in a valid format:
DemoCatalogTest1/1 andDemoSmokeTest28/28 pass (about 2:45).ClusteringDemoActivity, only that case failed and the other 27 still ran.:demo:lintStandardDebugand:demo:testStandardDebugUnitTestpass.Run locally with: