Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/bolt/config/src/ns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,10 @@ impl Default for RivetLogin {

#[derive(Serialize, Deserialize, Clone, Debug, Default)]
#[serde(deny_unknown_fields)]
pub struct RivetTest {}
pub struct RivetTest {
#[serde(default)]
pub load_tests: bool,
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
Expand Down
17 changes: 15 additions & 2 deletions lib/bolt/core/src/tasks/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ pub async fn test_services<T: AsRef<str>>(
}
}

let run_load_tests = ctx
.ns()
.rivet
.test
.as_ref()
.map(|test| test.load_tests)
.unwrap_or_default();

// Resolve services
let svc_names = test_ctx
.svc_names
Expand All @@ -99,10 +107,12 @@ pub async fn test_services<T: AsRef<str>>(
.collect::<Vec<_>>();
let all_svcs = ctx.services_with_patterns(&svc_names).await;

// Find all services that are executables
let rust_svcs = all_svcs
.iter()
// Find all services that are executables
.filter(|svc_ctx| matches!(svc_ctx.config().runtime, RuntimeKind::Rust {}))
// Filter/include load tests
.filter(|svc_ctx| run_load_tests || !svc_ctx.config().service.load_test)
.collect::<Vec<_>>();
eprintln!();
rivet_term::status::progress("Preparing", format!("{} services", rust_svcs.len()));
Expand All @@ -128,7 +138,10 @@ pub async fn test_services<T: AsRef<str>>(
.or_insert_with(Vec::new);
workspace.push(svc.cargo_name().expect("no cargo name"));
}
ensure!(!svcs_by_workspace.is_empty(), "no matching services");
ensure!(
!svcs_by_workspace.is_empty(),
"no matching services (to run load tests set `rivet.test.load_tests = true`)"
);

// Run build
let test_binaries = cargo::cli::build_tests(
Expand Down