Tests: add inspect_e2e integration tests for CLI text and json output #2201

Merged
heditrigui merged 1 commit from upstream-pr/2211 into main 2026-11-25 18:16:03 +00:00
heditrigui commented 2026-11-25 09:57:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by heditrigui on 2026-11-25T09:57:37Z.


Summary

Adds integration test suite crates/xcl/tests/inspect_e2e.rs covering the xcl inspect subcommand:

  • Verifies that invoking xcl inspect without arguments exits with code 2, prints usage help containing xcl inspect <file.exe|file.dll> [--json] to stdout, and writes nothing to stderr.
  • Verifies that inspecting a nonexistent file exits with code 2 and reports xcl inspect: cannot read to stderr.
  • Verifies that inspecting an invalid / non-PE file exits with code 3 and reports parsing error instructions to stderr.
  • Verifies that inspecting a valid PE (xcl.exe) succeeds with exit code 0 in both human-readable text mode (checking File:, Type:, ImageBase:, Imports:) and --json mode (validating parsed JSON fields file, machine, is_dll, size_of_image, subsystem, exception_entries, and imports).

Tested

  • python -m pytest scripts/ (25 passed in 0.45s).
  • Validated with scripts/pr_check.py --local.

Not tested

  • Retail game smoke execution (tests/ integration suites are non-runtime code).

AI use

  • Antigravity (Gemini 3.8 Flash (High))
<!-- greyfinch-sync:ivall/xcl:issue:6601845223 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2211). Originally posted by [heditrigui](https://github.com/heditrigui) on 2026-11-25T09:57:37Z. --- ### Summary Adds integration test suite `crates/xcl/tests/inspect_e2e.rs` covering the `xcl inspect` subcommand: - Verifies that invoking `xcl inspect` without arguments exits with code 2, prints usage help containing `xcl inspect <file.exe|file.dll> [--json]` to stdout, and writes nothing to stderr. - Verifies that inspecting a nonexistent file exits with code 2 and reports `xcl inspect: cannot read` to stderr. - Verifies that inspecting an invalid / non-PE file exits with code 3 and reports parsing error instructions to stderr. - Verifies that inspecting a valid PE (`xcl.exe`) succeeds with exit code 0 in both human-readable text mode (checking `File:`, `Type:`, `ImageBase:`, `Imports:`) and `--json` mode (validating parsed JSON fields `file`, `machine`, `is_dll`, `size_of_image`, `subsystem`, `exception_entries`, and `imports`). **Tested** - `python -m pytest scripts/` (25 passed in 0.45s). - Validated with `scripts/pr_check.py --local`. **Not tested** - Retail game smoke execution (`tests/` integration suites are non-runtime code). **AI use** - Antigravity (Gemini 3.8 Flash (High))
raylitebull commented 2026-11-25 11:09:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:48:33Z.


Code review on 39ad9df:

  • crates/xcl/tests/inspect_e2e.rs adds clean end-to-end coverage for xcl inspect usage exit 2, missing/non-PE error paths, and PE text + JSON field output, and both CI checks (Build and test + PR description) are green.

Remaining before merge: Independent verification across AMD and NVIDIA hosts (or Windows CLI runs on both) on 39ad9df.

<!-- greyfinch-sync:ivall/xcl:comment:7160201340 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2211#issuecomment-7160201340). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:48:33Z. --- Code review on `39ad9df`: - `crates/xcl/tests/inspect_e2e.rs` adds clean end-to-end coverage for `xcl inspect` usage exit `2`, missing/non-PE error paths, and PE text + JSON field output, and both CI checks (`Build and test` + `PR description`) are green. **Remaining before merge:** Independent verification across **AMD** and **NVIDIA** hosts (or Windows CLI runs on both) on `39ad9df`.
tiagonleal commented 2026-11-25 13:05:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-25T12:32:59Z.


Verification on NVIDIA RTX 5070 Ti (Windows 11), head 39ad9dfcdd6cd32baff4f8f811b997e759e521be

Tested

  • Head 39ad9dfcdd6cd32baff4f8f811b997e759e521be (git rev-parse HEAD of a clean worktree, no local changes, built as is). The PR was open and the head unchanged when I started and again before writing this.
  • Windows 11 Pro 10.0.26300 (Developer Mode off), NVIDIA GeForce RTX 5070 Ti 16 GB (driver 32.0.16.1742), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), cargo 1.100.0, debug profile (the cargo test default).
  • The PR changes crates/xcl/tests/inspect_e2e.rs, so I ran that target and not --lib: cargo test -p xcl --test inspect_e2e -- --test-threads=4 --nocapture: 4 passed, 0 failed, 0 ignored (about 20 s including an incremental build). Tests: inspect_missing_arguments_prints_help_and_exits_two, inspect_nonexistent_file_exits_two_with_error, inspect_non_pe_file_exits_three_with_parse_error, inspect_valid_pe_in_text_and_json_modes. This is the Windows CLI run on an NVIDIA host that the review asked for.
  • No SKIPPED lines in the output.

Not tested

  • An AMD host: the review asked for AMD and NVIDIA (or Windows CLI runs on both), and only this NVIDIA host was run.
  • cargo test --workspace, --lib and the other test targets; release profile; Developer Mode on (off here); the retail game and xcl-smoke.

AI use

  • Claude Code created the clean worktree, built and ran the test target above, and wrote this report. No code was changed.

Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7162525556 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2211#issuecomment-7162525556). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-25T12:32:59Z. --- Verification on NVIDIA RTX 5070 Ti (Windows 11), head `39ad9dfcdd6cd32baff4f8f811b997e759e521be` **Tested** - Head `39ad9dfcdd6cd32baff4f8f811b997e759e521be` (`git rev-parse HEAD` of a clean worktree, no local changes, built as is). The PR was open and the head unchanged when I started and again before writing this. - Windows 11 Pro 10.0.26300 (Developer Mode off), NVIDIA GeForce RTX 5070 Ti 16 GB (driver 32.0.16.1742), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), cargo 1.100.0, debug profile (the `cargo test` default). - The PR changes `crates/xcl/tests/inspect_e2e.rs`, so I ran that target and not `--lib`: `cargo test -p xcl --test inspect_e2e -- --test-threads=4 --nocapture`: 4 passed, 0 failed, 0 ignored (about 20 s including an incremental build). Tests: `inspect_missing_arguments_prints_help_and_exits_two`, `inspect_nonexistent_file_exits_two_with_error`, `inspect_non_pe_file_exits_three_with_parse_error`, `inspect_valid_pe_in_text_and_json_modes`. This is the Windows CLI run on an NVIDIA host that the review asked for. - No `SKIPPED` lines in the output. **Not tested** - An AMD host: the review asked for AMD and NVIDIA (or Windows CLI runs on both), and only this NVIDIA host was run. - `cargo test --workspace`, `--lib` and the other test targets; release profile; Developer Mode on (off here); the retail game and `xcl-smoke`. **AI use** - Claude Code created the clean worktree, built and ran the test target above, and wrote this report. No code was changed. Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).
thiagocalile commented 2026-11-25 17:07:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thiagocalile on 2026-11-25T16:45:13Z.


Independent test report for head 39ad9dfcdd6cd32baff4f8f811b997e759e521be on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver 32.0.21045.29003, XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11.
  • XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --test inspect_e2e -- --test-threads=4: 4 passed, 0 failed, 0 ignored (0 skipped).

Not tested: full workspace test suite on this head, NVIDIA/Intel GPUs, or Linux/Wine (test-only PR, no smoke run needed).

AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.

<!-- greyfinch-sync:ivall/xcl:comment:7168478326 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2211#issuecomment-7168478326). Originally posted by [thiagocalile](https://github.com/thiagocalile) on 2026-11-25T16:45:13Z. --- Independent test report for head `39ad9dfcdd6cd32baff4f8f811b997e759e521be` on an **AMD Radeon RX 6600** (8 GB VRAM, RDNA2, native wave64). **Tested** - Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver `32.0.21045.29003`, `XCL_ADAPTER=radeon`), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (`10.0.26200.0`), Rust `1.100.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.8.2502.11`. - `XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --test inspect_e2e -- --test-threads=4`: **4 passed, 0 failed, 0 ignored** (`0` skipped). **Not tested:** full workspace test suite on this head, NVIDIA/Intel GPUs, or Linux/Wine (test-only PR, no smoke run needed). **AI use:** Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
upstream-sync closed this pull request 2026-11-25 19:07:51 +00:00
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!2201
No description provided.