Tests: expand rpf integration tests for missing arguments and empty-TOC archives #2183

Open
heditrigui wants to merge 1 commit from upstream-pr/2193 into main
heditrigui commented 2026-11-25 08:41:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by heditrigui on 2026-11-25T08:41:52Z.


Summary

Expands integration testing in crates/xcl/tests/rpf_e2e.rs to cover CLI error paths, missing arguments, and empty-TOC archives:

  • Verifies that invoking xcl rpf without arguments exits with code 2, prints usage help containing xcl rpf <package.rpf> to stdout, and writes nothing to stderr.
  • Verifies that attempting to inspect a nonexistent archive reports xcl rpf: <path> to stderr with exit code 2.
  • Verifies that non-RPF archives lacking the 9FPR magic report is not an RPF9 package to stderr with exit code 2.
  • Verifies that valid RPF9 headers without plain records report no records with plain names, invoke the probe summary, and exit cleanly with code 0.

Tested

  • python -m pytest scripts/ (25 passed in 0.50s).
  • 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:5487986814 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2193). Originally posted by [heditrigui](https://github.com/heditrigui) on 2026-11-25T08:41:52Z. --- ### Summary Expands integration testing in `crates/xcl/tests/rpf_e2e.rs` to cover CLI error paths, missing arguments, and empty-TOC archives: - Verifies that invoking `xcl rpf` without arguments exits with code 2, prints usage help containing `xcl rpf <package.rpf>` to stdout, and writes nothing to stderr. - Verifies that attempting to inspect a nonexistent archive reports `xcl rpf: <path>` to stderr with exit code 2. - Verifies that non-RPF archives lacking the `9FPR` magic report `is not an RPF9 package` to stderr with exit code 2. - Verifies that valid RPF9 headers without plain records report `no records with plain names`, invoke the probe summary, and exit cleanly with code 0. **Tested** - `python -m pytest scripts/` (25 passed in 0.50s). - 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:30 +00:00 (Migrated from github.com)

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


Code review on 2df583d:

  • Adding rpf_missing_arguments_prints_help_and_exits_two, rpf_nonexistent_file_and_invalid_magic_report_errors, and rpf_header_with_no_records_summarizes_and_exits_zero in crates/xcl/tests/rpf_e2e.rs cleanly verifies CLI diagnostics and empty-TOC handling, with both CI checks green.

Remaining before merge: Independent verification on 2df583d.

<!-- greyfinch-sync:ivall/xcl:comment:7160201422 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2193#issuecomment-7160201422). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:48:33Z. --- Code review on `2df583d`: - Adding `rpf_missing_arguments_prints_help_and_exits_two`, `rpf_nonexistent_file_and_invalid_magic_report_errors`, and `rpf_header_with_no_records_summarizes_and_exits_zero` in `crates/xcl/tests/rpf_e2e.rs` cleanly verifies CLI diagnostics and empty-TOC handling, with both CI checks green. **Remaining before merge:** Independent verification on `2df583d`.
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:56Z.


Verification on NVIDIA RTX 5070 Ti (Windows 11), head 2df583d3aca6e2d358880ecb4e762939a51b2781

Tested

  • Head 2df583d3aca6e2d358880ecb4e762939a51b2781 (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/rpf_e2e.rs, so I ran that target and not --lib: cargo test -p xcl --test rpf_e2e -- --test-threads=4 --nocapture: 5 passed, 0 failed, 0 ignored (about 20 s including an incremental build). Tests: rpf_missing_arguments_prints_help_and_exits_two, rpf_nonexistent_file_and_invalid_magic_report_errors, rpf_header_with_no_records_summarizes_and_exits_zero (the three new ones), full_scan_and_streaming_probe_agree_on_header_evidence, explicit_probe_rejects_conflicting_options.
  • No SKIPPED lines in the output.

Not tested

  • An AMD host.
  • 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:7162524622 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2193#issuecomment-7162524622). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-25T12:32:56Z. --- Verification on NVIDIA RTX 5070 Ti (Windows 11), head `2df583d3aca6e2d358880ecb4e762939a51b2781` **Tested** - Head `2df583d3aca6e2d358880ecb4e762939a51b2781` (`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/rpf_e2e.rs`, so I ran that target and not `--lib`: `cargo test -p xcl --test rpf_e2e -- --test-threads=4 --nocapture`: 5 passed, 0 failed, 0 ignored (about 20 s including an incremental build). Tests: `rpf_missing_arguments_prints_help_and_exits_two`, `rpf_nonexistent_file_and_invalid_magic_report_errors`, `rpf_header_with_no_records_summarizes_and_exits_zero` (the three new ones), `full_scan_and_streaming_probe_agree_on_header_evidence`, `explicit_probe_rejects_conflicting_options`. - No `SKIPPED` lines in the output. **Not tested** - An AMD host. - `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).
throny commented 2026-11-25 19:09:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T18:18:57Z.


Two contributors checked independently and found that #1718 #2075 solves the same problem in a different way: #1607, group D99. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

<!-- greyfinch-sync:ivall/xcl:comment:7170739811 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2193#issuecomment-7170739811). Originally posted by [throny](https://github.com/throny) on 2026-11-25T18:18:57Z. --- <!-- xcl-1607-hint:D99 --> Two contributors checked independently and found that #1718 #2075 solves the same problem in a different way: #1607, group D99. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
github-actions[bot] commented 2026-11-29 20:43:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:43:24Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7262306310 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2193#issuecomment-7262306310). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:43:24Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 07:34:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:34:24Z.


Triage (#1607) – head 2df583d

Two of the three tests repeat #2075 (same author, opened first): rpf_missing_arguments_prints_help_and_exits_two has the same name and body in both, and the missing-file and bad-magic test is #2075's two tests combined. If both are merged, the duplicate function name will not compile. The empty-TOC test (rpf_header_with_no_records_summarizes_and_exits_zero) is new and matches rpf.rs on main. #1718 tests the --probe paths instead.
The Tested section lists only a pytest run, no cargo test counts.
Recommendation: keep open (drop the two tests #2075 already has, or move the empty-TOC test into #2075).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304221949 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2193#issuecomment-7304221949). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:34:24Z. --- **Triage (#1607)** – head 2df583d Two of the three tests repeat #2075 (same author, opened first): rpf_missing_arguments_prints_help_and_exits_two has the same name and body in both, and the missing-file and bad-magic test is #2075's two tests combined. If both are merged, the duplicate function name will not compile. The empty-TOC test (rpf_header_with_no_records_summarizes_and_exits_zero) is new and matches rpf.rs on main. #1718 tests the --probe paths instead. The Tested section lists only a pytest run, no cargo test counts. Recommendation: keep open (drop the two tests #2075 already has, or move the empty-TOC test into #2075). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2193:upstream-pr/2193'
git switch 'upstream-pr/2193'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2193'
git switch 'upstream-pr/2193'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2193'
git switch 'upstream-pr/2193'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2193'
git switch 'main'
git merge --squash 'upstream-pr/2193'
git switch 'main'
git merge --ff-only 'upstream-pr/2193'
git switch 'main'
git merge 'upstream-pr/2193'
git push origin 'main'
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!2183
No description provided.