Skip to content

Commit 551bec7

Browse files
πŸ§ͺ Add error path test for extract_manifest
🎯 **What:** Adds a missing error path test for `extract_manifest` in `compat-harness` when provided with non-existent paths. πŸ“Š **Coverage:** The scenario where the upstream workspace or repository paths do not exist and `fs::read_to_string` fails is now tested to ensure it returns a `NotFound` error. ✨ **Result:** Improved test coverage and reliability for path resolution failure modes. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 27c415a commit 551bec7

3 files changed

Lines changed: 11 additions & 42 deletions

File tree

β€Žpatch_pr.pyβ€Ž

Lines changed: 0 additions & 42 deletions
This file was deleted.

β€Žpr_body.txtβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
🎯 **What:** Adds a missing error path test for `extract_manifest` in `compat-harness` when provided with non-existent paths.
2+
πŸ“Š **Coverage:** The scenario where the upstream workspace or repository paths do not exist and `fs::read_to_string` fails is now tested to ensure it returns a `NotFound` error.
3+
✨ **Result:** Improved test coverage and reliability for path resolution failure modes.

β€Žrust/crates/compat-harness/src/lib.rsβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,4 +354,12 @@ mod tests {
354354
assert!(names.contains(&"AgentTool"));
355355
assert!(names.contains(&"BashTool"));
356356
}
357+
358+
#[test]
359+
fn extract_manifest_returns_error_for_non_existent_paths() {
360+
let paths = UpstreamPaths::from_repo_root("/does/not/exist/anywhere/12345");
361+
let result = extract_manifest(&paths);
362+
assert!(result.is_err());
363+
assert_eq!(result.unwrap_err().kind(), std::io::ErrorKind::NotFound);
364+
}
357365
}

0 commit comments

Comments
Β (0)