Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(storage): let driver_cases declare multiple bodies at once

Steven Enamakele0051054d09d
diff --git a/tests/storage_agent_scopes_e2e.rs b/tests/storage_agent_scopes_e2e.rs
index f5d05672ca..e3b15d18d7 100644
--- a/tests/storage_agent_scopes_e2e.rs
+++ b/tests/storage_agent_scopes_e2e.rs
@@ -234,4 +234,7 @@ async fn no_acting_agent_falls_back_to_the_local_scope(case: Case) {
assert!(AgentContextRegistry::deregister("agent-gamma", &agent));
}
-driver_cases!(async two_agents_keep_cron_and_flows_apart);
+driver_cases!(
+ async two_agents_keep_cron_and_flows_apart,
+ no_acting_agent_falls_back_to_the_local_scope
+);
diff --git a/tests/support/storage_drivers.rs b/tests/support/storage_drivers.rs
index 4794e202e1..58cd45f864 100644
--- a/tests/support/storage_drivers.rs
+++ b/tests/support/storage_drivers.rs
@@ -241,59 +241,68 @@ where
}
}
-/// Declares one test case per driver for `body`, each in a module named after
-/// its driver. Drivers the build lacks are not declared at all; MongoDB is
-/// declared when compiled in and skips itself without `TSD_MONGO_URL`.
+/// Declares one test case per driver for each `body`, in a module named after
+/// the driver (`memory::body`, `sqlite::body`, ...). Drivers the build lacks
+/// are not declared at all; MongoDB is declared when compiled in and skips
+/// itself without `TSD_MONGO_URL`.
#[allow(unused_macros)]
macro_rules! driver_cases {
- (sync $body:ident) => {
- driver_cases!(@each run_sync $body);
+ (sync $($body:ident),+ $(,)?) => {
+ driver_cases!(@each run_sync $($body),+);
};
- (async $body:ident) => {
- driver_cases!(@each run_async $body);
+ (async $($body:ident),+ $(,)?) => {
+ driver_cases!(@each run_async $($body),+);
};
- (url $body:ident) => {
- driver_cases!(@each run_url $body);
+ (url $($body:ident),+ $(,)?) => {
+ driver_cases!(@each run_url $($body),+);
};
- (@each $runner:ident $body:ident) => {
+ (@each $runner:ident $($body:ident),+) => {
mod memory {
- #[test]
- fn $body() {
- $crate::storage_drivers::$runner(
- $crate::storage_drivers::Driver::Memory,
- super::$body,
- );
- }
+ $(
+ #[test]
+ fn $body() {
+ $crate::storage_drivers::$runner(
+ $crate::storage_drivers::Driver::Memory,
+ super::$body,
+ );
+ }
+ )+
}
#[cfg(feature = "storage-sqlite")]
mod sqlite {
- #[test]
- fn $body() {
- $crate::storage_drivers::$runner(
- $crate::storage_drivers::Driver::Sqlite,
- super::$body,
- );
- }
+ $(
+ #[test]
+ fn $body() {
+ $crate::storage_drivers::$runner(
+ $crate::storage_drivers::Driver::Sqlite,
+ super::$body,
+ );
+ }
+ )+
}
#[cfg(feature = "storage-file")]
mod file {
- #[test]
- fn $body() {
- $crate::storage_drivers::$runner(
- $crate::storage_drivers::Driver::File,
- super::$body,
- );
- }
+ $(
+ #[test]
+ fn $body() {
+ $crate::storage_drivers::$runner(
+ $crate::storage_drivers::Driver::File,
+ super::$body,
+ );
+ }
+ )+
}
#[cfg(feature = "storage-mongodb")]
mod mongodb {
- #[test]
- fn $body() {
- $crate::storage_drivers::$runner(
- $crate::storage_drivers::Driver::Mongo,
- super::$body,
- );
- }
+ $(
+ #[test]
+ fn $body() {
+ $crate::storage_drivers::$runner(
+ $crate::storage_drivers::Driver::Mongo,
+ super::$body,
+ );
+ }
+ )+
}
};
}