1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00

test running

This commit is contained in:
Robin Appelman 2021-03-14 17:20:06 +01:00
commit c2f85e009e
5 changed files with 135 additions and 14 deletions

View file

@ -96,8 +96,31 @@ async fn main() -> Result<()> {
None => eprintln!("{} is not running", cloud.id),
}
}
HazeArgs::Test { .. } => {
todo!();
HazeArgs::Test { options, path } => {
let cloud = Cloud::create(&mut docker, options, &config).await?;
cloud.wait_for_start().await?;
println!("Installing");
cloud
.exec(&mut docker, vec!["install", "admin", "admin"])
.await?;
if let Some(app) = path
.as_ref()
.and_then(|path| path.strip_prefix("apps/"))
.map(|path| &path[0..path.find('/').unwrap_or(path.len())])
{
if app.starts_with("files_") {
cloud.enable_app(&mut docker, "files_external").await?;
}
println!("Enabling {}", app);
cloud.enable_app(&mut docker, app).await?;
}
cloud
.exec(
&mut docker,
vec!["tests".to_string(), path.unwrap_or_default()],
)
.await?;
cloud.destroy(&mut docker).await?;
}
};