Test victory config policy exit status through the CLI #3072
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3074"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by kyle7908 on 2026-11-26T06:29:42Z.
Summary
Add process-level regression coverage for
victory configas a follow-up to #1830 and #831. Thanks to Ingenioeren for the production fix and for [inviting me to submit the CLI tests separately](https://github.com/Marvisak/VIctory/pull/1830#issuecomment-7159107019). These tests come from my earlier work in kyle7908/VIctory@a91e4dba5e, recovered from local commit10ebac0.The tests launch Cargo's built
victoryexecutable in a temporary directory. They cover clean paths, a singlegame_dirviolation, a singletest_titleviolation, and multiple cache/data violations.They check the actual exit code, the resolved configuration and per-path diagnostics on stdout, and the counted error summary on stderr.
Following reviewer feedback, the tests now use unique temporary directories through
std::env::temp_dir(), with reliable cleanup and no additional dependencies.Both
Cargo.tomlandCargo.lockmatch upstreammain. The PR changes onlyapps/victory/tests/config.rs. #1830's production implementation is unchanged.Validation
49761f9), the clean case passed and all three violation cases failed because the executable printed the policy diagnostics but exited0.mainat63bcca4, all 41 tests invictory,victory-core, andxtaskpassed, including all four new CLI cases.--all-features.-D warningsfor all targets under default and all features.git diff --check, and staged and full asset-policy checks passed.311a72c.Local validation covered the relevant packages on Windows. The fixtures contain only temporary TOML, directories and empty repository markers. No game files or game-derived data were used.
AI disclosure. OpenAI Codex assisted with recovering the patch, source review, implementation, validation and preparation of this description.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T06:34:30Z.
Review: APPROVED
Verified: real end-to-end coverage — spawns CARGO_BIN_EXE_victory in a tempdir, asserts exit 0 vs 1, the exact one-line stderr summary (Option iterator eq trick is neat), each resolved path on stdout, and one POLICY VIOLATION line per marked dir. Env scrubbing covers the overrides that would make it nondeterministic.
Imported from Marvisak/VIctory. Originally posted by kyle7908 on 2026-11-26T06:37:28Z.
@kotekompotek Thanks for the thorough review and approval! Really appreciate your time.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T08:56:07Z.
Review: APPROVED
Verified
311a72c3locally on Windows 11 x64:cargo clippy --all-targets --locked -- -D warningsand--all-features: clean (0.77s/3.57s).cargo test -p xtask --locked policy::tests::repository_passes_policy: 1 passed, 0 failed (0.34s).cargo test -p victory -p victory-core -p xtask --locked: 41 passed, 0 failed (22invictoryincluding all 4tests/config.rscases,13invictory-core,6inxtask,2.73s).cargo test -p victory --all-features --locked: 22 passed, 0 failed (2.64s).rustfmt --edition 2024 --check apps/victory/tests/config.rs: clean.Cargo.tomlandCargo.locknow matchmaincleanly, leavingapps/victory/tests/config.rsas the sole file.ScratchDirallocates unique per-test directories atomically viacreate_dirretry withAtomicUsize+ PID + timestamp and cleans up cleanly inDropwithout masking test panics. (Optional nit: in thepanicking()branch ofDrop,let _ = writeln!(std::io::stderr(), ...);avoids any theoretical double-panic if stderr write fails.)LGTM.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T08:23:34Z.
Automated triage for the maintainers.
Verdict: needs work. This needs the maintainer's decision. The tests in
apps/victory/tests/config.rscheck what they should against main'sshow_config/check_policy(apps/victory/src/main.rs) andvictory_core::ensure_outside_repo:POLICY VIOLATION:lines;N configured path(s) violate the asset policysummary;.victory-rootmarker.That is useful coverage of rule 1.
The PR adds a dev-dependency (
tempfile) toapps/victory/Cargo.tomland changesCargo.lock. Triage leaves dependency changes to the maintainer, even for a crate already in the workspace. The existing CLI tests (tests/census.rs) need no extra crate. A unique directory understd::env::temp_dir(), removed at the end, would avoid the dependency. That change, or the maintainer's approval oftempfilehere, would make this a merge candidate.CI:
checkpassing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by kyle7908 on 2026-11-26T08:32:52Z.
Thanks for flagging the dependency concern.
I've removed
tempfileand switched the four CLI tests to unique directories understd::env::temp_dir(), following the existing census test convention. All four tests and their assertions are preserved, and bothCargo.tomlandCargo.locknow match upstreammain.All 41 relevant tests passed locally on Windows, including the four CLI cases with all features enabled. Temporary-directory cleanup, formatting, Clippy and asset-policy checks also passed.
The latest hosted Windows CI check is now passing.
Thanks again for the review!
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-27T10:54:59Z.
NVIDIA full-suite run, to go with the reports above by fuzeofficlal, since none of them names a GPU run. Tested exact head
311a72c(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 870 passed, 0 failed, 10 ignored.config_succeeds_with_paths_outside_a_source_tree,config_reports_a_game_dir_violation,config_reports_a_test_title_violation,config_reports_multiple_violations.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by kyle7908 on 2026-11-27T10:57:41Z.
@futurepro62 Thanks for running the wider test suite and confirming all four new regression tests pass! Really appreciate the additional validation and detailed report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.