[tests] Use MSTestPackageVersion in DotNetNewAndroidTest#11209
Merged
simonrozsival merged 2 commits intomainfrom Apr 25, 2026
Merged
[tests] Use MSTestPackageVersion in DotNetNewAndroidTest#11209simonrozsival merged 2 commits intomainfrom
simonrozsival merged 2 commits intomainfrom
Conversation
e2dd182 to
bbd0e11
Compare
After `dotnet new androidtest` creates the template project, override the stable MSTest version with the preview version from eng/Versions.props. This ensures the test validates against the same MSTest version used by the rest of the build, while the template keeps the stable version for customers. The version is embedded as assembly metadata in MSBuildDeviceIntegration.csproj and read at runtime to update the generated .csproj before building. [tests] Enable CoreCLR in DotNetNewAndroidTest Remove the Assert.Ignore for CoreCLR runtime, enabling the test for both MonoVM and CoreCLR configurations. Fixes #11174 Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
bbd0e11 to
1968080
Compare
Pass RestoreAdditionalProjectSources to include the test-tools feed so the preview MSTest package version can be restored during the build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the dotnet new androidtest device integration test flow to build generated template projects using the repo’s pinned (preview) MSTest package version, enabling validation of incoming microsoft/testfx changes while keeping customer templates on stable MSTest.
Changes:
- Embed
MSTestPackageVersioninto the MSBuildDeviceIntegration test assembly viaAssemblyMetadataAttribute. - Read that assembly metadata at runtime and rewrite the generated
androidtestproject’s MSTestPackageReferenceversion before building. - Add the required additional NuGet feed for restoring preview MSTest packages, and track the dependency in
eng/Version.Details.xml.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs | Rewrites generated template .csproj to use the assembly-embedded MSTest version; adds preview feed for restore. |
| tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.csproj | Embeds MSTestPackageVersion as assembly metadata for runtime retrieval. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs | Adds helper to read AssemblyMetadataAttribute values from the executing test assembly. |
| eng/Versions.props | Introduces MSTestPackageVersion property for repo-wide pinning. |
| eng/Version.Details.xml | Adds MSTest dependency entry for dependency tracking/subscriptions. |
Member
|
CI failures are unrelated |
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.

After
dotnet new androidtestcreates the template project, override the stable MSTest version with the preview version fromeng/Versions.props. This let's us validate nightly/weekly microsoft/testfx changes, while the template keeps the stable version for customers.The version is embedded as assembly metadata in MSBuildDeviceIntegration.csproj and read at runtime to update the generated .csproj before building.
After this is merged, I'll setup a Maestro/darc subscription on a weekly cadence.