Repository navigation
Description
Summary
Building the unit test project emits nullable-reference and assertion-style warnings from its test sources. These diagnostics obscure new warnings during validation. The test project should build without these warnings.
Reproduction
On main at d87516c, run:
dotnet test --project tests/TUnit.UnitTests --framework net10.0 --treenode-filter '/*/*/ParallelMapTests/*'
The original report used ClassRowCleanupTests on #7417 at 02d1090. That class is not on this main revision; ParallelMapTests is present and building it compiles the unit-test project sources. #7417 is context, not a prerequisite.
Expected and actual
Expected: no nullable-reference or assertion-style warnings in unit-test source files.
Actual: CS8602 in ParallelMapTests.cs:105; CS8619 in PlaywrightVideoTests.cs:81,91 and PlaywrightTraceContextTests.cs:169; CS8604 in PropertyDataSourceInjectionTests.cs:161; TUnitAssertions0005 in EmptyDataSourceTests.cs, DependencyResolutionFailureTests.cs and LogSinkRouterTests.cs; TUnitAssertions0014/0015 in GenericTestGenerationTests.cs and EngineCancellationTokenTests.cs.
The relevant nullable code in ParallelMapTests and PlaywrightVideoTests is also present on main at d87516c. Analyzer and migration-project warnings are separately tracked in #7410; source-generator snapshot test warnings are #7428.
Acceptance criteria
- Remove the reported CS8602, CS8619, CS8604, TUnitAssertions0005, TUnitAssertions0014 and TUnitAssertions0015 diagnostics from
tests/TUnit.UnitTestswithout suppressing them. - Preserve the affected tests' assertions and behavior, including intentional failure fixtures.
- Build the unit-test project and run the affected test classes with targeted filters; confirm these diagnostics are absent. Warnings in other projects remain tracked separately in Analyzer and code-fixer projects emit release-tracking and nullable build warnings #7410 and Core generator snapshot tests emit nullable and constant-assertion warnings #7428.
Environment
.NET SDK 10.0.403, macOS arm64. Observed while validating #7417; the changed cleanup tests introduce none of these warnings.
Please correct these unit-test diagnostics while preserving the tests' behavior.
Activity
thomhurst commentedon Nov 3, 2026
Triaged against origin/main at d87516c. The reported nullable and assertion patterns remain in the source; no closing PR or native dependencies were found. Updated the reproduction to use ParallelMapTests, which exists on main, and added acceptance criteria. The original ClassRowCleanupTests filter belongs to #7417; that PR is not a prerequisite. No build or tests were run during this source-only triage.
Remove unit-test nullable and assertion diagnostics (#7438) (#7670)