Skip to content

Commit c708c02

Browse files
gracexmatinclaude
andcommitted
fix(sources): let the proxy-check child skip when run outside its parent
CI runs every #[ignore]d test wholesale as its integration pass (nextest run -- --ignored), so the subprocess child landed in that run without the proxy variables its parent injects, and its sentinel assertion failed the job. Absent proxy variables there is nothing to check: skip with a note instead of failing. The parent still always sets the variables, and its "1 passed" assertion keeps the real run from ever being the skipped arm. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0f3563f commit c708c02

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

  • crates/skardi/src/sources/providers/rss

crates/skardi/src/sources/providers/rss/fetch.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,11 +1105,20 @@ mod tests {
11051105
#[tokio::test]
11061106
#[ignore = "subprocess half of proxy_env_vars_do_not_bypass_the_egress_policy"]
11071107
async fn proxy_env_check_in_child_process() {
1108-
assert!(
1109-
std::env::var("HTTP_PROXY").is_ok(),
1110-
"this check is meaningful only with proxy variables in the \
1111-
environment — run it through its parent test"
1112-
);
1108+
// This repo's CI runs every `#[ignore]`d test wholesale as its
1109+
// integration pass (`nextest run -- --ignored`), so being ignored
1110+
// does not mean only the parent ever runs this. Without proxy
1111+
// variables there is nothing to check — skip rather than fail. The
1112+
// parent always sets them, so the real check cannot be skipped on
1113+
// the path that matters, and its own "1 passed" assertion would
1114+
// catch this arm ever swallowing that run.
1115+
if std::env::var("HTTP_PROXY").is_err() {
1116+
eprintln!(
1117+
"skipping: no proxy variables in the environment — run via \
1118+
proxy_env_vars_do_not_bypass_the_egress_policy"
1119+
);
1120+
return;
1121+
}
11131122
let server = MockFeedServer::start(|_req| MockResponse::xml("<rss/>")).await;
11141123
let localhost_url = server.url().replace("127.0.0.1", "localhost");
11151124
let policy = Arc::new(DenyList(vec![

0 commit comments

Comments
 (0)