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

Native AOT Testing Improvements #79316

Closed
4 of 7 tasks
Tracked by #69739
agocke opened this issue Dec 7, 2022 · 5 comments
Closed
4 of 7 tasks
Tracked by #69739

Native AOT Testing Improvements #79316

agocke opened this issue Dec 7, 2022 · 5 comments
Labels
area-NativeAOT-coreclr User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@agocke
Copy link
Member

agocke commented Dec 7, 2022

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Dec 7, 2022
@agocke agocke added area-NativeAOT-coreclr and removed untriaged New issue has not been triaged by the area owner labels Dec 7, 2022
@ghost
Copy link

ghost commented Dec 7, 2022

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details
Author: agocke
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@agocke agocke added the User Story A single user-facing feature. Can be grouped under an epic. label Dec 7, 2022
@agocke agocke added this to the 8.0.0 milestone Dec 7, 2022
@agocke agocke mentioned this issue Dec 7, 2022
6 tasks
@kant2002
Copy link
Contributor

I would like to ask opinions here first. Currently other teams like EF Core and ASP.NET seems to be plan to work on NativeAOT. From what I know they are using xUnit. Both does not have infra for NativeAOT yet.

I would like to ask what's status of testing of NativeAOT using xUnit, for example. If I want contribute to EF Core + NativeAOT for example, I obviously may try to create sample apps and work, but that seems to be inefficient.

It would be good to start discussing on guidance for developers who would like to tests their libraries.

@MichalStrehovsky
Copy link
Member

In general, the experience we're shooting for with trimming and AOT is that of compile time warnings. If there are no warnings, the code should work and there's no need to do separate functional testing with trimming or AOT. The behaviors should be identical, modulo bugs in the runtime/compiler. It's the same for e.g. PublishReadyToRun. One doesn't specifically run unit tests with PublishReadyToRun either.

This only breaks down if one has a trimming/AOT incompatible dependency that the analyzer doesn't see. One could say that the testing would make sense to cover those. But the act of placing the code into a unit test makes trimming/AOT work differently (because the surrounding code is different). It may well be that the code will work in a test, but fail in the app, or vice versa. Using unit testing as a way to verify trimming/AOT compatibility doesn't work.

That said, we have #78342 tracking a trimming/AOT friendly xUnit runner for the purposes of the runtime repo. The runtime repo does run unit tests with NativeAOT, but the purpose is to catch actual NativeAOT runtime or compiler bugs. We're already using xUnit with its reflection based runner to run 200+ libraries test assemblies in this repo. But the experience is subpar and we have many rd.xml files to make things work in the runner.

@agocke agocke changed the title Native AOT Testing in .NET 8 Native AOT Testing Improvements Aug 10, 2023
@agocke agocke modified the milestones: 8.0.0, 9.0.0 Sep 5, 2023
@agocke
Copy link
Member Author

agocke commented Jan 24, 2024

Closing this out as done for 8.0. Further testing improvements will be brought through in 9.0

@agocke agocke closed this as completed Jan 24, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr User Story A single user-facing feature. Can be grouped under an epic.
Projects
Archived in project
Development

No branches or pull requests

3 participants