(args: &[&str])
| 13 | use super::output::strip_ansi; |
| 14 | |
| 15 | pub async fn run_cli(args: &[&str]) -> (String, i32) { |
| 16 | let mut cmd = openshell_cmd(); |
| 17 | cmd.args(args).stdout(Stdio::piped()).stderr(Stdio::piped()); |
| 18 | |
| 19 | let output = cmd.output().await.expect("spawn openshell"); |
| 20 | let stdout = String::from_utf8_lossy(&output.stdout); |
| 21 | let stderr = String::from_utf8_lossy(&output.stderr); |
| 22 | let combined = format!("{stdout}{stderr}"); |
| 23 | let code = output.status.code().unwrap_or(-1); |
| 24 | (combined, code) |
| 25 | } |
| 26 | |
| 27 | pub async fn wait_for_healthy(timeout: Duration) -> Result<(), String> { |
| 28 | let start = Instant::now(); |
no test coverage detected