feat: CLI: wait for ftest server to start before scheduling job
This commit is contained in:
parent
d6a5853d34
commit
8b0e05ba14
1 changed files with 15 additions and 0 deletions
15
src/main.rs
15
src/main.rs
|
@ -91,6 +91,21 @@ async fn main() -> std::io::Result<()> {
|
||||||
Command::Test { path } => {
|
Command::Test { path } => {
|
||||||
let ctx: Arc<dyn MinAppContext> = Arc::new(CliCtx::new());
|
let ctx: Arc<dyn MinAppContext> = Arc::new(CliCtx::new());
|
||||||
let serv = basic_server(ctx.clone()).await;
|
let serv = basic_server(ctx.clone()).await;
|
||||||
|
|
||||||
|
loop {
|
||||||
|
log::info!("Waiting for server to start...");
|
||||||
|
let res = reqwest::get(&format!(
|
||||||
|
"http://localhost:29130{}",
|
||||||
|
api::v1::meta::META.build_details
|
||||||
|
))
|
||||||
|
.await;
|
||||||
|
if res.is_ok() {
|
||||||
|
log::info!("Waiting server started");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tokio::time::sleep(std::time::Duration::new(2, 0)).await;
|
||||||
|
}
|
||||||
|
|
||||||
crate::runner::suite::SuiteRunnerState::run_proxy(ctx.as_ref());
|
crate::runner::suite::SuiteRunnerState::run_proxy(ctx.as_ref());
|
||||||
let (suite_results, init_containers) =
|
let (suite_results, init_containers) =
|
||||||
crate::runner::target::run_target(ctx.as_ref(), path.clone()).await;
|
crate::runner::target::run_target(ctx.as_ref(), path.clone()).await;
|
||||||
|
|
Loading…
Add table
Reference in a new issue