Uh oh!
There was an error while loading. Please reload this page.
fix(cli): isolate subprocess tests from host OPENSHELL_ env vars - #2523
Conversation
Uh oh!
There was an error while loading. Please reload this page.
The subprocess-based integration tests inherit the full parent environment. If the developer has OPENSHELL_GATEWAY_INSECURE=true set in their shell, it leaks into the spawned CLI process and causes it to connect with .with_no_client_auth(), skipping the mTLS client certificate. The test server requires mTLS, so it responds with CertificateRequired and the test fails. Strip OPENSHELL_GATEWAY_INSECURE, OPENSHELL_GATEWAY, OPENSHELL_GATEWAY_ENDPOINT, and OPENSHELL_WORKSPACE from the subprocess environment. The test already sets --gateway and --gateway-endpoint explicitly via CLI args, so these env vars should not influence the subprocess behavior. Reported-by: Seth Jennings Signed-off-by: Roland Huß <rhuss@redhat.com>
d93fc33 to
d71c2acCompareLabel |
elezar
commented
Jul 29, 2026
/ok-to-test d71c2ac |
Label |
Uh oh!
There was an error while loading. Please reload this page.
Summary
The subprocess integration tests inherit the full parent environment. If the developer has
OPENSHELL_GATEWAY_INSECURE=trueset in their shell, the spawned CLI process connects with.with_no_client_auth(), skipping the mTLS client certificate. The test server requires mTLS and responds withCertificateRequired.Related Issue
Follow-up to #2504. Root cause identified by @sjenning.
Changes
OPENSHELL_GATEWAY_INSECURE,OPENSHELL_GATEWAY,OPENSHELL_GATEWAY_ENDPOINT, andOPENSHELL_WORKSPACEfrom the subprocess environment viaenv_remove()--gatewayand--gateway-endpointexplicitly via CLI args, so these env vars should not influence subprocess behaviorTesting
mise run pre-commitpassesOPENSHELL_GATEWAY_INSECURE=truebefore fix, passes afterChecklist