adk_kernel/conformance/
mod.rs1pub mod agenda_store;
60pub mod agent_store;
61#[cfg(feature = "channels")]
62pub mod channel_binding_store;
63#[cfg(feature = "channels")]
64pub mod channel_contract;
65#[cfg(feature = "charter")]
66pub mod charter;
67pub mod control_store;
68pub mod cron_watermark_store;
69pub mod device_store;
70#[cfg(feature = "drivers")]
71pub mod driver_store;
72#[cfg(feature = "proc")]
73pub mod ledger_store;
74pub mod partition_store;
75pub mod process_store;
76
77pub use agenda_store::AgendaStoreHarness;
78pub use agent_store::AgentStoreHarness;
79#[cfg(feature = "channels")]
80pub use channel_binding_store::ChannelBindingStoreHarness;
81#[cfg(feature = "channels")]
82pub use channel_contract::{ChannelAdapter, ChannelAdapterHarness, ContractHost};
83pub use control_store::ControlStoreHarness;
84pub use cron_watermark_store::CronWatermarkStoreHarness;
85pub use device_store::DeviceStoreHarness;
86#[cfg(feature = "drivers")]
87pub use driver_store::DriverStoreHarness;
88#[cfg(feature = "proc")]
89pub use ledger_store::LedgerStoreHarness;
90pub use partition_store::PartitionStoreHarness;
91pub use process_store::ProcessStoreHarness;
92
93#[macro_export]
99macro_rules! agenda_store_conformance_tests {
100 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
101 $(#[$attr])*
102 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
103 async fn agenda_store_put_get_round_trip() {
104 $crate::conformance::agenda_store::put_get_round_trip(&$harness).await;
105 }
106 $(#[$attr])*
107 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
108 async fn agenda_store_put_replaces() {
109 $crate::conformance::agenda_store::put_replaces(&$harness).await;
110 }
111 $(#[$attr])*
112 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
113 async fn agenda_store_list_filters_and_orders() {
114 $crate::conformance::agenda_store::list_filters_and_orders(&$harness).await;
115 }
116 $(#[$attr])*
117 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
118 async fn agenda_store_transition_compares_the_state() {
119 $crate::conformance::agenda_store::transition_compares_the_state(&$harness).await;
120 }
121 $(#[$attr])*
122 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
123 async fn agenda_store_concurrent_transitions_move_once() {
124 $crate::conformance::agenda_store::concurrent_transitions_move_once(&$harness).await;
125 }
126 $(#[$attr])*
127 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
128 async fn agenda_store_delete() {
129 $crate::conformance::agenda_store::delete(&$harness).await;
130 }
131 $(#[$attr])*
132 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
133 async fn agenda_store_records_survive_a_restart() {
134 $crate::conformance::agenda_store::records_survive_a_restart(&$harness).await;
135 }
136 $(#[$attr])*
137 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
138 async fn agenda_store_concurrent_writers() {
139 $crate::conformance::agenda_store::concurrent_writers(&$harness).await;
140 }
141 };
142}
143
144#[cfg(feature = "proc")]
150#[macro_export]
151macro_rules! ledger_store_conformance_tests {
152 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
153 $(#[$attr])*
154 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
155 async fn ledger_store_append_round_trips() {
156 $crate::conformance::ledger_store::append_round_trips(&$harness).await;
157 }
158 $(#[$attr])*
159 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
160 async fn ledger_store_list_filters_and_pages() {
161 $crate::conformance::ledger_store::list_filters_and_pages(&$harness).await;
162 }
163 $(#[$attr])*
164 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
165 async fn ledger_store_records_survive_a_restart() {
166 $crate::conformance::ledger_store::records_survive_a_restart(&$harness).await;
167 }
168 $(#[$attr])*
169 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
170 async fn ledger_store_concurrent_appends() {
171 $crate::conformance::ledger_store::concurrent_appends(&$harness).await;
172 }
173 $(#[$attr])*
174 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
175 async fn ledger_store_sustained_appends() {
176 $crate::conformance::ledger_store::sustained_appends(&$harness).await;
177 }
178 $(#[$attr])*
179 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
180 async fn ledger_store_observations_replace_and_order() {
181 $crate::conformance::ledger_store::observations_replace_and_order(&$harness).await;
182 }
183 $(#[$attr])*
184 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
185 async fn ledger_store_pass_states_round_trip() {
186 $crate::conformance::ledger_store::pass_states_round_trip(&$harness).await;
187 }
188 };
189}
190
191#[macro_export]
197macro_rules! cron_watermark_store_conformance_tests {
198 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
199 $(#[$attr])*
200 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
201 async fn cron_watermark_store_unknown_source() {
202 $crate::conformance::cron_watermark_store::unknown_source(&$harness).await;
203 }
204 $(#[$attr])*
205 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
206 async fn cron_watermark_store_advance_then_read() {
207 $crate::conformance::cron_watermark_store::advance_then_read(&$harness).await;
208 }
209 $(#[$attr])*
210 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
211 async fn cron_watermark_store_never_moves_back() {
212 $crate::conformance::cron_watermark_store::never_moves_back(&$harness).await;
213 }
214 $(#[$attr])*
215 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
216 async fn cron_watermark_store_delete() {
217 $crate::conformance::cron_watermark_store::delete(&$harness).await;
218 }
219 $(#[$attr])*
220 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
221 async fn cron_watermark_store_cursors_survive_a_restart() {
222 $crate::conformance::cron_watermark_store::cursors_survive_a_restart(&$harness).await;
223 }
224 $(#[$attr])*
225 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
226 async fn cron_watermark_store_concurrent_advances_keep_the_latest() {
227 $crate::conformance::cron_watermark_store::concurrent_advances_keep_the_latest(
228 &$harness,
229 )
230 .await;
231 }
232 };
233}
234
235#[macro_export]
241macro_rules! partition_store_conformance_tests {
242 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
243 $(#[$attr])*
244 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
245 async fn partition_store_put_get_round_trip() {
246 $crate::conformance::partition_store::put_get_round_trip(&$harness).await;
247 }
248 $(#[$attr])*
249 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
250 async fn partition_store_put_replaces() {
251 $crate::conformance::partition_store::put_replaces(&$harness).await;
252 }
253 $(#[$attr])*
254 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
255 async fn partition_store_list_orders_by_id() {
256 $crate::conformance::partition_store::list_orders_by_id(&$harness).await;
257 }
258 $(#[$attr])*
259 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
260 async fn partition_store_delete() {
261 $crate::conformance::partition_store::delete(&$harness).await;
262 }
263 $(#[$attr])*
264 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
265 async fn partition_store_unknown_partition() {
266 $crate::conformance::partition_store::unknown_partition(&$harness).await;
267 }
268 $(#[$attr])*
269 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
270 async fn partition_store_crossings_filter_and_order() {
271 $crate::conformance::partition_store::crossings_filter_and_order(&$harness).await;
272 }
273 $(#[$attr])*
274 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
275 async fn partition_store_crossing_records_round_trip() {
276 $crate::conformance::partition_store::crossing_records_round_trip(&$harness).await;
277 }
278 $(#[$attr])*
279 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
280 async fn partition_store_run_grants_stay_in_their_run() {
281 $crate::conformance::partition_store::run_grants_stay_in_their_run(&$harness).await;
282 }
283 $(#[$attr])*
284 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
285 async fn partition_store_released_runs_hold_no_grants() {
286 $crate::conformance::partition_store::released_runs_hold_no_grants(&$harness).await;
287 }
288 $(#[$attr])*
289 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
290 async fn partition_store_records_survive_a_restart() {
291 $crate::conformance::partition_store::records_survive_a_restart(&$harness).await;
292 }
293 $(#[$attr])*
294 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
295 async fn partition_store_concurrent_writers() {
296 $crate::conformance::partition_store::concurrent_writers(&$harness).await;
297 }
298 };
299}
300
301#[macro_export]
305macro_rules! process_store_conformance_tests {
306 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
307 $(#[$attr])*
308 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
309 async fn process_store_put_get_round_trip() {
310 $crate::conformance::process_store::put_get_round_trip(&$harness).await;
311 }
312 $(#[$attr])*
313 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
314 async fn process_store_put_replaces() {
315 $crate::conformance::process_store::put_replaces(&$harness).await;
316 }
317 $(#[$attr])*
318 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
319 async fn process_store_list_filters_and_orders() {
320 $crate::conformance::process_store::list_filters_and_orders(&$harness).await;
321 }
322 $(#[$attr])*
323 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
324 async fn process_store_set_wake_and_queue() {
325 $crate::conformance::process_store::set_wake_and_queue(&$harness).await;
326 }
327 $(#[$attr])*
328 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
329 async fn process_store_unknown_pid() {
330 $crate::conformance::process_store::unknown_pid(&$harness).await;
331 }
332 $(#[$attr])*
333 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
334 async fn process_store_delete() {
335 $crate::conformance::process_store::delete(&$harness).await;
336 }
337 $(#[$attr])*
338 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
339 async fn process_store_records_survive_a_restart() {
340 $crate::conformance::process_store::records_survive_a_restart(&$harness).await;
341 }
342 $(#[$attr])*
343 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
344 async fn process_store_concurrent_writers() {
345 $crate::conformance::process_store::concurrent_writers(&$harness).await;
346 }
347 $(#[$attr])*
348 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
349 async fn process_store_sustained_writes() {
350 $crate::conformance::process_store::sustained_writes(&$harness).await;
351 }
352 $(#[$attr])*
353 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
354 async fn process_store_suspend_request_round_trips() {
355 $crate::conformance::process_store::suspend_request_round_trips(&$harness).await;
356 }
357 $(#[$attr])*
358 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
359 async fn process_store_spend_sums_by_day_and_scope() {
360 $crate::conformance::process_store::spend_sums_by_day_and_scope(&$harness).await;
361 }
362 $(#[$attr])*
363 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
364 async fn process_store_usage_sums_counters_by_day_and_scope() {
365 $crate::conformance::process_store::usage_sums_counters_by_day_and_scope(&$harness)
366 .await;
367 }
368 };
369}
370
371#[cfg(feature = "drivers")]
377#[macro_export]
378macro_rules! driver_store_conformance_tests {
379 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
380 $(#[$attr])*
381 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
382 async fn driver_store_put_get_round_trip() {
383 $crate::conformance::driver_store::put_get_round_trip(&$harness).await;
384 }
385 $(#[$attr])*
386 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
387 async fn driver_store_put_replaces() {
388 $crate::conformance::driver_store::put_replaces(&$harness).await;
389 }
390 $(#[$attr])*
391 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
392 async fn driver_store_list_orders_by_id() {
393 $crate::conformance::driver_store::list_orders_by_id(&$harness).await;
394 }
395 $(#[$attr])*
396 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
397 async fn driver_store_unknown_id() {
398 $crate::conformance::driver_store::unknown_id(&$harness).await;
399 }
400 $(#[$attr])*
401 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
402 async fn driver_store_delete() {
403 $crate::conformance::driver_store::delete(&$harness).await;
404 }
405 $(#[$attr])*
406 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
407 async fn driver_store_records_survive_a_restart() {
408 $crate::conformance::driver_store::records_survive_a_restart(&$harness).await;
409 }
410 $(#[$attr])*
411 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
412 async fn driver_store_concurrent_writers() {
413 $crate::conformance::driver_store::concurrent_writers(&$harness).await;
414 }
415 $(#[$attr])*
416 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
417 async fn driver_store_park_round_trip_per_kind() {
418 $crate::conformance::driver_store::park_round_trip_per_kind(&$harness).await;
419 }
420 $(#[$attr])*
421 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
422 async fn driver_store_parks_are_keyed_by_scope_and_call() {
423 $crate::conformance::driver_store::parks_are_keyed_by_scope_and_call(&$harness).await;
424 }
425 $(#[$attr])*
426 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
427 async fn driver_store_list_parks_filters_by_driver() {
428 $crate::conformance::driver_store::list_parks_filters_by_driver(&$harness).await;
429 }
430 $(#[$attr])*
431 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
432 async fn driver_store_delete_park() {
433 $crate::conformance::driver_store::delete_park(&$harness).await;
434 }
435 };
436}