Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test case name hashing should consider tags and class name too #2304

Closed
horenmar opened this issue Oct 15, 2021 · 2 comments · Fixed by #2394
Closed

Test case name hashing should consider tags and class name too #2304

horenmar opened this issue Oct 15, 2021 · 2 comments · Fixed by #2394
Labels
Bug Good First Issue

Comments

@horenmar
Copy link
Member

@horenmar horenmar commented Oct 15, 2021

Describe the bug
Recently I changed the "unique test case" criteria to allow test cases with same name, but different tags, or same names and tags but different class name (when a test case hangs off a type).

However, we also hash test cases when ordering them randomly (to get subset-stable ordering), and the hashing currently only considers test case name, which means that hash collisions are now much more realistic (in fact the collision is guaranteed if two test cases have same name, which is a desired property by some users).

Note that this doesn't break the subset invariant, because we use the ordering of test case infos to break ties, which handles tags and class name properly

Expected behavior
To fix this, the hasher should also consider tags and class name.

Additional context
This change also makes the hasher complex enough that it should be promoted to a header and receive direct unit tests.

@horenmar horenmar added Bug Good First Issue labels Oct 15, 2021
@MohamedAlaa201
Copy link

@MohamedAlaa201 MohamedAlaa201 commented Mar 14, 2022

I am happy to work on this.

@horenmar
Copy link
Member Author

@horenmar horenmar commented Mar 14, 2022

@MohamedAlaa201 Sure, go for it.

horenmar pushed a commit that referenced this issue Mar 31, 2022
Test case hashing includes tags and class name

As the hasher involves more code now, it was split out into its own file
and it got its own set of tests.

Closes #2304
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Good First Issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants