Add the xUnit extensions test harness and test assets (3/3) - #5759
Add the xUnit extensions test harness and test assets (3/3)#5759Mikael Weaver (mikaelweave) wants to merge 1 commit into
Conversation
Adds Microsoft.Health.Extensions.Xunit.UnitTests, the harness covering the xUnit extensions themselves, along with Microsoft.Health.Extensions.Xunit.TestAssets, a set of deliberately-misbehaving mini xUnit programs used as fixture data. TestAssetRunner launches one asset per scenario as a subprocess and asserts on the published TRX plus the process exit code. Restores the coupling edits the harness requires: the solution and R4/R5 solution filter entries, the unit test project manifest count (19 -> 20), and the InternalsVisibleTo entry in Microsoft.Health.Extensions.Xunit. TestAssets is intentionally excluded from the solution and solution filters: it sets IsTestProject=false before the repo props import so it is never treated as a test project or auto-discovered. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
Superseded by #5761. That PR re-does this migration from scratch against Test selection is preserved at name level - every CI leg was enumerated against a v2 control and diffed as a name multiset (missing 0 / added 0), not compared by count. Closing to keep review attention on #5761. The branch is not deleted, so this can be reopened if needed. |
Layer 3 of 3 in the stack splitting #5507 (xUnit v2 -> v3 + Microsoft Testing Platform migration). Targets
mikaelweave-xunit3-core-migration(L2, #5758), which targetsmikaelweave-xunit3-prep-collection-definitions(L1, #5756).Merge L1, then L2, then this.
What this adds
The test harness for the xUnit extensions themselves, held back from L2 so that the v3 flip could be reviewed on its own.
src/Microsoft.Health.Extensions.Xunit.UnitTests/(48 files) - the harness covering the extensions.src/Microsoft.Health.Extensions.Xunit.TestAssets/(68 files) - 34 deliberately-misbehaving mini xUnit programs used as fixture data.TestAssetRunnerlaunches one per scenario as a subprocess and asserts on the published TRX plus the process exit code.Plus the six coupling edits L2 could not carry because the harness did not exist yet: the solution project entry, its four build-configuration lines and its
NestedProjectsmapping; theR4.slnf/R5.slnfentries; the unit test project manifest going from 19 back to 20; and theInternalsVisibleToentry inMicrosoft.Health.Extensions.Xunit.Why
TestAssetsis not in the solutionDeliberate, and please keep it that way. The assets are programs that are supposed to fail. The project sets
IsTestProject=falsebefore the repo props import and is absent from the solution and both solution filters, so nothing discovers them or runs their failing tests directly. They are built solely through aReferenceOutputAssembly="false"ProjectReferencefrom the harness.Verification
git diff HEAD b7513423c5e40ab9dda4e338d66dea41a6c8cfdais empty.slnfvalid JSON, harness present,TestAssetsabsentThe solution build reports 4 errors from the repo's pre-existing
VerifyExactSdkVersiontarget (installed SDK 10.0.303 vsglobal.json10.0.302), all in E2E projects and unrelated to this change.global.jsonwas deliberately not touched. Verified around it the same way L2 did, by compiling the four E2E projects individually with-t:Compile -p:TargetFramework=net10.0: all four returned 0 errors, 0 warnings.Reviewer note
TestAssetRunneruses--filter-query, which is assembly-wide rather than namespace-scoped. Adding further concurrent query-filtered runs will destabilise sibling tests and surface as MTP exit code 8 / "zero tests ran" in tests you did not touch.