tests: report and count missing sample skips separately #140

Closed
github-bot wants to merge 1 commit from gh-pr/140/head into gh-pr/140/base
Owner

@⁠Nik3310 on GitHub · 2026-11-23 14:58 UTC · original
Nik3310:fix/report-sample-skips → main · +128 −9 · 13 files · 1 commits · closed without merging

A no-sample test run reports green even though 28 tests return early for missing external data, including silent returns in console_dlls_e2e, console_shaders and xg_oracle. Make those skips visible and count them separately from GPU capability skips.

  • Add runner::skip_sample, which writes SKIPPED_SAMPLE <test>: <variable> not set directly to stderr so it survives libtest capture. It does not apply XCL_REQUIRE_GPU: requiring a GPU must not require game files.
  • Emit the marker at the active sample gates. Cached None results in the console DLL/XG helpers report on each caller, not just the first test to initialize the cache. Existing captured messages are retained.
  • Count sample markers separately in scripts/test.ps1, grouped by missing variable, and state that they remain included in libtest passed totals. Update the README.

Validation

On unmodified upstream base 484dd5799077a5297e58027f4a67a2c5e1c6b14b plus this patch, Windows 11 Pro 26200 / RTX 4060 driver 617.42 / Rust 1.93.1 MSVC / SDK DXC 1.8.2502.11:

  • Full scripts/test.ps1 run (debug, default capture, four test threads): 561 passed, 0 failed, 40 ignored, exit 0. The ignored count includes one new deliberately ignored subprocess fixture. All XCL_SAMPLE_* variables unset; no retail files used.
  • 28 distinct sample markers were captured: DLLS 12, RPF 8, DXC 3, XG 3, AWC 1, TTPF 1. Separately, 2 GPU skips for native wave64.
  • sample_skips integration test checks that the marker is visible without --nocapture and still succeeds with XCL_REQUIRE_GPU=wave64,mesh.
  • scripts/test-reporting.tests.ps1 passes all four scenarios on PowerShell 7.6.9 and Windows PowerShell 5.1: separate counts, preserved test-failure exit code, early stop on build failure, and no summary when there are no markers. It uses fake Cargo output and needs no GPU or build.
  • git diff --check passes.

The real runner ends with:

GPU tests skipped on this adapter: 2 (no wave64)
Tests skipped for missing samples (included in libtest passed): 28: 12 (XCL_SAMPLE_DLLS not set), 8 (XCL_SAMPLE_RPF not set), 3 (XCL_SAMPLE_DXC not set), 3 (XCL_SAMPLE_XG not set), 1 (XCL_SAMPLE_AWC not set), 1 (XCL_SAMPLE_TTPF not set)

Related to #42. This reports missing samples; the separate configured-path read-error fix is #137. The two branches merge cleanly with git merge-tree. AI-assisted implementation and validation.

**@⁠Nik3310** on GitHub · 2026-11-23 14:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/140) `Nik3310:fix/report-sample-skips` → `main` · +128 −9 · 13 files · 1 commits · closed without merging A no-sample test run reports green even though 28 tests return early for missing external data, including silent returns in `console_dlls_e2e`, `console_shaders` and `xg_oracle`. Make those skips visible and count them separately from GPU capability skips. - Add `runner::skip_sample`, which writes `SKIPPED_SAMPLE <test>: <variable> not set` directly to stderr so it survives libtest capture. It does not apply `XCL_REQUIRE_GPU`: requiring a GPU must not require game files. - Emit the marker at the active sample gates. Cached `None` results in the console DLL/XG helpers report on each caller, not just the first test to initialize the cache. Existing captured messages are retained. - Count sample markers separately in `scripts/test.ps1`, grouped by missing variable, and state that they remain included in libtest passed totals. Update the README. ### Validation On unmodified upstream base `484dd5799077a5297e58027f4a67a2c5e1c6b14b` plus this patch, Windows 11 Pro 26200 / RTX 4060 driver 617.42 / Rust 1.93.1 MSVC / SDK DXC 1.8.2502.11: - Full `scripts/test.ps1` run (debug, default capture, four test threads): **561 passed, 0 failed, 40 ignored**, exit 0. The ignored count includes one new deliberately ignored subprocess fixture. All `XCL_SAMPLE_*` variables unset; no retail files used. - 28 distinct sample markers were captured: DLLS 12, RPF 8, DXC 3, XG 3, AWC 1, TTPF 1. Separately, 2 GPU skips for native wave64. - `sample_skips` integration test checks that the marker is visible without `--nocapture` and still succeeds with `XCL_REQUIRE_GPU=wave64,mesh`. - `scripts/test-reporting.tests.ps1` passes all four scenarios on PowerShell 7.6.9 and Windows PowerShell 5.1: separate counts, preserved test-failure exit code, early stop on build failure, and no summary when there are no markers. It uses fake Cargo output and needs no GPU or build. - `git diff --check` passes. The real runner ends with: ```text GPU tests skipped on this adapter: 2 (no wave64) Tests skipped for missing samples (included in libtest passed): 28: 12 (XCL_SAMPLE_DLLS not set), 8 (XCL_SAMPLE_RPF not set), 3 (XCL_SAMPLE_DXC not set), 3 (XCL_SAMPLE_XG not set), 1 (XCL_SAMPLE_AWC not set), 1 (XCL_SAMPLE_TTPF not set) ``` Related to #42. This reports missing samples; the separate configured-path read-error fix is #137. The two branches merge cleanly with `git merge-tree`. AI-assisted implementation and validation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:12:11 +00:00
github-bot closed this pull request 2026-11-26 04:12:12 +00:00
Author
Owner

@⁠YeetSkillet on GitHub · 2026-11-23 19:12 UTC · original

Tested 3faff378 on Windows 10 22H2. All four cases in scripts/test-reporting.tests.ps1 passed in both Windows PowerShell 5.1 and PowerShell 7.6.9.

I found a case where neither skip summary appears. I ran & .\scripts\test.ps1 *> test.log with a native cargo.exe stand-in that writes a build progress line to stderr and returns 0. Windows PowerShell 5.1 raised NativeCommandError and exited 1 before invoking cargo test. PowerShell 7.6.9 reached the tests. The PR fixture uses a PowerShell function for Cargo, so it doesn't exercise native stderr redirection.

I verified this change in scripts/test.ps1.

$cargo = Get-Command cargo -ErrorAction Stop
$ErrorActionPreference = 'Continue'
& $cargo build --workspace
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

I removed the later duplicate preference assignment and used & $cargo for the existing test pipeline as well. Both shells then printed both summaries on success and preserved exit codes 0 (success), 17 (build failure) and 101 (test failure). A missing Cargo exited 1. These checks used synthetic Cargo output. Tested with Codex.

**@⁠YeetSkillet** on GitHub · 2026-11-23 19:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/140#issuecomment-7111241345) Tested `3faff378` on Windows 10 22H2. All four cases in `scripts/test-reporting.tests.ps1` passed in both Windows PowerShell 5.1 and PowerShell 7.6.9. I found a case where neither skip summary appears. I ran `& .\scripts\test.ps1 *> test.log` with a native `cargo.exe` stand-in that writes a build progress line to stderr and returns 0. Windows PowerShell 5.1 raised `NativeCommandError` and exited 1 before invoking `cargo test`. PowerShell 7.6.9 reached the tests. The PR fixture uses a PowerShell function for Cargo, so it doesn't exercise native stderr redirection. I verified this change in `scripts/test.ps1`. ```powershell $cargo = Get-Command cargo -ErrorAction Stop $ErrorActionPreference = 'Continue' & $cargo build --workspace if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } ``` I removed the later duplicate preference assignment and used `& $cargo` for the existing test pipeline as well. Both shells then printed both summaries on success and preserved exit codes `0` (success), `17` (build failure) and `101` (test failure). A missing Cargo exited `1`. These checks used synthetic Cargo output. Tested with Codex.
Author
Owner

@⁠ivall on GitHub · 2026-11-23 20:52 UTC · original

Closing in favour of #137 (merged), which has the same goal with a smaller change. The PowerShell 5.1 issue is fixed by #185 (merged). Thanks!

**@⁠ivall** on GitHub · 2026-11-23 20:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/140#issuecomment-7113687739) Closing in favour of #137 (merged), which has the same goal with a smaller change. The PowerShell 5.1 issue is fixed by #185 (merged). Thanks!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.