chore: Remove blocking read strings

This commit is contained in:
Jayson Reis 2026-02-18 15:52:07 +00:00 committed by Chummy
parent bc0be9a3c1
commit b9af601943
26 changed files with 331 additions and 243 deletions

View file

@ -121,20 +121,20 @@ mod tests {
use chrono::{Duration as ChronoDuration, Utc};
use tempfile::TempDir;
fn test_config(tmp: &TempDir) -> Arc<Config> {
async fn test_config(tmp: &TempDir) -> Arc<Config> {
let config = Config {
workspace_dir: tmp.path().join("workspace"),
config_path: tmp.path().join("config.toml"),
..Config::default()
};
std::fs::create_dir_all(&config.workspace_dir).unwrap();
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
Arc::new(config)
}
#[tokio::test]
async fn lists_runs_with_truncation() {
let tmp = TempDir::new().unwrap();
let cfg = test_config(&tmp);
let cfg = test_config(&tmp).await;
let job = cron::add_job(&cfg, "*/5 * * * *", "echo ok").unwrap();
let long_output = "x".repeat(1000);
@ -163,7 +163,7 @@ mod tests {
#[tokio::test]
async fn errors_when_job_id_missing() {
let tmp = TempDir::new().unwrap();
let cfg = test_config(&tmp);
let cfg = test_config(&tmp).await;
let tool = CronRunsTool::new(cfg);
let result = tool.execute(json!({})).await.unwrap();
assert!(!result.success);