Skip to content

Spec 015: C# Skip & Disabled-Test Extraction - #193

Merged
adrian-xping merged 15 commits into
mainfrom
feat/spec-015-csharp-skip-extraction
Dec 4, 2026
Merged

adrian-xping merged 15 commits into
mainfrom
feat/spec-015-csharp-skip-extraction

Conversation

@adrian-xping

@adrian-xping adrian-xping commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Spec 015 (docs/specs/core/015-csharp-skip-extraction.md): C# Skip & Disabled-Test Extraction. Built by spec-runner; a human merges this PR.

Phase PRs

Acceptance (criteria from docs/specs/work-breakdown.md)

# Criterion Result Evidence
AC-1 Fixture per pattern; skip reason captured verbatim (feeds the "flaky" claim check in XP003). met samples/skips/ has one folder per §13 pattern group (xunit, nunit, mstest, case-skips, reach, precedence, not-skips, commented-out, preprocessor, attribute-removed), each with old.cs, new.cs and expected.json. tests/Xping.Analyzers.CSharp.Tests/Skips/SkipFixtureTests.cs EverySkipFixtureMatchesItsExpectedFile compares the extraction with each expected.json by DeepEquals, so it fails if a pattern stops being read. Reasons are verbatim in expected.json (e.g. 'flaky on CI', 'flaky' in xunit/expected.json, 'the reduced rate is not live yet'). TheProblem2SkipKeepsItsFlakyReason asserts the problem2-hollowed Fact(Skip = "flaky") gives reason 'flaky', the input to the XP003 flaky claim. EverySkipFolderTheSpecListsExists keeps the folders in step with §13. I read the tests and fixtures; I did not run them.
AC-2 A test checks that every table row is used by a fixture. met SkipFixtureTests.EverySkipRowIsUsedByAFixture runs SkipHarness.Extract over every .cs file under samples/skips, unions ExtractedSkip.UsedRows (SkipExtractor.cs:561), and fails with the unused row IDs if any row in SkipPatterns.Default.Rows is missing. It would fail if a skips.json row had no fixture. I did not run it.
AC-3 The analyzer reproduces the skips and disabled tests of every C# samples/facts/ fixture. met tests/Xping.Analyzers.CSharp.Tests/FactsFixtureTests.cs: TheAnalyzerReproducesTheSkipAndDisabledPartOfEveryFactsFixture is a theory over every samples/facts folder that has a facts.json. For each csharp file it runs CSharpTestAnalyzer on old.cs and new.cs as a pair with a status, so attributeRemoved reads the old side. It compares each live test's skip and every field of each disabled test (SkipPart, Disabled: true), and fails on any difference. The catalog fixture was extended with an NUnit TestCase Ignore case skip (samples/facts/catalog/SkipTests/new.cs and facts.json) so the case skip is covered. I did not run it.

Follow-ups created

None.

adrian-xping and others added 15 commits December 4, 2026 01:56
Spec-Runner: spec=015 step=claim
…e 1)

Add Skips/skips.json with its loader and validator, and SkipExtractor: test and data
attributes, class attributes, named arguments and modifiers, runtime skip calls and
throws in the body, verbatim reasons, reach (conditional, swallowed) and precedence.
Add SkipFact.Cases, a case skip to the facts catalog, and the samples/skips fixtures.
Move Spec 014's name lookup into Timeouts/NameLookup so both folders share it.

Spec-Runner: spec=015 phase=1 step=implement
…r table shape rules (spec 015 phase 1)

Spec-Runner: spec=015 phase=1 step=fix-1
…raction/1-skips

feat(analyzers): read C# skips from a reviewable table (spec 015 phase 1)
… attribute removed (spec 015 phase 2)

Comment runs between members are uncommented and parsed one member at a time; outermost
constant-false #if branches are parsed as class members; a method that lost its test
attribute (or an MSTest class that lost [TestClass]) is attributeRemoved against the old side.
Disabled tests carry name, fingerprint, span, disabled, suppressions and body only, and a
disabled copy next to a live test of the same name is dropped. The attached-block walk stops
at members kept from comment runs, in the facts and the identity scan alike.

Spec-Runner: spec=015 phase=2 step=implement
…drop fingerprint diagnostics of disabled tests (spec 015 phase 2)

Spec-Runner: spec=015 phase=2 step=fix-1
…rective is live (spec 015 phase 2)

Spec-Runner: spec=015 phase=2 step=fix-2
…entity scan

The attached-block walk passes over /// lines, so the scan must parse a
commented member that ends above them, as the facts do; otherwise the
live test took the commented test's fingerprint in the scan only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he identity scan

The attached-block walk crosses any mix of // and /// lines, so a run
ending anywhere in that block must be parsed in the scan, as in the
facts; a marker between a doc comment and the test hid the commented
test above them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…raction/2-disabled

feat(analyzers): read disabled C# tests: commented out, compiled out, attribute removed (spec 015 phase 2)
SkipExtractor now takes the test's ExtractedAssertions and reads the bodies of the
helpers Spec 013 followed, once per call site. Reasons fold helper parameters in the
caller's scope; skipWhen literals are read after substitution; reach is read inside
the helper and at the call site (a swallowing catch at either means no skip). A
helper's skip keeps its span in the helper and sorts at its call site.

Spec-Runner: spec=015 phase=3 step=implement
…pec 015 phase 3)

Spec-Runner: spec=015 phase=3 step=fix-1
… body as no skip (spec 015 phase 3)

Spec-Runner: spec=015 phase=3 step=fix-2
…raction/3-helpers

feat(analyzers): read skips in same-file helpers (spec 015 phase 3)
Spec-Runner: spec=015 step=done
@adrian-xping
adrian-xping marked this pull request as ready for review December 4, 2026 03:20
@adrian-xping
adrian-xping merged commit ba356aa into main Dec 4, 2026
5 checks passed
@adrian-xping
adrian-xping deleted the feat/spec-015-csharp-skip-extraction branch December 4, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant