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

builders/gentestmain: register correct cover mode in the coverage report file when enabling race mode #3019

Merged
merged 1 commit into from
Nov 30, 2021

Conversation

lbcjbb
Copy link
Contributor

@lbcjbb lbcjbb commented Nov 28, 2021

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

Fix the cover mode to "atomic" in the coverage data file when the race detector is used.

Which issues(s) does this PR fix?

Fixes #3018

@google-cla google-cla bot added the cla: yes label Nov 28, 2021
Copy link
Member

@achew22 achew22 left a comment

Choose a reason for hiding this comment

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

Thanks so much for putting in a quick fix to an issue you discovered, @lbcjbb! I'm not going to merge this because I think @linzhp would probably enjoy taking a look at it. If they don't get around to it by Tuesday afternoon, please ping this PR and I'll merge it for you as is.

@lbcjbb
Copy link
Contributor Author

lbcjbb commented Nov 28, 2021

No problem. It's not critic, take a look when you can.

Blocks: map[string][]testing.CoverBlock{},
}
// Contains all coverage data for the program.
var (
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this change is necessary. Can you keep Cover as testing.Cover without setting Mode and CoveredPackages? You can set coverdata.Cover.Mode in generate_test_main.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not necessary, but preferred IMHO, to avoid to manipulate an incomplete object which could be a source of mistake, even more when the object is exported in another package.

@linzhp linzhp merged commit ba96c81 into bazelbuild:master Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cover mode is incorrect in the coverage data file when enabling -race mode
3 participants