Skip to content

[tests] Copy installer runtime dependencies - #12649

Merged
simonrozsival merged 1 commit into
mainfrom
jonathanpeppers-fix-test-dependency-race
Sep 3, 2026
Merged

[tests] Copy installer runtime dependencies#12649
simonrozsival merged 1 commit into
mainfrom
jonathanpeppers-fix-test-dependency-race

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Summary

  • add direct Polly and SharpZipLib package references to Xamarin.Android.Build.Tests
  • make the test assembly's runtime copy-local closure independent of shared pack output ordering

Context

Azure DevOps build 1579349 failed AndroidDependenciesTests.InstallAndroidDependenciesTest("GoogleV2", CoreCLR) on Linux, macOS, and Windows because test-assemblies/net10.0 omitted ICSharpCode.SharpZipLib.dll and Polly.dll. The failure surfaced as:

System.IO.FileNotFoundException: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=1.3.3.11'

Xamarin.Installer.AndroidSDK intentionally excludes/private-assets these runtime dependencies unless its legacy PublicSharpZipLib and PublicPolly switches are set. Since #12580 made Xamarin.Android.Build.Tests consume that project directly, the test had accidentally relied on Xamarin.Installer.Build.Tasks copying both packages into a shared output directory first. Parallel project builds made that ordering nondeterministic.

Direct package references follow the existing explicit-consumer pattern in Xamarin.Installer.Build.Tasks and ensure NuGet includes both assemblies in the test project's own copy-local set. Setting AdditionalProperties on the ProjectReference would only configure the referenced project build and would leave the consuming test project's restore/copy-local intent indirect.

Validation

  • restored Xamarin.Android.Build.Tests targeting .NET 10
  • ran ResolvePackageAssets and confirmed both Polly.dll and ICSharpCode.SharpZipLib.dll are RuntimeCopyLocalItems with CopyLocal=true
  • git diff --check

Make the Xamarin.Installer.AndroidSDK runtime dependencies explicit in Xamarin.Android.Build.Tests so test artifact contents do not depend on another project winning a shared-output race.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 2, 2026 21:24

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.

🟢 Approval recommended

The change is scoped to deterministic dependency inclusion for tests and does not introduce behavioral risk to product code.

Pull request overview

This PR updates the Xamarin.Android.Build.Tests test project to make its runtime dependency closure deterministic by explicitly restoring/copying installer runtime dependencies (rather than relying on shared output ordering from parallel builds).

Changes:

  • Add direct Polly package reference to the test project.
  • Add direct SharpZipLib package reference to the test project.
File summaries
File Description
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj Adds explicit Polly and SharpZipLib package references to ensure the test assembly’s copy-local runtime dependencies are reliably included.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

@simonrozsival
simonrozsival merged commit fd364b2 into main Sep 3, 2026
45 checks passed
@simonrozsival
simonrozsival deleted the jonathanpeppers-fix-test-dependency-race branch September 3, 2026 04:59
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.

3 participants