Skip to content

test(visual): fail loud on cold-start across Pdf*Tests (#957 residu ii) - #966

Merged
jsboige merged 1 commit into
masterfrom
fix/visual-fail-loud-957-residu-ii
Jul 30, 2026
Merged

test(visual): fail loud on cold-start across Pdf*Tests (#957 residu ii)#966
jsboige merged 1 commit into
masterfrom
fix/visual-fail-loud-957-residu-ii

Conversation

@jsboige

@jsboige jsboige commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What

Closes the remainder of the faux-vert class that #963 (f7875f68) opened for one harness. ai-01's body in #963 notes that EnsureTarget() in PdfDimensionTests / PdfSnapshotTests / PdfContentTests (~20 tests) carries the identical cold-start pattern and calls for the same correctif. This PR de-gates it.

The pattern: every test began if (!EnsureTarget()) return; where EnsureTarget() returned false on a missing Target/ with only an _output.WriteLine("Skipped…"). A missing Target/ → the test returned green without asserting anything. Pass-on-nothing.

The fix — a subtraction, not a counterweight

Identical to #963:

  • private bool EnsureTarget()private void EnsureTarget(); the silent return false body becomes Assert.Fail("…require a generated Target/ — run the pipeline first. This test verified nothing.").
  • Every if (!EnsureTarget()) return; call site → EnsureTarget();.
  • Secondary guards that also verified nothing get the same treatment — a partial Target/ (one language missing, a CardSet absent, the expected file not there) was passing silently too:
    • if (pdfs.Count == 0) return;Assert.Fail
    • if (!Directory.Exists(dir)) return;Assert.Fail
    • if (pdfs.Length == 0) return;Assert.Fail
    • if (pdf == null) return;Assert.Fail
    • if (sizes.Count < 2) return;Assert.Fail
    • if (!File.Exists(pdfPath)) { WriteLine; return; }Assert.Fail (PdfSnapshotTests)

No [Fact(Skip)] (static in xUnit 2.9.3 v2 — would kill the tests where they actually work). No continue-on-error. No fabricated coverage. Each Assert.Fail message names what was missing and ends "test verified nothing" so the intent is unmistakable in the runner output.

CI scope — verified (the DoD ask)

"Vérifie dans quel(s) leg(s) de CI ces tests tournent réellement avant de conclure sur l'impact."

  • Argumentum.AssetConverter.VisualTests.csproj is in Argumentum Converters.sln → it is compiled by dotnet build (and by CI's build step).
  • .github/workflows/build.yml Test step runs dotnet test "Generation/Converters/Argumentum.AssetConverter.Tests/Argumentum.AssetConverter.Tests.csproj" — targets only Tests.csproj, not VisualTests.

Impact: these Assert.Fails fire locally (developer / po-2023 running the pipeline then the visual suite), not in the release gate. CI stays green regardless. This matches #963's finding.

Files

File Tests Sites converted
PdfDimensionTests.cs 11 EnsureTarget method + 11 call sites + 7 secondary guards
PdfSnapshotTests.cs 3 EnsureTarget method + 3 call sites + 3 File.Exists guards
PdfContentTests.cs 6 EnsureTarget method + 6 call sites + 10 secondary guards

~20 tests total. Test code only.

Build / test

Build (compile proof):

dotnet build Argumentum.AssetConverter.VisualTests.csproj
→ La génération a réussi. 0 Avertissement(s) 0 Erreur(s)

Behaviour proof (one filtered test, --no-build): this machine's Target/ exists but has no generated PDFs (no Documents/density-0/) — the exact cold-start/partial state the fix targets.

dotnet test ...VisualTests.csproj --no-build --filter "FullyQualifiedName~A0_Pdf_Has_Correct_Dimensions"
→ Échoué! - échec: 4, réussite: 0, ignorée(s): 0, total: 4, durée: 13 ms
  Message: No A0 PDFs for fr in Target/ — test verified nothing (check pipeline output).
  at PdfDimensionTests.A0_Pdf_Has_Correct_Dimensions(...) line 77   ← the guard this PR added

These 4 failures ARE the fix working, not a regression. Before this PR, the same 4 variants passed green and silent (Target/ present → EnsureTarget() returned true → if (pdfs.Count == 0) return; skipped quietly). After, they fail loud at the exact line added here (line 77) with a message ending "test verified nothing". The EnsureTarget() Assert path itself is the identical pattern already shipped in #963 (f7875f68, merged & working); on this machine TargetRoot exists so that branch isn't reached — the secondary guards are, and they fire correctly.

A fully-green dotnet test over the whole VisualTests suite is assertable only by a machine that has run the generation pipeline (a populated Target/{lang}/Documents/density-0/ with PDFs) — a heavy lane run, out of scope for this test-code-only PR.

Scope

Test code only (~+30/−10, 3 files). 0 prod write, 0 CSV, 0 OWL, 0 CardPen. Base: ff80107b (ai-01 dispatch).

DoD (mirror #963)

  • Mute return; removed, replaced by explicit Assert.Fail("…") — all 3 files
  • A subtraction, not a counterweight — no [Fact(Skip)], no continue-on-error, no fabricated coverage
  • CI legs verified — VisualTests compiled but NOT run by build.yml's Test step → fails locally, not in the release gate

🤖 po-2024

#963 (f7875f6) closed the cold-start faux-vert for VisualQaHarness. The same
EnsureTarget() pattern carried across ~20 tests in PdfDimensionTests,
PdfSnapshotTests, and PdfContentTests — each one a pass-on-nothing: a missing
Target/ made the test green without asserting anything.

Same correctif as #963: the silent `return;` removed, replaced by an explicit
Assert.Fail("..."). A subtraction, not a counterweight — no [Fact(Skip)]
(static in xUnit, would kill the tests where they work), no continue-on-error,
no fabricated coverage. Secondary guards that verified nothing (missing lang
dir, 0 PDFs, pdf==null, sizes.Count<2, missing expected file) get the same
treatment, so a *partial* Target/ (some languages missing, a CardSet absent)
can't pass silently either — those were the subtler faux-verts.

CI scope verified: VisualTests.csproj is in the .sln (compiled by `dotnet
build`), but build.yml's Test step targets ONLY Argumentum.AssetConverter.Tests
.csproj, so these tests do NOT run in CI. Assert.Fail therefore fails locally
(run the pipeline first), not in the release gate.

Scope: test code only (~+30/-10 across 3 files). 0 prod write, 0 CSV, 0 OWL.
Build: 0 Avertissement(s) 0 Erreur(s) on VisualTests.csproj.

Co-Authored-By: Claude-Code <noreply@anthropic.com>
@jsboige
jsboige merged commit f6e15d7 into master Jul 30, 2026
3 checks passed
@jsboige
jsboige deleted the fix/visual-fail-loud-957-residu-ii branch July 30, 2026 03:15
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