Repository navigation
Description
Android framework version
net11.0-android (Preview)
Affected platform version
.NET 11 / MSTest 4.4.0
Description
MSTest 4.4.0 supports NativeAOT: https://www.nuget.org/packages/MSTest/4.4.0
Migrate all on-device APK tests from NUnit to MSTest. This scope includes:
tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj, including tests loaded fromJava.Interop-Tests.NET.csprojtests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj- The shared Android instrumentation runner in
tests/TestRunner.Core/ - Related CI configuration, test documentation, and package/version configuration
The current shared runner directly uses NUnit APIs for discovery, filtering, execution, result counting, and TRX generation. The migration must preserve:
- Android instrumentation startup and the
Microsoft.Android.Runresult protocol - Multiple test assembly support
- Include/exclude category behavior from instrumentation arguments and
RuntimeHostConfigurationOption - Runtime-specific exclusions for Mono, CoreCLR, trimmable type maps, LLVM, and NativeAOT
- Fully-qualified test-name exclusions for external test assemblies
- Execution on the instrumentation/JNI-attached thread where required
dotnet test, MTP, and TRX reporting behavior
The NativeAOT configuration currently contains NUnit-specific reflection/rooting workarounds (IlcGenerateCompleteTypeMetadata and NativeAOT.rd.xml, including roots for NUnit async adapters). Remove any workarounds that become unnecessary after the migration.
This issue does not include host-side NUnit test projects such as MSBuildDeviceIntegration or the Android SDK/build-task unit tests.
Acceptance criteria
- The two on-device APK test applications and
TestRunner.Coreno longer reference or use NUnit. - Existing on-device tests are migrated to MSTest without losing coverage; any intentional semantic differences are documented.
- Existing include/exclude filters and runtime-specific skip behavior continue to work.
- The following CI lanes continue to build, install, run, and publish results:
Mono.Android.NET_Tests-DebugMono.Android.NET_Tests-ReleaseMono.Android.NET_Tests-NoAabMono.Android.NET_Tests-MonoMono.Android.NET_Tests-CoreCLRTrimmableMono.Android.NET_Tests-NativeAOTXamarin.Android.JcwGen_Tests
- Local documented
dotnet-localbuild/test commands continue to work and produce TRX results. - NUnit-specific NativeAOT metadata/rooting workarounds are removed when they are no longer required.
Steps to Reproduce
- Inspect
tests/TestRunner.Core/TestInstrumentation.cs; it usesNUnitTestAssemblyRunnerand NUnit filters/results directly. - Inspect the two APK test projects; both reference NUnit and use NUnit test attributes/assertions.
- Build the NativeAOT lane with
-p:TestsFlavor=NativeAOT -p:PublishAot=true; the project currently requires NUnit-specific runtime directives.
/cc @Evangelink
Activity
[ci] Remove redundant CoreCLRTrimmable test lane (#13011)