make tests pass cleanly in sandbox#4067
Conversation
…fix-test # Conflicts: # codex-rs/core/tests/suite/client.rs
| } | ||
|
|
||
| #[macro_export] | ||
| macro_rules! skip_if_sandbox { |
There was a problem hiding this comment.
skip_if_seatbelt_sandbox?
There was a problem hiding this comment.
the intention here is to skip if there's any sandbox (since the sandboxes should behave roughly similarly irrespective of platform), but afaik we don't inject an env var for landlock?
| .expect("user-agent header missing"); | ||
| assert_eq!(ua_header.to_str().unwrap(), expected_ua); | ||
| #[test] | ||
| fn test_originator_header_defaults_to_codex_cli_rs() { |
There was a problem hiding this comment.
This test was asserting that the value is being sent
There was a problem hiding this comment.
I think it was useful in it's old form
| .unwrap_or_else(|_| reqwest::Client::new()) | ||
| .default_headers(headers); | ||
| if is_sandboxed() { | ||
| builder = builder.no_proxy(); |
There was a problem hiding this comment.
why was this part causing an issue? does it work in sandbox without proxy?
There was a problem hiding this comment.
can't look up the system proxy when in the sandbox.
pakrym-oai
left a comment
There was a problem hiding this comment.
let's remove the duplicate macro
add a comment about why the proxy is being disabled
and bring back the originator header test
This changes the reqwest client used in tests to be sandbox-friendly, and skips a bunch of other tests that don't work inside the sandbox/without network.