Skip to content

Conversation

@wojcik91
Copy link
Contributor

@wojcik91 wojcik91 commented Sep 29, 2025

This adds tooling for asserting that expected events are being emitted in API integration tests.
Also updates some existing tests as an example.

Partially resolves #1195

@wojcik91 wojcik91 changed the title verify audit log events in API integrationtests verify audit log events in API integration tests Sep 29, 2025
@wojcik91 wojcik91 marked this pull request as ready for review September 29, 2025 09:30
filipslezaklab
filipslezaklab previously approved these changes Sep 30, 2025
{
assert_eq!(
expected_event, event,
"Event type mismatch at index {}: expected {:#?}, got {:#?}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Event type mismatch at index {}: expected {:#?}, got {:#?}",
"Event type mismatch at index {index}: expected {expected_event:#?}, got {event:#?}",

Err(TryRecvError::Empty) => {
// Queue is empty, test passes
}
Ok(msg) => panic!("Expected empty queue, but got event: {:?}", msg),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ok(msg) => panic!("Expected empty queue, but got event: {:?}", msg),
Ok(msg) => panic!("Expected empty queue, but got event: {msg:?}"),

@wojcik91 wojcik91 merged commit 8b9c242 into dev Sep 30, 2025
3 checks passed
@wojcik91 wojcik91 deleted the verify_audit_log_events_in_tests branch September 30, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants