Skip to content

Commit 8a796fb

Browse files
committed
Fix CI: coverage map and hermetic test spawns
docs/testing/vlt-coverage.json still listed the renamed vlt takeover test under the reinstall-advisory variant. That test now asserts the advisory is not emitted (the hosted pin stays), so drop it from that list. lint-ecosystems failed on the stale name. The two new takeover test files spawned the binary with a bare Command::new, which the spawn_env_hygiene ratchet rejects. They now use hermetic::binary_command(). Refs #853, #944 Assisted-by: Claude Code:claude-opus-5-5
1 parent f2b1c7f commit 8a796fb

3 files changed

Lines changed: 6 additions & 15 deletions

File tree

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
//! Every child process gets the ambient `SOCKET_*` vars scrubbed and
1717
//! telemetry hard-disabled; each test runs in its own tempdir.
1818
19+
#[path = "common/hermetic.rs"]
20+
mod hermetic;
1921
#[path = "prebuilt_common/mod.rs"]
2022
mod prebuilt_common;
2123

2224
use std::path::Path;
23-
use std::process::Command;
2425

2526
use base64::Engine as _;
2627
use serde_json::{json, Value};
@@ -208,13 +209,8 @@ async fn mock_api(server: &MockServer) {
208209
/// Run the built binary with every ambient `SOCKET_*` var scrubbed and the
209210
/// npm registry pointed at the mock. Returns `(exit_code, envelope)`.
210211
fn run_json(cwd: &Path, registry: &str, args: &[&str]) -> (i32, Value) {
211-
let mut cmd = Command::new(env!("CARGO_BIN_EXE_socket-patch"));
212+
let mut cmd = hermetic::binary_command();
212213
cmd.current_dir(cwd);
213-
for (key, _) in std::env::vars() {
214-
if key.starts_with("SOCKET_") && key != "SOCKET_NO_CONFIG" {
215-
cmd.env_remove(key);
216-
}
217-
}
218214
cmd.env("SOCKET_TELEMETRY_DISABLED", "1")
219215
.env("SOCKET_NPM_REGISTRY", registry);
220216
let _fixture = prebuilt_common::prepare_command(&mut cmd, cwd, args, &[]);

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
//! The patch API, the hosted wheel and PyPI's JSON API are wiremock; no
1515
//! Python toolchain is needed.
1616
17+
#[path = "common/hermetic.rs"]
18+
mod hermetic;
1719
#[path = "prebuilt_common/mod.rs"]
1820
mod prebuilt_common;
1921

2022
use std::io::Write as _;
2123
use std::path::Path;
22-
use std::process::Command;
2324

2425
use base64::Engine as _;
2526
use serde_json::{json, Value};
@@ -279,7 +280,7 @@ fn run_scan(root: &Path, server: &MockServer, mode: &str, extra: &[&str]) -> (i3
279280
.unwrap();
280281
std::fs::write(info.join("RECORD"), "six.py,,\n").unwrap();
281282
let uri = server.uri();
282-
let mut cmd = Command::new(env!("CARGO_BIN_EXE_socket-patch"));
283+
let mut cmd = hermetic::binary_command();
283284
cmd.args([
284285
"scan",
285286
"--mode",
@@ -299,11 +300,6 @@ fn run_scan(root: &Path, server: &MockServer, mode: &str, extra: &[&str]) -> (i3
299300
.arg("--cwd")
300301
.arg(root)
301302
.current_dir(root);
302-
for (key, _) in std::env::vars() {
303-
if key.starts_with("SOCKET_") {
304-
cmd.env_remove(key);
305-
}
306-
}
307303
cmd.env("SOCKET_TELEMETRY_DISABLED", "1")
308304
.env("SOCKET_PYPI_JSON_API", format!("{uri}/pypi"))
309305
.env("VIRTUAL_ENV", &venv)

‎docs/testing/vlt-coverage.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@
148148
],
149149
"redirect_vlt_reinstall_required: hosted to vendored takeover": [
150150
"vlt_hosted_then_vendored_takeover_keeps_an_optional_hosted_copy",
151-
"vlt_failed_vendor_after_the_takeover_revert_still_heals_the_store",
152151
"vlt_pinned_matrix_hosted_then_vendored_optional_takeover"
153152
],
154153
"vendor_vlt_reinstall_required: optional dependency rewired or still linked upstream": [

0 commit comments

Comments
 (0)