Skip to content

Commit 8725c55

Browse files
committed
Check the Pipenv refusal exit code without VEX
The new Pipenv platform-wheel test asserted exit 0 on a run that also asked for --vex. With nothing pinned, VEX correctly fails with manifest_not_found, so the run exits 1 and the coverage job failed. Assert the hosted refusal's exit 0 on a plain scan, then run --vex separately and check only that it attests nothing. Assisted-by: Claude Code:claude-opus-5-5
1 parent 3298cee commit 8725c55

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎crates/socket-patch-cli/tests/in_process_redirect_pipenv.rs‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,9 @@ async fn live_pipfile_lock_conflict_vetoes_the_requirements_redirect() {
522522

523523
/// #932: a patch granted as a platform-tagged wheel (cp311 manylinux) is
524524
/// never pinned into the cross-platform Pipfile.lock, nor into the sibling
525-
/// requirements.txt: the run leaves both files alone, exits 0 like every
525+
/// requirements.txt: the run leaves both files alone and exits 0 like every
526526
/// hosted refusal (the `redirect_pypi_platform_wheel` warning says why),
527-
/// and its same-run VEX never attests the unpinned patch.
527+
/// and a same-run VEX never attests the unpinned patch.
528528
#[tokio::test]
529529
#[serial]
530530
async fn platform_wheel_is_not_pinned_into_the_lock() {
@@ -539,14 +539,18 @@ async fn platform_wheel_is_not_pinned_into_the_lock() {
539539
write_project(tmp.path());
540540
const REQS: &str = "urllib3==1.26.18\n";
541541
std::fs::write(tmp.path().join("requirements.txt"), REQS).unwrap();
542-
let vex_path = tmp.path().join("out.vex.json");
543-
544-
let code = run(hosted_args(tmp.path(), server.uri(), Some(&vex_path))).await;
542+
let code = run(hosted_args(tmp.path(), server.uri(), None)).await;
545543
assert_eq!(code, 0, "a hosted refusal exits 0 with a warning");
546544
assert_eq!(read(&tmp.path().join("Pipfile.lock")), LOCK);
547545
assert_eq!(read(&tmp.path().join("requirements.txt")), REQS);
548546
assert_eq!(read(&tmp.path().join("Pipfile")), PIPFILE);
549547
assert_no_ledger(tmp.path());
548+
549+
// With nothing pinned, a same-run `--vex` has nothing to attest (it
550+
// fails `manifest_not_found`) and never claims the patch.
551+
let vex_path = tmp.path().join("out.vex.json");
552+
run(hosted_args(tmp.path(), server.uri(), Some(&vex_path))).await;
553+
assert_eq!(read(&tmp.path().join("Pipfile.lock")), LOCK);
550554
if vex_path.exists() {
551555
let vex = read(&vex_path);
552556
assert!(!vex.contains("not_affected"), "{vex}");

0 commit comments

Comments
 (0)