You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tests: a spike on Metalama.Testing.AspectTesting beside xunit.v3 on Microsoft Testing Platform #93
The aspects are tested through woven probes, build-outcome consumers and a generated-surface snapshot. Gaël Fraiteur of Metalama suggested Metalama.Testing.AspectTesting in the Show and tell discussion (discussion 2305, his comment). Its tests compare the transformed code with a stored expected file, so a reviewer can verify a test by reading the generated output instead of the generator. That matters when much of the code is written with AI assistance. Thank you.
One wrinkle: the package (2026.1.30, MIT) depends on the xunit v2 extensibility packages (xunit.extensibility.core 2.9.3), and this repository runs xunit.v3 4.0.2 on Microsoft Testing Platform ("test": {"runner": "Microsoft.Testing.Platform"} in global.json). I found nothing that says the package supports xunit v3 or MTP, so this is an inference from its metadata until a spike shows it.
Proposal
A spike under spikes/ that answers: can AspectTesting run in a project of its own, and does dotnet test --solution (MTP mode) still run the rest of the solution? If it cannot be in the solution, can it run as a separate command, locally and in CI?
If it works, a first set of aspect tests for a few shapes (a plain value object, a validated one, a closed set) whose expected output can also feed the generated-code blocks in the READMEs (#92).
Done when
The spike's README holds the question, the answer and the evidence, as the other spikes' do.
If the answer changes how the generators are tested, a decision record says so; if it does not work here, the issue says why and closes.
Answered by the spike in PR #105 (spikes/AspectTestingSpike):
It works against the real generators and their transitive fabric: a plain value object, a validated one, a closed set and a refusal. A defect seeded in a scratch copy of src/ failed the cases it touches.
It runs only as a separate command. It needs xunit v2 on VSTest and a global.json of its own. One VSTest project in the solution makes dotnet test --solution refuse the whole run (MTP mode), and the workaround, IsTestProject=false, runs nothing and exits 0.
The expected files are hard to review whole: 235 to 349 fully qualified lines per type.
Decision: not adopted. The way the generators are tested does not change, so there is no decision record. The spike stays as the record. Reading its output found dead code in every generated TryParse (#100). This closes when PR #105 merges into release/2.3.0.
Activity
CaffeinatedCoder commentedon Oct 28, 2026
Answered by the spike in PR #105 (
spikes/AspectTestingSpike):src/failed the cases it touches.global.jsonof its own. One VSTest project in the solution makesdotnet test --solutionrefuse the whole run (MTP mode), and the workaround,IsTestProject=false, runs nothing and exits 0.Decision: not adopted. The way the generators are tested does not change, so there is no decision record. The spike stays as the record. Reading its output found dead code in every generated
TryParse(#100). This closes when PR #105 merges into release/2.3.0.CaffeinatedCoder commentedon Oct 28, 2026
Done in PR #105, merged into release/2.3.0.