Skip to content

test(oss-licenses): introduce unified 'testapp' verification suite#380

Open
timothyfroehlich wants to merge 12 commits intorefactor-lazy-providerfrom
froeht/integration-tests
Open

test(oss-licenses): introduce unified 'testapp' verification suite#380
timothyfroehlich wants to merge 12 commits intorefactor-lazy-providerfrom
froeht/integration-tests

Conversation

@timothyfroehlich
Copy link
Member

@timothyfroehlich timothyfroehlich commented Mar 10, 2026

Overview

This PR introduces a robust, standalone 'testapp' verification suite for the oss-licenses-plugin. It significantly expands the testing capabilities of the repository by providing both an interactive app for manual verification and full end to end robolectric tests of the plugin and library together.

Key Changes vs Main

1. New 'testapp' Project

  • Interactive UI: A Compose-based MainActivity with buttons to explicitly launch the V1 (Legacy View) and V2 (Modern Compose) license activities provided by the library.
  • Authentic Testing: Unit tests are configured with full R8 minification and obfuscation for the release variant to verify the plugin's behavior in production-like scenarios.

2. Robolectric Test Suite

  • Variant-Aware Testing:
    • src/testRelease: Verifies comprehensive license metadata (Gson/Guava) and detail navigation against the minified release build.
    • src/testDebug: Validates the 'Debug License Info' placeholder injected by the plugin in development builds.
  • Configured to run across a wide range of SDKs (24, 33, 34, 35) with support for parallel execution.

3. Dynamic E2E Matrix Runner

  • TestAppEndToEndTest.kt: A new E2E test in the main plugin suite that uses the testapp as a template. It dynamically injects AGP and Kotlin overrides to test the plugin against its full compatibility matrix (currently AGP 8.10 through 9.1).

4. Infrastructure & Hygiene

  • GitHub Actions: Integrated the new testapp verification into the main.yml workflow to run on every pull request.
  • Dependabot: Configured automatic weekly updates for the new testapp dependencies.
  • Documentation: Added a dedicated GEMINI.md guide for maintaining the test harness.

Verification

  • ✅ Local verification via ./gradlew :app:test (all 15 tests pass).
  • ✅ E2E matrix verification across all defined AGP/Gradle versions.
  • ✅ Manual UI verification on emulator.

@timothyfroehlich timothyfroehlich self-assigned this Mar 10, 2026
@timothyfroehlich timothyfroehlich marked this pull request as draft March 10, 2026 00:54
@timothyfroehlich timothyfroehlich force-pushed the gradle-upgrade branch 2 times, most recently from 7d66eeb to 5e232d6 Compare March 10, 2026 00:56
@timothyfroehlich timothyfroehlich force-pushed the froeht/integration-tests branch 2 times, most recently from 472d6fc to 661c53b Compare March 12, 2026 22:24
@timothyfroehlich timothyfroehlich changed the title test(oss-licenses): introduce unified integration-app test suite test(oss-licenses): introduce unified 'testapp' verification suite Mar 12, 2026
@timothyfroehlich timothyfroehlich changed the base branch from gradle-upgrade to main March 13, 2026 15:58
@timothyfroehlich timothyfroehlich marked this pull request as ready for review March 13, 2026 17:10
… ArtifactView providers

Replace the DependencyUtil helper and ArtifactFiles wrapper with lazy
Provider-based artifact resolution directly in OssLicensesPlugin. This
ensures dependency resolution happens at task execution time rather than
during configuration, which is required for Configuration Cache
compatibility and avoids slowing down Android Studio sync.

Key changes:
- Use ArtifactView.resolvedArtifacts (returns Provider) instead of
  eagerly iterating configuration.incoming.artifacts
- Split the single @nested MapProperty<String, ArtifactFiles> into two
  @internal MapProperty<String, File> properties (libraryFilesByGav,
  pomFilesByGav) to avoid expensive redundant hashing of immutable
  Maven artifacts
- Extract DependencyHandler into a local variable before entering lazy
  closures to avoid capturing the non-serializable Project object
- Move ABSENT_ARTIFACT constant from deleted DependencyUtil to
  DependencyTask where it is used
- Delete ArtifactFiles, DependencyUtil, and DependencyResolutionTest
  (coverage provided by existing EndToEnd integration tests)
Add assertion to testConfigurationCache that fails if Gradle logs
"resolved during configuration time", catching any regression where
artifact resolution leaks back into the configuration phase.
@timothyfroehlich timothyfroehlich force-pushed the froeht/integration-tests branch 2 times, most recently from e7309bf to 37cbfb7 Compare March 16, 2026 16:19
This was surfaced by the test app being introduced in #380
@timothyfroehlich timothyfroehlich force-pushed the froeht/integration-tests branch from 5517dd4 to d1ed623 Compare March 16, 2026 21:41
@timothyfroehlich timothyfroehlich changed the base branch from main to refactor-lazy-provider March 16, 2026 21:42
timothyfroehlich and others added 5 commits March 16, 2026 21:46
Rename 'integration-app' to 'testapp' and align project structure with
modern development standards.

- Refactor 'integration-app' to 'testapp' with package
  'com.google.android.gms.oss.licenses.testapp'.
- Implement a Compose-based MainActivity with interactive buttons for
  manual V1/V2 license activity testing.
- Divide Robolectric suite into variant-aware source sets:
    - 'testDebug': Sanity checks for 'Debug License Info' placeholder.
    - 'testRelease': High-signal verification of minified and obfuscated
      license metadata.
- Refactor 'TestAppEndToEndTest.kt' to dynamically inject AGP/Kotlin
  overrides, enabling the matrix to test older compatible versions.
- Enable parallel test execution and harmonize SDK coverage (24-36).
- Standardize all files with Apache 2.0 license headers.
- Update GitHub Actions workflow and Dependabot to target 'testapp'.
…class names

Rename TestAppEndToEndTest (which builds the real testapp) to EndToEndTest,
and update all class references in both files to match their new filenames:
- IntegrationTest: synthetic GradleTestKit projects (config cache, relocatability, etc.)
- EndToEndTest: full testapp build with real dependencies and Robolectric tests
@timothyfroehlich timothyfroehlich force-pushed the froeht/integration-tests branch from d1ed623 to 3f48d4a Compare March 16, 2026 22:01
@timothyfroehlich timothyfroehlich requested a review from xyarco March 16, 2026 22:11
""".trimIndent(),
"""
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
@Suppress("DEPRECATION")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can use

compilerOptions {
  ...
}

here as well to avoid @Suppress

timothyfroehlich and others added 2 commits March 17, 2026 17:20
(caused issues with modifying the test app and running check)
timothyfroehlich added a commit that referenced this pull request Mar 17, 2026
This was surfaced by the test app being introduced in #380
timothyfroehlich added a commit to timothyfroehlich/play-services-plugins that referenced this pull request Mar 18, 2026
This was surfaced by the test app being introduced in google#380
timothyfroehlich added a commit to timothyfroehlich/play-services-plugins that referenced this pull request Mar 18, 2026
This was surfaced by the test app being introduced in google#380
timothyfroehlich added a commit to timothyfroehlich/play-services-plugins that referenced this pull request Mar 18, 2026
This was surfaced by the test app being introduced in google#380
timothyfroehlich added a commit to timothyfroehlich/play-services-plugins that referenced this pull request Mar 18, 2026
This was surfaced by the test app being introduced in google#380
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