Fix remote environment test fixtures#22572
Merged
Merged
Conversation
pakrym-oai
reviewed
May 14, 2026
This was referenced May 14, 2026
pakrym-oai
reviewed
May 14, 2026
| ); | ||
| let environment_manager = Arc::new(match exec_server_url { | ||
| Some(exec_server_url) => { | ||
| codex_exec_server::EnvironmentManager::create_for_tests_with_local( |
Collaborator
There was a problem hiding this comment.
why not always use this method?
Collaborator
There was a problem hiding this comment.
It already takes optional
pakrym-oai
reviewed
May 14, 2026
| } | ||
|
|
||
| pub async fn build_remote_aware( | ||
| pub async fn build_with_remote_env( |
Collaborator
There was a problem hiding this comment.
nit: this doesn't always build remote
it's either local or remode depending on CI job
pakrym-oai
reviewed
May 14, 2026
pakrym-oai
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Docker remote-env coverage was failing before it reached the behavior those tests are meant to exercise. The remote-aware test fixture only registered the remote environment, so tests that intentionally select both
localandremotecould not start a turn. After that was fixed, two tests exposed stale fixtures: the approval test was auto-approving under workspace-write, and the remoteview_imagetest was writing invalid PNG bytes.What Changed
EnvironmentManager::create_for_tests_with_local(...)so tests can keep the provider default while also selectinglocalexplicitly.build_remote_aware()to use that test-only manager when a remote exec-server URL is present.SandboxPolicy::new_read_only_policy()so the test actually exercises approval caching per environment.view_imagePNG blob with the existingpng_bytes(...)helper so the test uses a valid image fixture.Validation
Ran these isolated Docker remote-env tests on the devbox with
$remote-testssetup:suite::remote_env::apply_patch_freeform_routes_to_selected_remote_environmentsuite::remote_env::apply_patch_approvals_are_remembered_per_environmentsuite::remote_env::apply_patch_intercepted_exec_command_routes_to_selected_remote_environmentsuite::remote_env::exec_command_routes_to_selected_remote_environmentsuite::view_image::view_image_routes_to_selected_remote_environmentAll five pass.