Skip to content

[flaky-ci] Use embedded jars in desugar test - #12710

Merged
jonathanpeppers merged 2 commits into
mainfrom
simonrozsival-desugar-dependency-resilience
Sep 9, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
simonrozsival-desugar-dependency-resilience

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Summary

  • load the existing Okio, OkHttp, Retrofit, converter-gson, and Gson test jars from embedded repository resources
  • remove runtime Maven feed access while preserving the exact dependency bytes and desugar behavior under test
  • keep the full parameterized test matrix and dex assertions unchanged

Testing

  • ./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter "Name~Desugar"
  • Passed: 6; skipped as unsupported: 2

Tracked by #12704

Avoid downloading the test's existing jar fixtures while materializing the project, so transient Maven feed timeouts cannot fail desugar coverage.

Co-authored-by: Copilot App <[email protected]>
@simonrozsival simonrozsival added the flaky-ci Intermittent CI failures and work to improve CI reliability label Sep 8, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #12710

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No code issues found. The five Maven downloads are replaced by existing embedded test resources with the same filenames, and TestResourceFileName supplies their bytes through the project’s established BinaryContent path.

CI is currently red in Package Tests macOS > Tests > APKs 2; the visible MSBuild test lanes relevant to this change passed. Deeper Azure log inspection was unavailable because Azure CLI could not access its required local profile, so I could not classify that package-test failure beyond its unrelated lane.

Generated by Android PR Reviewer for #12710 · gpt56 · 124.6 AIC · ⌖ 9.1 AIC · ⊞ 25.7K
Comment /review to run again

@simonrozsival
simonrozsival marked this pull request as ready for review September 9, 2026 15:02
Copilot AI lite review requested due to automatic review settings September 9, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The change is localized to test infrastructure, aligns with the stated goal of removing network dependency for the desugar test, and doesn’t alter the test’s behavioral assertions.

Review tier: Lite
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity src/​Xamarin.Android.Build.Tasks/​Tests/​Xamarin.Android.Build.Tests/​BuildTest.cs — 💡 Maintainability — Switching from explicit Maven URLs to embedded resources removes the…
What changed in this PR

Updates the Desugar build test to use embedded JARs from Xamarin.ProjectTools test resources instead of downloading from the public Maven feed, aiming to reduce CI flakiness while keeping the desugar behavior and assertions unchanged.

Changes:

  • Switch the Desugar test’s Okio/OkHttp/Retrofit/Gson JAR inputs from WebContent downloads to TestResourceFileName embedded resources.
  • Preserve the existing parameterized test matrix and desugar assertions while removing runtime dependency on external Maven access.
File Description
src/​Xamarin.Android.Build.Tasks/​Tests/​Xamarin.Android.Build.Tests/​BuildTest.cs Updates the Desugar test to load dependency JAR bytes from embedded test resources instead of network downloads.

Comment on lines 1218 to +1222
proj.OtherBuildItems.Add (new BuildItem ("AndroidJavaLibrary", "okio-1.13.0.jar") {
WebContent = $"{TestEnvironment.DotNetPublicMaven}/com/squareup/okio/okio/1.13.0/okio-1.13.0.jar"
TestResourceFileName = "okio-1.13.0.jar"
});
proj.OtherBuildItems.Add (new BuildItem ("AndroidJavaLibrary", "okhttp-3.8.0.jar") {
WebContent = $"{TestEnvironment.DotNetPublicMaven}/com/squareup/okhttp3/okhttp/3.8.0/okhttp-3.8.0.jar"
TestResourceFileName = "okhttp-3.8.0.jar"

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, weird why are we even downloading them if they are checked in...

@jonathanpeppers
jonathanpeppers merged commit 18479db into main Sep 9, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the simonrozsival-desugar-dependency-resilience branch September 9, 2026 19:31
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

flaky-ci Intermittent CI failures and work to improve CI reliability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants