add smoketest-assist execution mode

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-08-26 21:30:37 +00:00
parent fcb9d04d9e
commit f4db6292b3

View file

@ -1,7 +1,4 @@
use conduit::{
debug, error, implement, info,
};
use conduit::{debug, debug_info, error, implement, info};
use ruma::events::room::message::RoomMessageEventContent;
use tokio::time::{sleep, Duration};
@ -33,6 +30,16 @@ pub(super) async fn startup_execute(&self) {
self.startup_execute_command(i, command.clone()).await;
tokio::task::yield_now().await;
}
// The smoketest functionality is placed here for now and simply initiates
// shutdown after all commands have executed.
if self.services.server.config.test.contains("smoke") {
debug_info!("Smoketest mode. All commands complete. Shutting down now...");
self.services
.server
.shutdown()
.unwrap_or_else(error::default_log);
}
}
/// Execute one admin command after startup