-
Notifications
You must be signed in to change notification settings - Fork 556
[ci] run MSBuild "SmokeTests" category on all runtimes #10085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] run MSBuild "SmokeTests" category on all runtimes #10085
Conversation
For each "smoke test" that build an Android application project (libraries not really relevant), we run the test on all runtimes. For each test, I generally added two more test cases for NativeAOT and CoreCLR. This is a first step to ensure that we don't break CoreCLR or NativeAOT support at build time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the Android smoke test suite by supporting multiple .NET runtime configurations (MonoVM, CoreCLR, NativeAOT) during MSBuild execution. Key changes include:
- Adding a SetRuntime extension method in ProjectExtensions.cs to set the appropriate runtime property.
- Updating test cases in PackagingTest.cs, BuildTest.cs, BuildTest.TestCaseSource.cs, and AssetPackTests.cs to include a new AndroidRuntime parameter.
- Adjusting build assertions and test logic to correctly handle runtime-specific behaviors and warnings.
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
ProjectExtensions.cs | Introduces the SetRuntime extension method to configure the project based on the specified AndroidRuntime. |
PackagingTest.cs | Updates test cases to include an AndroidRuntime parameter and applies the runtime configuration. |
BuildTest.cs | Extends test methods with an AndroidRuntime parameter and adjusts build logic (e.g. warning assertions and preview feature enablement) accordingly. |
BuildTest.TestCaseSource.cs | Adds runtime parameter values to the test case sources for improved consistency. |
AssetPackTests.cs | Revises asset pack tests to accept a runtime parameter and set the runtime on the project. |
Files not reviewed (1)
- src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets: Language not supported
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good approach for now that doesn't balloon our CI times.
We are probably getting close to needing a few more Windows MSBuild Tests agents. 😉
For each "smoke test" that build an Android application project (libraries not really relevant), we run the test on all runtimes.
For each test, I generally added two more test cases for NativeAOT and CoreCLR.
This is a first step to ensure that we don't break CoreCLR or NativeAOT support at build time.
This also discovered a bug on NativeAOT, in a project with spaces:
The fix was to quote
@(LinkerArg)
: