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 from Java.Interop-Tests.NET.csproj
tests/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.Run result 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.Core no 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-Debug
Mono.Android.NET_Tests-Release
Mono.Android.NET_Tests-NoAab
Mono.Android.NET_Tests-Mono
Mono.Android.NET_Tests-CoreCLRTrimmable
Mono.Android.NET_Tests-NativeAOT
Xamarin.Android.JcwGen_Tests
- Local documented
dotnet-local build/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 uses NUnitTestAssemblyRunner and 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
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.csprojtests/TestRunner.Core/The current shared runner directly uses NUnit APIs for discovery, filtering, execution, result counting, and TRX generation. The migration must preserve:
Microsoft.Android.Runresult protocolRuntimeHostConfigurationOptiondotnet test, MTP, and TRX reporting behaviorThe NativeAOT configuration currently contains NUnit-specific reflection/rooting workarounds (
IlcGenerateCompleteTypeMetadataandNativeAOT.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
MSBuildDeviceIntegrationor the Android SDK/build-task unit tests.Acceptance criteria
TestRunner.Coreno longer reference or use NUnit.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_Testsdotnet-localbuild/test commands continue to work and produce TRX results.Steps to Reproduce
tests/TestRunner.Core/TestInstrumentation.cs; it usesNUnitTestAssemblyRunnerand NUnit filters/results directly.-p:TestsFlavor=NativeAOT -p:PublishAot=true; the project currently requires NUnit-specific runtime directives./cc @Evangelink