fix: update run_tests tests for Stdio::inherit and bump tool count to 60
run_tests now uses Stdio::inherit so stdout/stderr aren't captured — tests can only assert on pass/fail and exit code. Tool count bumped from 59 to 60 for the new get_test_result tool. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1550,7 +1550,7 @@ mod tests {
|
|||||||
assert!(names.contains(&"status"));
|
assert!(names.contains(&"status"));
|
||||||
assert!(names.contains(&"loc_file"));
|
assert!(names.contains(&"loc_file"));
|
||||||
assert!(names.contains(&"dump_crdt"));
|
assert!(names.contains(&"dump_crdt"));
|
||||||
assert_eq!(tools.len(), 59);
|
assert_eq!(tools.len(), 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -966,7 +966,7 @@ mod tests {
|
|||||||
let script_dir = tmp.path().join("script");
|
let script_dir = tmp.path().join("script");
|
||||||
std::fs::create_dir_all(&script_dir).unwrap();
|
std::fs::create_dir_all(&script_dir).unwrap();
|
||||||
let script_path = script_dir.join("test");
|
let script_path = script_dir.join("test");
|
||||||
std::fs::write(&script_path, "#!/usr/bin/env bash\necho 'test result: ok. 3 passed; 0 failed'\nexit 0\n").unwrap();
|
std::fs::write(&script_path, "#!/usr/bin/env bash\nexit 0\n").unwrap();
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
@@ -979,9 +979,6 @@ mod tests {
|
|||||||
|
|
||||||
assert_eq!(parsed["passed"], true);
|
assert_eq!(parsed["passed"], true);
|
||||||
assert_eq!(parsed["exit_code"], 0);
|
assert_eq!(parsed["exit_code"], 0);
|
||||||
assert_eq!(parsed["timed_out"], false);
|
|
||||||
assert_eq!(parsed["tests_passed"], 3);
|
|
||||||
assert_eq!(parsed["tests_failed"], 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -990,7 +987,7 @@ mod tests {
|
|||||||
let script_dir = tmp.path().join("script");
|
let script_dir = tmp.path().join("script");
|
||||||
std::fs::create_dir_all(&script_dir).unwrap();
|
std::fs::create_dir_all(&script_dir).unwrap();
|
||||||
let script_path = script_dir.join("test");
|
let script_path = script_dir.join("test");
|
||||||
std::fs::write(&script_path, "#!/usr/bin/env bash\necho 'test result: FAILED. 1 passed; 2 failed'\nexit 1\n").unwrap();
|
std::fs::write(&script_path, "#!/usr/bin/env bash\nexit 1\n").unwrap();
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
@@ -1003,8 +1000,6 @@ mod tests {
|
|||||||
|
|
||||||
assert_eq!(parsed["passed"], false);
|
assert_eq!(parsed["passed"], false);
|
||||||
assert_eq!(parsed["exit_code"], 1);
|
assert_eq!(parsed["exit_code"], 1);
|
||||||
assert_eq!(parsed["tests_passed"], 1);
|
|
||||||
assert_eq!(parsed["tests_failed"], 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
Reference in New Issue
Block a user