mirror of
https://github.com/openai/codex.git
synced 2026-10-29 19:08:43 +00:00
Align environment selection tests with cwd invariants
Keep the explicit turn-environment cwd assertion focused on the selected environment cwd, and remove fallback wording from the RMCP stored-environment test identifiers. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -3330,9 +3330,9 @@ async fn relative_cwd_update_without_environments_resolves_under_session_cwd() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn relative_cwd_update_with_turn_environment_resolves_under_turn_environment_cwd() {
|
||||
async fn relative_cwd_update_with_turn_environment_keeps_turn_environment_cwd() {
|
||||
let (session, _turn_context, _rx) = make_session_and_context_with_rx().await;
|
||||
let (stored_cwd, turn_environment_cwd, expected_cwd) = {
|
||||
let (stored_cwd, turn_environment_cwd, expected_session_cwd) = {
|
||||
let mut state = session.state.lock().await;
|
||||
let stored_cwd = state.session_configuration.cwd.clone();
|
||||
let stored_environment_cwd = stored_cwd.join("stored-environment");
|
||||
@@ -3341,10 +3341,10 @@ async fn relative_cwd_update_with_turn_environment_resolves_under_turn_environme
|
||||
environment_id: codex_exec_server::LOCAL_ENVIRONMENT_ID.to_string(),
|
||||
cwd: stored_environment_cwd,
|
||||
}];
|
||||
let expected_cwd = turn_environment_cwd.join("project");
|
||||
(stored_cwd, turn_environment_cwd, expected_cwd)
|
||||
let expected_session_cwd = turn_environment_cwd.join("project");
|
||||
(stored_cwd, turn_environment_cwd, expected_session_cwd)
|
||||
};
|
||||
std::fs::create_dir_all(expected_cwd.as_path()).expect("create project dir");
|
||||
std::fs::create_dir_all(expected_session_cwd.as_path()).expect("create project dir");
|
||||
|
||||
let turn_context = session
|
||||
.new_turn_with_sub_id(
|
||||
@@ -3362,18 +3362,18 @@ async fn relative_cwd_update_with_turn_environment_resolves_under_turn_environme
|
||||
.expect("turn should start");
|
||||
|
||||
let state = session.state.lock().await;
|
||||
assert_eq!(state.session_configuration.cwd, expected_cwd);
|
||||
assert_eq!(state.session_configuration.cwd, expected_session_cwd);
|
||||
assert_eq!(
|
||||
state.session_configuration.environments[0].cwd,
|
||||
stored_cwd.join("stored-environment")
|
||||
);
|
||||
assert_eq!(turn_context.cwd, expected_cwd);
|
||||
assert_eq!(turn_context.cwd, turn_environment_cwd);
|
||||
assert_eq!(
|
||||
turn_context
|
||||
.primary_environment()
|
||||
.expect("primary environment")
|
||||
.cwd,
|
||||
expected_cwd
|
||||
turn_environment_cwd
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user