Repository navigation
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.
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.
Coverage (unit tests)No unit baseline recorded in
Line and branch coverage from unit test reports. History is recorded in |
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. |
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, the same approach as googlemaps/android-maps-utils#1805.
DemoSmokeTest(parameterized, one case per demo): startsMainActivity, 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.StreetViewActivityhas 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 toallActivityGroupsare covered automatically.Demo.kt.No new workflow: the existing emulator job (
createDebugCoverageReport) runs all ofmaps-app/src/androidTest, so it picks the tests up. Changes to that job:requireMapLoaded=truewhenACTIONS_API_KEYis 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.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
GoogleMapcomposable registers its loaded callback once, so when waiting for tiles the test replaces it and a demo's ownonMapLoadedstops 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:
DemoCatalogTest1/1 andDemoSmokeTest22/22 pass without the map-loaded check (about 1:45).requireMapLoaded=trueand a real key: 23/23 (about 2:15), including lite mode.:maps-app:lintDebugpasses.Run locally with: