diff --git a/codex-rs/chatgpt/tests/suite/apply_command_e2e.rs b/codex-rs/chatgpt/tests/suite/apply_command_e2e.rs index c2d570528c..ed342d9aad 100644 --- a/codex-rs/chatgpt/tests/suite/apply_command_e2e.rs +++ b/codex-rs/chatgpt/tests/suite/apply_command_e2e.rs @@ -172,10 +172,7 @@ console.log(fib(10)); let apply_result = apply_diff_from_task(task_response, Some(repo_path.to_path_buf())).await; - assert!( - apply_result.is_err(), - "Expected apply to fail due to merge conflicts" - ); + let apply_error = apply_result.expect_err("Expected apply to fail due to merge conflicts"); let contents = std::fs::read_to_string(&fibonacci_path).expect("Failed to read fibonacci.js"); @@ -183,6 +180,6 @@ console.log(fib(10)); contents.contains("<<<<<<< HEAD") || contents.contains("=======") || contents.contains(">>>>>>> "), - "fibonacci.js should contain merge conflict markers, got: {contents}", + "fibonacci.js should contain merge conflict markers, got: {contents}\napply error: {apply_error:#}", ); } diff --git a/codex-rs/git-utils/src/merge_driver_race_tests.rs b/codex-rs/git-utils/src/merge_driver_race_tests.rs index 07a8e5a697..c2ee73c145 100644 --- a/codex-rs/git-utils/src/merge_driver_race_tests.rs +++ b/codex-rs/git-utils/src/merge_driver_race_tests.rs @@ -210,10 +210,10 @@ fn append_default_and_driver_config(root: &Path, driver: &str, command: &str) { #[derive(Clone, Copy, Debug)] enum DriverNamespaceRace { - EmptyKnownKey, - SelectedMissingKey, - BrandNewAttributeAndKey, - BrandNewDefaultAndKey, + KnownEmpty, + SelectedMissing, + BrandNewAttribute, + BrandNewDefault, } #[test] @@ -415,22 +415,23 @@ fn isolated_three_way_config_blocks_driver_namespace_introduction_races() { } for race in [ - DriverNamespaceRace::EmptyKnownKey, - DriverNamespaceRace::SelectedMissingKey, - DriverNamespaceRace::BrandNewAttributeAndKey, - DriverNamespaceRace::BrandNewDefaultAndKey, + DriverNamespaceRace::KnownEmpty, + DriverNamespaceRace::SelectedMissing, + DriverNamespaceRace::BrandNewAttribute, + DriverNamespaceRace::BrandNewDefault, ] { let repo = init_repo(); let root = repo.path(); let attributes = match race { - DriverNamespaceRace::EmptyKnownKey | DriverNamespaceRace::SelectedMissingKey => { + DriverNamespaceRace::KnownEmpty | DriverNamespaceRace::SelectedMissing => { "target.txt merge=demo\n" } - DriverNamespaceRace::BrandNewAttributeAndKey - | DriverNamespaceRace::BrandNewDefaultAndKey => "# initially safe\n", + DriverNamespaceRace::BrandNewAttribute | DriverNamespaceRace::BrandNewDefault => { + "# initially safe\n" + } }; let patch = build_conflicting_patch(root, attributes); - if matches!(race, DriverNamespaceRace::EmptyKnownKey) { + if matches!(race, DriverNamespaceRace::KnownEmpty) { configure_driver(root, "demo", ""); } let trace = trace_path(); @@ -441,11 +442,10 @@ fn isolated_three_way_config_blocks_driver_namespace_introduction_races() { let observed = wait_for_merge_attribute_probe(&watcher_trace); if observed { match race { - DriverNamespaceRace::EmptyKnownKey - | DriverNamespaceRace::SelectedMissingKey => { + DriverNamespaceRace::KnownEmpty | DriverNamespaceRace::SelectedMissing => { append_driver_config(&watcher_root, "demo", NEW_DRIVER_COMMAND); } - DriverNamespaceRace::BrandNewAttributeAndKey => { + DriverNamespaceRace::BrandNewAttribute => { append_driver_config(&watcher_root, "brandnew", NEW_DRIVER_COMMAND); std::fs::write( watcher_root.join(".gitattributes"), @@ -453,7 +453,7 @@ fn isolated_three_way_config_blocks_driver_namespace_introduction_races() { ) .expect("select brand-new merge driver"); } - DriverNamespaceRace::BrandNewDefaultAndKey => { + DriverNamespaceRace::BrandNewDefault => { append_default_and_driver_config( &watcher_root, "brandnew",