adk_kernel/conformance/charter/
mod.rs1pub mod autonomy_store;
41pub mod charter_store;
42pub mod fixtures;
43pub mod kpi_store;
44pub mod signal_store;
45
46pub use autonomy_store::AutonomyStoreHarness;
47pub use charter_store::CharterStoreHarness;
48pub use kpi_store::KpiStoreHarness;
49pub use signal_store::SignalStoreHarness;
50
51#[macro_export]
54macro_rules! charter_store_conformance_tests {
55 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
56 $(#[$attr])*
57 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
58 async fn charter_store_empty_site() {
59 $crate::conformance::charter::charter_store::empty_site(&$harness).await;
60 }
61 $(#[$attr])*
62 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
63 async fn charter_store_commit_reads_back() {
64 $crate::conformance::charter::charter_store::commit_reads_back(&$harness).await;
65 }
66 $(#[$attr])*
67 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
68 async fn charter_store_versions_increment() {
69 $crate::conformance::charter::charter_store::versions_increment(&$harness).await;
70 }
71 $(#[$attr])*
72 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
73 async fn charter_store_append_refuses_gaps_and_repeats() {
74 $crate::conformance::charter::charter_store::append_refuses_gaps_and_repeats(&$harness)
75 .await;
76 }
77 $(#[$attr])*
78 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
79 async fn charter_store_commit_refuses_an_invalid_draft() {
80 $crate::conformance::charter::charter_store::commit_refuses_an_invalid_draft(&$harness)
81 .await;
82 }
83 $(#[$attr])*
84 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
85 async fn charter_store_commit_refuses_an_unsatisfied_chain() {
86 $crate::conformance::charter::charter_store::commit_refuses_an_unsatisfied_chain(
87 &$harness,
88 )
89 .await;
90 }
91 $(#[$attr])*
92 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
93 async fn charter_store_the_charter_in_force_governs_a_change() {
94 $crate::conformance::charter::charter_store::the_charter_in_force_governs_a_change(
95 &$harness,
96 )
97 .await;
98 }
99 $(#[$attr])*
100 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
101 async fn charter_store_concurrent_commits_take_one_version_each() {
102 $crate::conformance::charter::charter_store::concurrent_commits_take_one_version_each(
103 &$harness,
104 )
105 .await;
106 }
107 $(#[$attr])*
108 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
109 async fn charter_store_versions_survive_a_restart() {
110 $crate::conformance::charter::charter_store::versions_survive_a_restart(&$harness)
111 .await;
112 }
113 };
114}
115
116#[macro_export]
119macro_rules! kpi_store_conformance_tests {
120 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
121 $(#[$attr])*
122 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
123 async fn kpi_store_samples_round_trip_in_order() {
124 $crate::conformance::charter::kpi_store::samples_round_trip_in_order(&$harness).await;
125 }
126 $(#[$attr])*
127 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
128 async fn kpi_store_one_sample_per_instant() {
129 $crate::conformance::charter::kpi_store::one_sample_per_instant(&$harness).await;
130 }
131 $(#[$attr])*
132 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
133 async fn kpi_store_refuses_a_value_that_is_not_finite() {
134 $crate::conformance::charter::kpi_store::refuses_a_value_that_is_not_finite(&$harness)
135 .await;
136 }
137 $(#[$attr])*
138 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
139 async fn kpi_store_aggregates_have_no_gaps() {
140 $crate::conformance::charter::kpi_store::aggregates_have_no_gaps(&$harness).await;
141 }
142 $(#[$attr])*
143 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
144 async fn kpi_store_states_round_trip() {
145 $crate::conformance::charter::kpi_store::states_round_trip(&$harness).await;
146 }
147 $(#[$attr])*
148 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
149 async fn kpi_store_concurrent_records_keep_one_per_instant() {
150 $crate::conformance::charter::kpi_store::concurrent_records_keep_one_per_instant(
151 &$harness,
152 )
153 .await;
154 }
155 $(#[$attr])*
156 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
157 async fn kpi_store_samples_survive_a_restart() {
158 $crate::conformance::charter::kpi_store::samples_survive_a_restart(&$harness).await;
159 }
160 };
161}
162
163#[macro_export]
166macro_rules! autonomy_store_conformance_tests {
167 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
168 $(#[$attr])*
169 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
170 async fn autonomy_store_unknown_job() {
171 $crate::conformance::charter::autonomy_store::unknown_job(&$harness).await;
172 }
173 $(#[$attr])*
174 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
175 async fn autonomy_store_apply_registers_then_moves() {
176 $crate::conformance::charter::autonomy_store::apply_registers_then_moves(&$harness)
177 .await;
178 }
179 $(#[$attr])*
180 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
181 async fn autonomy_store_apply_refuses_other_revisions() {
182 $crate::conformance::charter::autonomy_store::apply_refuses_other_revisions(&$harness)
183 .await;
184 }
185 $(#[$attr])*
186 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
187 async fn autonomy_store_apply_refuses_a_mismatched_change() {
188 $crate::conformance::charter::autonomy_store::apply_refuses_a_mismatched_change(
189 &$harness,
190 )
191 .await;
192 }
193 $(#[$attr])*
194 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
195 async fn autonomy_store_decisions_once_and_in_order() {
196 $crate::conformance::charter::autonomy_store::decisions_once_and_in_order(&$harness)
197 .await;
198 }
199 $(#[$attr])*
200 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
201 async fn autonomy_store_concurrent_applies_move_once() {
202 $crate::conformance::charter::autonomy_store::concurrent_applies_move_once(&$harness)
203 .await;
204 }
205 $(#[$attr])*
206 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
207 async fn autonomy_store_records_survive_a_restart() {
208 $crate::conformance::charter::autonomy_store::records_survive_a_restart(&$harness)
209 .await;
210 }
211 };
212}
213
214#[macro_export]
217macro_rules! signal_store_conformance_tests {
218 ($(#[$attr:meta])* harness = $harness:expr $(,)?) => {
219 $(#[$attr])*
220 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
221 async fn signal_store_first_opens_then_counts() {
222 $crate::conformance::charter::signal_store::first_opens_then_counts(&$harness).await;
223 }
224 $(#[$attr])*
225 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
226 async fn signal_store_keys_are_apart() {
227 $crate::conformance::charter::signal_store::keys_are_apart(&$harness).await;
228 }
229 $(#[$attr])*
230 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
231 async fn signal_store_close_then_reopen() {
232 $crate::conformance::charter::signal_store::close_then_reopen(&$harness).await;
233 }
234 $(#[$attr])*
235 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
236 async fn signal_store_list_filters_and_orders() {
237 $crate::conformance::charter::signal_store::list_filters_and_orders(&$harness).await;
238 }
239 $(#[$attr])*
240 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
241 async fn signal_store_hits_count_per_source_and_window() {
242 $crate::conformance::charter::signal_store::hits_count_per_source_and_window(&$harness)
243 .await;
244 }
245 $(#[$attr])*
246 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
247 async fn signal_store_concurrent_records_count_every_signal() {
248 $crate::conformance::charter::signal_store::concurrent_records_count_every_signal(
249 &$harness,
250 )
251 .await;
252 }
253 $(#[$attr])*
254 #[::tokio::test(flavor = "multi_thread", worker_threads = 4)]
255 async fn signal_store_records_survive_a_restart() {
256 $crate::conformance::charter::signal_store::records_survive_a_restart(&$harness).await;
257 }
258 };
259}