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

Runtime should have a source-generated, trim/AOT-compatible XUnit runner #78342

Open
4 tasks
agocke opened this issue Nov 14, 2022 · 2 comments
Open
4 tasks

Comments

@agocke
Copy link
Member

agocke commented Nov 14, 2022

By XUnit runner, I mean that there should be a library which allows a set of user-authored XUnit tests to be run that's substantially identical to the existing XUnit console runners.

Ideally, running an existing assembly of XUnit unit tests via the generated runner should have the same results as running it under the existing XUnit console runner.

Restrictions are:

  • Tests must be runnable as a self-contained executable, to support the AOT form-factor
  • Test runner code must be trimmable
  • Runner must not depend on any non-trimmable, non-AOT compatible libraries

The desired end state is that the runtime repo can rely on exactly one runner test base for all its unit testing in CI.

Non-goals:

  • New runner supports end-user scenarios like dotnet test or VS test. If the semantics of the runner are the same, existing runner technologies can be used for these scenarios.

I believe the existing XUnitWrapper project is a good starting point for this work, but it currently doesn't support conventional XUnit testing. We will need to add those capabilities.

@ghost
Copy link

ghost commented Nov 14, 2022

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

By XUnit runner, I mean that there should be a library which allows a set of user-authored XUnit tests to be run that's substantially identical to the existing XUnit console runners.

Ideally, running an existing assembly of XUnit unit tests via the generated runner should have the same results as running it under the existing XUnit console runner.

Restrictions are:

  • Tests must be runnable as a self-contained executable, to support the AOT form-factor
  • Test runner code must be trimmable
  • Runner must not depend on any non-trimmable, non-AOT compatible libraries

The desired end state is that the runtime repo can rely on exactly one runner test base for all its unit testing in CI.

Non-goals:

  • New runner supports end-user scenarios like dotnet test or VS test. If the semantics of the runner are the same, existing runner technologies can be used for these scenarios.

I believe the existing XUnitWrapper project is a good starting point for this work, but it currently doesn't support conventional XUnit testing. We will need to add those capabilities.

Author: agocke
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: 8.0.0

@jkoritzinsky
Copy link
Member

jkoritzinsky commented Nov 14, 2022

Here's a non-exhaustive list of features we are missing today in the XUnitWrapperGenerator's XUnit support that dotnet/runtime or other projects in the .NET product like ASP.NET Core use:

  • IClassFixture<T>
  • test methods that are instance methods but whose containing type is not IDisposable.
  • ITestOutputHelper
  • custom fact attributes
  • generic "trait" support (the trait attributes that are supported today are hard-coded)
  • parallel execution of tests
  • async tests (Task/ValueTask)

@agocke agocke modified the milestones: 8.0.0, 9.0.0 Sep 5, 2023
@agocke agocke modified the milestones: 9.0.0, Future Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants