Fix test property lifecycle scope - #10080
Conversation
Keep per-test traits, categories, and TCM properties out of assembly and class lifecycle contexts while preserving downward flow from assembly and class initialization. Fixes #10041 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 872b37f5-a59d-4cde-a730-df6c766ef8a7
There was a problem hiding this comment.
Pull request overview
Separates per-test metadata from assembly/class lifecycle properties, preventing property leakage between sibling tests while preserving initializer property flow.
Changes:
- Adds distinct per-test and lifecycle property dictionaries.
- Uses lifecycle-only properties for assembly/class initialization and cleanup.
- Adds unit and acceptance regression coverage across the complete test lifecycle.
Show a summary per file
| File | Description |
|---|---|
TestExecutionManagerTests.cs |
Tests TCM property isolation across lifecycle contexts and sibling tests. |
TestContextPropertyFlowTests.cs |
Adds end-to-end property-scope coverage. |
InternalAPI.Unshipped.txt |
Tracks the new internal runner overloads. |
UnitTestRunner.TestFilter.cs |
Uses lifecycle properties during filtered-test cleanup. |
UnitTestRunner.RunSingleTest.cs |
Separates test and lifecycle property inputs. |
TestExecutionManager.Runner.cs |
Seeds and passes source-only lifecycle properties. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Medium
🧪 Test quality grade — PR #10080
This advisory comment was generated automatically. Grades are heuristic Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
See Network Configuration for more information.
|
|
/backport to rel/4.3 |
|
Started backporting to rel/4.3: https://github.com/microsoft/testfx/actions/runs/29831531182 |
|
@Evangelink backporting to rel/4.3 failed, the patch most likely resulted in conflicts: NOTE: A PR will be created, but needs to be revised manually! |
…to rel/4.3) (#10110) Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
Summary
[TestProperty], test categories, and host-provided TCM properties scoped to the individual test lifecycleAssemblyInitializeandClassInitializeValidation
MSTestAdapter.PlatformServices.UnitTests: 925 passedTestContextPropertyFlowTests: 6 passed across net462, net8.0, and net10.0Fixes #10041