test(event): cover shorthand normalization dedup#69
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds a focused regression test for the recent event notification normalization fix.
When users provide shorthand event names such as
put, the CLI now normalizes them to canonical S3 event names before persisting notification rules. The previous coverage checked that shorthand names were expanded, but it did not cover the case where shorthand input and an already-canonical event name appear together in the same request.That gap matters because, before the fix on
main, the CLI would have persisted raw shorthand values alongside canonical names instead of collapsing them into the same normalized event. In practice, that could leave duplicated or invalid event entries in notification configuration, depending on the input mix.Root cause
The changed code path normalized shorthand names during parsing, but the tests did not assert that normalization happens before sort and dedup. As a result, a regression in that order of operations could slip through without a failing test.
Fix
The new test exercises
parse_event_listwithput,PUT, ands3:ObjectCreated:*together and asserts that the result is a single canonicals3:ObjectCreated:*entry. This keeps the scope limited to the recent event notification change and directly covers the persistence-facing normalization behavior.Validation
I ran the required workspace checks:
cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspace