Skip to content

test: add spec test for duplicate variant materialization assignments#345

Open
nicklasl wants to merge 2 commits intomainfrom
nicklasl/mat-same-variant-spec-test
Open

test: add spec test for duplicate variant materialization assignments#345
nicklasl wants to merge 2 commits intomainfrom
nicklasl/mat-same-variant-spec-test

Conversation

@nicklasl
Copy link
Copy Markdown
Member

Summary

  • Adds a spec test case where two assignments in a materialization rule point to the same variant but have different bucket ranges and assignment IDs
  • Verifies the resolver correctly picks the right assignment based on bucket matching

Test plan

  • cargo test -p confidence_resolver mat_same_variant passes

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nicklasl nicklasl marked this pull request as ready for review March 19, 2026 10:19
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@yyoyoian-pixel yyoyoian-pixel left a comment

Choose a reason for hiding this comment

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

LGTM — targets a real and subtle edge case (two assignments for the same variant in different bucket ranges). The new assignment_id assertion infrastructure via resolve token decryption is a useful addition to the spec test framework.

Optional suggestion: a complementary test with a different targeting_key that hashes into the 0-500 range (expecting a1) would fully exercise both assignments and guard against boundary bugs.

Copy link
Copy Markdown
Contributor

@vahidlazio vahidlazio left a comment

Choose a reason for hiding this comment

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

LGTM — targets a real and subtle edge case (two assignments for the same variant in different bucket ranges). The new assignment_id assertion infrastructure via resolve token decryption is a useful addition to the spec test framework.

Optional suggestion: a complementary test with a different targeting_key that hashes into the 0-500 range (expecting a1) would fully exercise both assignments and guard against boundary bugs.

@nicklasl nicklasl closed this Apr 27, 2026
@nicklasl nicklasl reopened this Apr 27, 2026
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.

3 participants