Skip to content

test(gradle): Add isolated-projects compatibility test (EME-1072)#1160

Open
runningcode wants to merge 3 commits intomainfrom
no/eme-1072-isolated-projects-test
Open

test(gradle): Add isolated-projects compatibility test (EME-1072)#1160
runningcode wants to merge 3 commits intomainfrom
no/eme-1072-isolated-projects-test

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

@runningcode runningcode commented Apr 22, 2026

Summary

Adds an integration test verifying the Sentry Android Gradle Plugin is compatible with Gradle's Isolated Projects feature when applied to a realistic consumer build. Works toward EME-1072.

Fixture shape

  • Multi-module: :app (Android application) depends on :library (Android library), both apply io.sentry.android.gradle
  • Wires repositories, android, and plugin application per-project — no allprojects {} / subprojects {}, which are incompatible with Isolated Projects
  • Enables org.gradle.unsafe.isolated-projects=true in gradle.properties
  • Runs :app:assembleDebug --configuration-cache

Assertions

  • BUILD SUCCESSFUL
  • Output contains the isolated projects incubating banner — guards against the test silently degrading into a plain config-cache run
  • No Isolated Projects violation markers in output

Plugin features under test

Feature Enabled Notes
autoUploadProguardMapping ✅ true PI-compatible
telemetry ✅ true PI-compatible
autoInstallation.enabled ❌ false Not PI-compatible — tracked in EME-1072

autoInstallation is the only known Isolated Projects blocker surfaced by this test. With it enabled, the build fails at configuration cache storage with:

Plugin 'io.sentry.android.gradle': Project ':app' cannot access 'Project.group' functionality on another project ':library'

This matches the InvalidUserCodeException signal EME-1072 was opened to investigate and is left as a follow-up.

Adds an integration test that applies the plugin to a consumer project
with org.gradle.unsafe.isolated-projects=true enabled and asserts that
the build succeeds without isolation violations.

The fixture bypasses the shared root build.gradle written by
BaseSentryPluginTest because it relies on allprojects {} and
subprojects {}, both of which are incompatible with Isolated Projects.
Instead, this test wires repositories, Android config, and plugin
application per-project.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 22, 2026

Replaces the single-module fixture with an :app + :library setup where
:app depends on :library. This is where Isolated Projects compatibility
actually matters — single-module builds don't exercise cross-project
configuration at all.

Enables autoUploadProguardMapping and telemetry to broaden coverage of
plugin code paths under Isolated Projects. autoInstallation stays
disabled because it accesses Project.group on sibling projects during
dependency graph traversal at configuration time; tracked in EME-1072.
The old check for "problems were found reporting" never matches Gradle
output — the actual phrases are "problems were found storing the
configuration cache" or "problems were found reusing the configuration
cache". Broadening to "problems were found " catches both, so the
defensive check actually has teeth now.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3e37caa. Configure here.

// otherwise the test would silently degrade into a plain config-cache test.
assertTrue(output) { "isolated projects" in output.lowercase() }
assertFalse(
"problems were found " in output || "cannot access '" in output,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Assertion misses singular "problem was found" Gradle output

Low Severity

The violation check "problems were found " only matches the plural Gradle output (2+ problems) but not the singular "1 problem was found" form that Gradle uses for exactly one violation. If a single isolated-projects violation occurs whose message doesn't contain "cannot access '", the assertFalse passes silently, defeating the purpose of this guard. Matching on "problem" (without the 's') or both forms would close this gap.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3e37caa. Configure here.

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