Skip to content

test(event): cover shorthand normalization dedup#69

Draft
overtrue wants to merge 2 commits intomainfrom
codex/test-gap-event-shorthand-dedup
Draft

test(event): cover shorthand normalization dedup#69
overtrue wants to merge 2 commits intomainfrom
codex/test-gap-event-shorthand-dedup

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

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_list with put, PUT, and s3:ObjectCreated:* together and asserts that the result is a single canonical s3: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 --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant