Use insta and criterion for main integration test and benches respectively.

docker/ci: Separate integration and unit tests and benches jobs.

Add directives to remove db before/after integration tests are performed.

Split start/run/stop phases; add more granular smoketests.

Split main integration tests into units for isolation.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-10-01 02:41:24 +00:00
parent 43f0882d83
commit 8d6bfde5a0
22 changed files with 373 additions and 100 deletions

View File

@@ -114,10 +114,10 @@ url.workspace = true
nix.workspace = true
[dev-dependencies]
criterion.workspace = true
insta.workspace = true
maplit.workspace = true
similar.workspace = true
criterion.workspace = true
[lints]
workspace = true

View File

@@ -45,10 +45,29 @@ pub struct Args {
#[arg(long)]
pub execute: Vec<String>,
/// Set functional testing modes if available. Ex '--test=smoke'
#[arg(long, hide(true))]
/// Set functional testing modes if available. Ex '--test=smoke'. Empty
/// values are permitted for compatibility with testing and benchmarking
/// frameworks which may simply pass `--test` to the same execution.
#[arg(
long,
hide(true),
num_args = 0..=1,
require_equals(false),
default_missing_value = "",
)]
pub test: Vec<String>,
/// Compatibility option for benchmark frameworks which pass `--bench` to
/// the same execution and must be silently accepted without error.
#[arg(
long,
hide(true),
num_args = 0..=1,
require_equals(false),
default_missing_value = "",
)]
pub bench: Vec<String>,
/// Override the tokio worker_thread count.
#[arg(
long,
@@ -151,12 +170,12 @@ pub struct Args {
impl Args {
#[must_use]
pub fn default_test(name: &str) -> Self {
pub fn default_test(name: &[&str]) -> Self {
let mut args = Self::default();
args.test.push(name.into());
args.test
.extend(name.iter().copied().map(ToOwned::to_owned));
args.option
.push("server_name=\"localhost\"".into());
args
}
}