Update build/test scripts with clean progress indicators and minimal output

This commit is contained in:
Timur Gordon
2025-11-06 23:55:17 +01:00
parent bbced35996
commit 8a02fffcca
11 changed files with 82 additions and 1009 deletions

View File

@@ -1030,78 +1030,4 @@ impl Default for Supervisor {
client: Client::default(),
}
}
}
mod tests {
#[allow(unused_imports)]
use super::*;
#[tokio::test]
async fn test_supervisor_creation() {
let supervisor = Supervisor::builder()
.redis_url("redis://localhost:6379")
.build()
.await
.unwrap();
assert_eq!(supervisor.list_runners().len(), 0);
}
#[tokio::test]
async fn test_add_runner() {
use std::path::PathBuf;
let config = RunnerConfig::new(
"test_actor".to_string(),
"test_actor".to_string(),
"".to_string(),
PathBuf::from("/usr/bin/test_actor"),
"redis://localhost:6379".to_string(),
);
let runner = Runner::from_config(config.clone());
let mut supervisor = Supervisor::builder()
.redis_url("redis://localhost:6379")
.add_runner(runner)
.build()
.await
.unwrap();
assert_eq!(supervisor.list_runners().len(), 1);
}
#[tokio::test]
async fn test_add_multiple_runners() {
use std::path::PathBuf;
let config1 = RunnerConfig::new(
"sal_actor".to_string(),
"sal_actor".to_string(),
"".to_string(),
PathBuf::from("/usr/bin/sal_actor"),
"redis://localhost:6379".to_string(),
);
let config2 = RunnerConfig::new(
"osis_actor".to_string(),
"osis_actor".to_string(),
"".to_string(),
PathBuf::from("/usr/bin/osis_actor"),
"redis://localhost:6379".to_string(),
);
let runner1 = Runner::from_config(config1);
let runner2 = Runner::from_config(config2);
let supervisor = Supervisor::builder()
.redis_url("redis://localhost:6379")
.add_runner(runner1)
.add_runner(runner2)
.build()
.await
.unwrap();
assert_eq!(supervisor.list_runners().len(), 2);
assert!(supervisor.get_runner("sal_actor").is_some());
assert!(supervisor.get_runner("osis_actor").is_some());
}
}
}