Skip to content

fix(tests): use [SkippableFact] for gated safetensors E2E tests (#392) - #412

Open
jamesburton wants to merge 1 commit into
devfrom
issue/392-skippablefact-safetensors-e2e
Open

fix(tests): use [SkippableFact] for gated safetensors E2E tests (#392)#412
jamesburton wants to merge 1 commit into
devfrom
issue/392-skippablefact-safetensors-e2e

Conversation

@jamesburton

Copy link
Copy Markdown
Owner

Summary

Closes #392.

Three RealHfSafetensorsEndToEndTests methods were declared [Fact] instead of [SkippableFact]:

  • Mistral7B_LoadsAndForwardsEndToEnd_WhenCheckpointPresent
  • Mixtral8x7B_LoadsAndForwardsEndToEnd_WhenCheckpointPresent
  • Qwen15MoeA27B_LoadsAndForwardsEndToEnd_WhenCheckpointPresent

All three route through RunGatedSafetensorsSmoke, which throws Xunit.SkipException when the gated checkpoint is absent (DOTLLM_*_CHECKPOINT_PATH unset and no conventional C:/temp/... snapshot). Because they were plain [Fact], xunit counted that SkipException as a FAILURE, making the Integration Tests CI job red on every PR — confirmed live on PR #410 (Failed: 3, Passed: 145, Skipped: 314, Total: 462).

Changed all three to [SkippableFact], matching every other gated test in the same class (e.g. Phi35Mini_LoadsAndForwardsEndToEnd, TinyLlama_11B_LoadsAndForwardsEndToEnd), which already use the pattern correctly.

Sweep for other latent instances

Per the issue and the related #393 (a different, probe-correctness defect — not addressed here), I audited tests/DotLLM.Tests.Integration/ and tests/DotLLM.Tests.Unit/ for any other [Fact]/[Theory] method that throws SkipException (directly, or via Skip.If/Skip.IfNot) without the Skippable attribute.

Method: a script walked every .cs file under tests/, found each [Fact]/[Theory]-attributed method body (brace-matched), and flagged any body containing a Skip.If(, Skip.IfNot(, or SkipException reference.

Result: the only hit besides the three fixed above was a false positive — SilentSkipConventionTests.DetectorFlagsTheAntiPattern contains the literal strings "Skip.If(...)" inside its own test-fixture string arrays (data used to verify a different convention scanner, not an actual Skip.If call). No other [Fact]/[Theory] test in the suite throws SkipException without the Skippable attribute.

Verification

The fix is trivial to write but only provable in the absent-fixture case (locally having the checkpoints would make the tests pass rather than exercise the skip path). Ran with DOTLLM_MISTRAL_7B_CHECKPOINT_PATH / DOTLLM_MIXTRAL_8X7B_CHECKPOINT_PATH / DOTLLM_QWEN15_MOE_A27B_CHECKPOINT_PATH unset and the conventional C:/temp/... paths absent:

dotnet test tests/DotLLM.Tests.Integration/DotLLM.Tests.Integration.csproj -c Release --no-build \
  --filter "FullyQualifiedName~RealHfSafetensorsEndToEndTests"

Before (documented in the issue, PR #410): Failed: 3, Passed: 145, Skipped: 314, Total: 462 (repo-wide run).

After (this class, absent fixtures):

Total tests: 17
    Skipped: 17
 Total time: 9.36 Seconds

Exit code 0. The three target methods report [SKIP] with the expected "checkpoint not found" messages, not [FAIL].

What was verified: the absent-fixture negative control for the three named methods (and the rest of the class), full Release build of DotLLM.Tests.Integration with 0 errors, and the sweep methodology/result above.

What was not verified: a full repo-wide dotnet test run (not required to demonstrate the fix, and would take a long time in this environment) — the filtered run above isolates exactly the failure mode from the issue. CPU-only; no GPU/remote work performed.

Test plan

  • Build DotLLM.Tests.Integration in Release, 0 errors
  • Filtered run of RealHfSafetensorsEndToEndTests with all three checkpoint env vars unset and conventional paths absent: 17/17 Skipped, 0 Failed, exit 0
  • CI Integration Tests job green on this PR (pending)

🤖 Generated with Claude Code

Mistral7B_LoadsAndForwardsEndToEnd_WhenCheckpointPresent,
Mixtral8x7B_LoadsAndForwardsEndToEnd_WhenCheckpointPresent, and
Qwen15MoeA27B_LoadsAndForwardsEndToEnd_WhenCheckpointPresent were declared
[Fact] instead of [SkippableFact], so the Xunit.SkipException thrown by
RunGatedSafetensorsSmoke when the gated checkpoint is absent was counted
as a test FAILURE instead of a skip, making the Integration Tests CI job
red on every PR.

Swept tests/ for other [Fact]/[Theory] methods that throw SkipException
(via Skip.If/Skip.IfNot/SkipException) without the Skippable attribute;
no other occurrences found.
Copilot AI lite review requested due to automatic review settings August 14, 2026 22:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CI instability in the integration test suite by ensuring gated Safetensors E2E tests are treated as skipped (not failed) when required checkpoint fixtures are absent, aligning with the existing skipping pattern used throughout RealHfSafetensorsEndToEndTests.

Changes:

  • Switched three gated Safetensors E2E tests from [Fact] to [SkippableFact] so SkipException is reported as Skipped.
  • Brought Mistral7B, Mixtral8x7B, and Qwen15MoeA27B tests in line with the rest of the class’ gating conventions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants