diff options
author | mdecimus <mauro@stalw.art> | 2024-07-30 18:53:05 +0200 |
---|---|---|
committer | mdecimus <mauro@stalw.art> | 2024-07-30 18:53:05 +0200 |
commit | 9840494094ab3c5138cb24bc3ee253783d1faad3 (patch) | |
tree | f4a8d8f3d4a7eb2bb86ad21b8a97d59342d48875 /tests | |
parent | d29d21692e025eaff70fda61fd33af98191cb3c8 (diff) |
Webhook dispatch reimplementation as a tracer
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/jmap/auth_limits.rs | 10 | ||||
-rw-r--r-- | tests/src/jmap/mod.rs | 9 | ||||
-rw-r--r-- | tests/src/jmap/webhooks.rs | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/tests/src/jmap/auth_limits.rs b/tests/src/jmap/auth_limits.rs index d96231d9..1de19ae7 100644 --- a/tests/src/jmap/auth_limits.rs +++ b/tests/src/jmap/auth_limits.rs @@ -267,10 +267,10 @@ pub async fn test(params: &mut JMAPTest) { // Check webhook events params.webhook.assert_contains(&[ - "auth.failure", - "auth.success", - "auth.banned", - "\"login\": \"jdoe@example.com\"", - "\"accountType\": \"individual\"", + "authFailure", + "authSuccess", + "authBanned", + "\"name\": \"jdoe@example.com\"", + "\"type\": \"individual\"", ]); } diff --git a/tests/src/jmap/mod.rs b/tests/src/jmap/mod.rs index bfea6d79..94e9fb65 100644 --- a/tests/src/jmap/mod.rs +++ b/tests/src/jmap/mod.rs @@ -276,10 +276,7 @@ vrfy = true [webhook."test"] url = "http://127.0.0.1:8821/hook" -events = ["auth.success", "auth.failure", "auth.banned", "auth.error", - "message.accepted", "message.rejected", "message.appended", - "account.over-quota", "dsn", "double-bounce", "report.incoming.dmarc", - "report.incoming.tls", "report.incoming.arf", "report.outgoing"] +events = ["*"] signature-key = "ovos-moles" throttle = "100ms" @@ -454,6 +451,7 @@ async fn init_jmap_tests(store_id: &str, delete_if_exists: bool) -> JMAPTest { .cloned() .unwrap_or_default(), }; + let tracers = Tracers::parse(&mut config); let core = Core::parse(&mut config, stores, config_manager).await; let store = core.storage.data.clone(); let shared_core = core.into_shared(); @@ -461,6 +459,9 @@ async fn init_jmap_tests(store_id: &str, delete_if_exists: bool) -> JMAPTest { // Parse acceptors servers.parse_tcp_acceptors(&mut config, shared_core.clone()); + // Enable tracing + tracers.enable(); + // Setup IPC channels let (delivery_tx, delivery_rx) = mpsc::channel(IPC_CHANNEL_BUFFER); let ipc = Ipc { delivery_tx }; diff --git a/tests/src/jmap/webhooks.rs b/tests/src/jmap/webhooks.rs index 8119bb29..7dd9b595 100644 --- a/tests/src/jmap/webhooks.rs +++ b/tests/src/jmap/webhooks.rs @@ -42,7 +42,7 @@ pub async fn test(params: &mut JMAPTest) { tokio::time::sleep(Duration::from_millis(1000)).await; // Check for events - params.webhook.assert_contains(&["auth.success"]); + params.webhook.assert_contains(&["authSuccess"]); } impl MockWebhookEndpoint { |