Skip to content
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

[iOS][NativeAOT] Stand up testing on devices #19817

Open
2 of 5 tasks
ivanpovazan opened this issue Jan 11, 2024 · 2 comments
Open
2 of 5 tasks

[iOS][NativeAOT] Stand up testing on devices #19817

ivanpovazan opened this issue Jan 11, 2024 · 2 comments
Assignees
Labels
area-testing Unit tests, device tests platform/iOS 🍎 Task neither bug nor feature but something that needs to be done in support of either

Comments

@ivanpovazan
Copy link
Member

ivanpovazan commented Jan 11, 2024

Description

With #19194 we started testing NativeAOT iOS support with MAUI on CI.
However, added tests are only testing building MAUI iOS template applications.
In order to have a better test coverage we should stand up running NativeAOT iOS tests on devices as well.

Tasks

This effort should cover at least the following:

@ivanpovazan ivanpovazan added platform/iOS 🍎 area-testing Unit tests, device tests labels Jan 11, 2024
@ivanpovazan ivanpovazan added this to the .NET 9 Planning milestone Jan 11, 2024
@ivanpovazan ivanpovazan self-assigned this Jan 11, 2024
@ivanpovazan
Copy link
Member Author

/cc: @jonathanpeppers @simonrozsival
We should discuss what will fall into TBD - Additional relevant testing but feel free to extend the list as you see fit.

@ivanpovazan
Copy link
Member Author

Regarding:

Stand up running Core.DeviceTests.csproj tests with NativeAOT

In order to adapt these tests to execute with NativeAOT, we will need to adapt/change HeadlessTestRunner

class HeadlessTestRunner : iOSApplicationEntryPoint
as it inherits XHarness.TestRunners.Xunit test runner. The problem with this type of runners, is that it expects assemblies to be present on disk in order to load them and find relevant test cases. This is not supported by NativeAOT as the managed assemblies are not preserved during deployment.

  • As a short-term solution/workaround, we could potentially create a NativeAOT variant of HeadlessTestRunner which resembles single file test runner (similar we are using in dotnet/runtime)
  • As a long-term solution, we should create an AOT-compatible XUnit test runner: Add AOT-compatible XUnit runner runtime#91069

jonathanpeppers pushed a commit that referenced this issue Jan 29, 2024
This PR adds an integration test for testing NativeAOT running on iOS by
extending the existing `RunOniOS` test method with two new parameters:

* `runtimeIdentifier` - string denoting the target runtime identifier i.e., on
  which platform the test will be executed. Since currently CI only runs these
  tests on simulators (note: referring to `iossimulator-x64` in the target path
  below)
  https://github.com/dotnet/maui/blob/f9a885219953dd67171b0986f9746795fc5fc207/src/TestUtils/src/Microsoft.Maui.IntegrationTests/AppleTemplateTests.cs#L47

We are passing the same value `iossimulator-x64` in all cases for the time
being.

* `runtimeVariant` - new enum type - `RuntimeVariant` differentiating runtime
  variants to run the test with (at the moment supported variants are `Mono`
  and `NativeAOT`).

Contributes to #19817
PureWeen pushed a commit that referenced this issue Feb 8, 2024
This PR adds an integration test for testing NativeAOT running on iOS by
extending the existing `RunOniOS` test method with two new parameters:

* `runtimeIdentifier` - string denoting the target runtime identifier i.e., on
  which platform the test will be executed. Since currently CI only runs these
  tests on simulators (note: referring to `iossimulator-x64` in the target path
  below)
  https://github.com/dotnet/maui/blob/f9a885219953dd67171b0986f9746795fc5fc207/src/TestUtils/src/Microsoft.Maui.IntegrationTests/AppleTemplateTests.cs#L47

We are passing the same value `iossimulator-x64` in all cases for the time
being.

* `runtimeVariant` - new enum type - `RuntimeVariant` differentiating runtime
  variants to run the test with (at the moment supported variants are `Mono`
  and `NativeAOT`).

Contributes to #19817
@samhouts samhouts added the Task neither bug nor feature but something that needs to be done in support of either label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing Unit tests, device tests platform/iOS 🍎 Task neither bug nor feature but something that needs to be done in support of either
Projects
None yet
Development

No branches or pull requests

3 participants