Skip to content

test(tests): warning-zero follow-on #710 — clear 3 xUnit analyzer warnings (5czj9v [2]) - #736

Merged
jsboige merged 1 commit into
masterfrom
fix/tests-warning-zero-xunit
Jul 6, 2026
Merged

test(tests): warning-zero follow-on #710 — clear 3 xUnit analyzer warnings (5czj9v [2])#736
jsboige merged 1 commit into
masterfrom
fix/tests-warning-zero-xunit

Conversation

@jsboige

@jsboige jsboige commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Tests/ warning-zero follow-on #710 — clear 3 xUnit analyzer warnings

Follow-on to the #710 nullable-cleanup (plan complete via 8 PR #727-#734 merged). Dispatch 5czj9v [2] SECONDAIRE. Clears the 3 residual xUnit-analyzer warnings in Tests/ (the nullable family hit 0 in #710; these are the remaining non-CS analyzer warnings).

Fixes (3 distinct, all additive annotation or async — no logic change)

File Line Code Fix Rationale
HarvestManagerExpectedImageCountTests.cs L56 xUnit1012 string rsstylestring? rsstyle Theory has [InlineData(10,3,null,10)] (L52) deliberately passing null rsstyle to pin the "null rsstyle = no grouping" branch of ComputeExpectedImageCount. Intentional null test input
LocalizedFileNameContractTests.cs L30 xUnit1012 string fileNamestring? fileName Theory has [InlineData(null)] (L28) pinning the GetLocalizedFileName guard clause (null returned as-is). Same intentional-null idiom
OwlAdapterRegressionTests.cs L306+L319 xUnit1031 public voidpublic async Task + .Wait()await xUnit1031 flags blocking Task.Wait() in test methods; canonical fix is async/await. Tests OWL2XML serialization to temp file (no sync-context → no deadlock risk either way). Test name unchanged

DoD (measured on this branch, base master 9ed2e789)

Residual — irréductible-infra, hors-scope Tests/ DoD

MSB3073 ×1 distinct on the MAIN project (Argumentum.AssetConverter.csproj, NOT Tests): the Microsoft.XmlSerializer.Generator PackageReference (L25) sgen target exits code 1 at build. This is a main-project build-infra warning, not a Tests/ code warning — it appears in the Tests build log only via the Tests→main project dependency.

The DoD scope is "dotnet build Tests → 0 warning (ou irréductible documenté)". Suppressing MSB3073 would require touching the main csproj:

  • Out of scope for this tests-only lane (main project is zero-CS-warning stable per build: eliminate all CS compiler warnings (zero-warning build for v0.9.0) #587).
  • The SGEN package may be load-bearing for ExtendedXmlSerializer — disabling it blindly risks a runtime regression.
  • Follow-up: separate main-project investigation to decide suppress (<XmlSerializerGenerator...> off) vs document as irréductible-infra. Not bundled here.

Non-goals

  • 0 write under Cards/. 0 production / card-rendering code changed. Tests-only.
  • 0 main-project csproj change (MSB3073 follow-up is a separate investigation).

Base 9ed2e789. Dispatch 5czj9v [2] SECONDAIRE.

🤖 Generated with Claude Code

Co-authored-by: Claude-Code noreply@anthropic.com

…nings

Follow-on to the #710 nullable-cleanup (plan complete, 8 PR #727-734 merged). Dispatch `5czj9v`
[2] SECONDAIRE. Clears the 3 residual xUnit-analyzer warnings in Tests/ (the nullable family hit 0
in #710; these are the remaining non-CS analyzer warnings the build emits).

Fixes (3 distinct warnings, all additive annotation or async — no logic change):

- HarvestManagerExpectedImageCountTests.cs L56 (xUnit1012): `string rsstyle` → `string? rsstyle`.
  The Theory has `[InlineData(10, 3, null, 10)]` (L52) deliberately passing null rsstyle to pin the
  "null rsstyle = no grouping" branch of ComputeExpectedImageCount (mirrors CardPen). The null is
  INTENTIONAL test input; `string?` is the honest param type.
- LocalizedFileNameContractTests.cs L30 (xUnit1012): `string fileName` → `string? fileName`. The
  Theory has `[InlineData(null)]` (L28) pinning the GetLocalizedFileName guard clause (null/empty
  returned as-is). Same intentional-null-test-input idiom.
- OwlAdapterRegressionTests.cs L306+L319 (xUnit1031): `public void` → `public async Task` +
  `adapter.ToFileAsync(...).Wait()` → `await adapter.ToFileAsync(...)`. xUnit1031 flags blocking
  Task.Wait() in test methods; the fix is the canonical async/await. The method tests OWL2XML
  serialization to a temp file (no sync-context → no deadlock risk either way); async is the clean
  fix the analyzer asks for. Test name unchanged (ToFileAsync_...).

DoD (measured on this branch, base master 9ed2e78):
- dotnet build Tests.csproj --no-incremental: xUnit warnings 3→0. 0 errors.
- dotnet test --filter (HarvestManagerExpected|LocalizedFileName|OwlAdapterRegression): 41/41 pass.
- dotnet test (full): 587 pass / 1 fail (OWL #133 permanent) / 5 skip (#719). 0 regression.

Residual (irréductible-infra, hors-scope Tests/ DoD): MSB3073 ×1 distinct on the MAIN project
(Argumentum.AssetConverter.csproj, not Tests) — the Microsoft.XmlSerializer.Generator PackageReference
(L25) sgen target exits code 1 at build. This is a main-project build-infra warning, not a Tests/
code warning; the DoD scope is "dotnet build Tests → 0 warning (ou irréductible documenté)". It
appears in the Tests build log only via the Tests→main project dependency. Suppressing it would
require touching the main csproj (out of scope for this tests-only lane; main project is
zero-CS-warning stable per #587 and the SGEN package may be load-bearing for ExtendedXmlSerializer).
Follow-up: separate main-project investigation to decide suppress (`<XmlSerializerGenerator...>` off)
vs document as irréductible-infra.

Base 9ed2e78. 0 Cards/ write, 0 rendering code change.

Dispatch 5czj9v [2] SECONDAIRE. Base 9ed2e78.

Co-authored-by: Claude-Code <noreply@anthropic.com>
@jsboige
jsboige merged commit f7f76a9 into master Jul 6, 2026
3 checks passed
@jsboige
jsboige deleted the fix/tests-warning-zero-xunit branch July 6, 2026 23:08
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