-
-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Description
Version Information
- TUnit: Issue observed in
0.50.x
(e.g., 0.50.0, 0.50.1) - Working as expected:
0.25.21
- OS: macOS 15.5 (arm64)
- .NET: 9.0
- IDE: Rider
Summary
In 0.25.21:
IFirstTestInAssemblyEventReceiver
was called exactly once per assembly.IFirstTestInClassEventReceiver
was called exactly once per class.
In 0.50.x:
- The same code results in multiple calls for the same assembly/class.
- The call order can be interleaved with tests or occur after some tests have already run.
A gif comparing execution between 0.25.21 and 0.50.x will be attached.
Expected Behavior
- Assembly scope:
IFirstTestInAssemblyEventReceiver
should be called exactly once per assembly before any test in that assembly starts. - Class scope:
IFirstTestInClassEventReceiver
should be called exactly once per class before any test in that class starts.
Actual Behavior (0.50.x)
- Multiple calls occur for the same assembly/class.
- Calls sometimes happen after tests in the same scope have started.
- The order between assembly-level and class-level first events is inconsistent.
Steps to Reproduce
- Run with TUnit
0.25.21
→ each event is called once and always before tests start. - Upgrade to TUnit
0.50.x
→ events are called multiple times or interleaved with test output.
Requests
- Restore the exactly-once-per-scope guarantee in 0.50.x, or document conditions under which this guarantee does not hold.
- Document execution order guarantees:
- Assembly First → Class First → tests in that class.
- Update documentation:
- The current page lists the following interfaces, but does not describe
IFirstTestInClassEventReceiver
orIFirstTestInAssemblyEventReceiver
:ITestRegisteredEventReceiver ITestStartEventReceiver ITestEndEventReceiver ILastTestInClassEventReceiver ILastTestInAssemblyEventReceiver ILastTestInTestSessionEventReceiver
- The current page lists the following interfaces, but does not describe
Copilot
Metadata
Metadata
Assignees
Labels
No labels