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

Fix EntryForRegistry code coverage randomization #36

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

tianon
Copy link
Member

@tianon tianon commented Mar 25, 2024

I hate this, but golang/go#61900 might someday make it slightly cleaner.

See #32 (comment):

Because our iteration order is random, sometimes we get coverage on this first continue and sometimes we do not! (and the function is small enough that this actually affects the overall percentage by like 9.1%!)

@tianon tianon requested a review from yosifkit as a code owner March 25, 2024 21:48
@tianon
Copy link
Member Author

tianon commented Mar 25, 2024

Nice, and because "" sorts above everything else, we end up with the "good" case where the continue is included in our coverage. 👍

@tianon
Copy link
Member Author

tianon commented Mar 25, 2024

github.com/docker-library/meta-scripts/registry/client.go:135: EntryForRegistry 81.8% (main)

vs

github.com/docker-library/meta-scripts/registry/client.go:136: EntryForRegistry 86.7% (this PR)

@tianon
Copy link
Member Author

tianon commented Mar 25, 2024

I think it's only a ~5% increase (instead of ~9%) because of all the lines this adds lolsob

@tianon tianon merged commit d54fee8 into docker-library:main Mar 26, 2024
1 check passed
@tianon tianon deleted the random-maps branch March 26, 2024 00:27
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.

2 participants