tests: report and count missing sample skips separately #138

Closed
Nik3310 wants to merge 1 commit from upstream-pr/140 into main
Nik3310 commented 2026-11-23 14:58:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Nik3310 on 2026-11-23T14:58:45Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6562120899 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/140). Originally posted by [Nik3310](https://github.com/Nik3310) on 2026-11-23T14:58:45Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:57:21 +00:00
YeetSkillet commented 2026-11-24 07:04:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by YeetSkillet on 2026-11-23T19:12:09Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7111241345 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/140#issuecomment-7111241345). Originally posted by [YeetSkillet](https://github.com/YeetSkillet) on 2026-11-23T19:12:09Z. --- 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.
ivall commented 2026-11-24 07:04:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T20:52:51Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7113687739 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/140#issuecomment-7113687739). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T20:52:51Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!138
No description provided.