Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Add race detector to go test flags #256

Closed
hongchaodeng opened this issue Oct 19, 2020 · 6 comments · Fixed by #266
Closed

Add race detector to go test flags #256

hongchaodeng opened this issue Oct 19, 2020 · 6 comments · Fixed by #266
Assignees
Labels
enhancement New feature or request

Comments

@hongchaodeng
Copy link
Member

We are trying to add -race to go test in OAM related projects.
We haven't figured out how to do it in the crossplane build scripts. Creating this issue to gather help.

@hongchaodeng
Copy link
Member Author

cc @jbw976 @hasheddan @negz

@jbw976
Copy link
Member

jbw976 commented Oct 19, 2020

Hi @hongchaodeng, there is a GO_TEST_FLAGS var defined in golang.mk that should help here. https://github.com/upbound/build/blob/master/makelib/golang.mk#L35

It looks like it's passed to the invocation of go test. So maybe around https://github.com/crossplane/oam-kubernetes-runtime/blob/master/Makefile#L44, you can add the following?

GO_TEST_FLAGS += -race

@wonderflow wonderflow added the good first issue Good for newcomers label Oct 20, 2020
wonderflow added a commit to wonderflow/oam-kubernetes-runtime that referenced this issue Oct 25, 2020
wonderflow added a commit to wonderflow/oam-kubernetes-runtime that referenced this issue Oct 25, 2020
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
@wonderflow wonderflow added enhancement New feature or request and removed good first issue Good for newcomers labels Oct 25, 2020
@wonderflow
Copy link
Member

@jbw976 Hi, it seems the unit test don't support race flag https://github.com/upbound/build/blob/master/makelib/golang.mk#L174

-covermode must be "atomic", not "count", when -race is enabled

How can we fix this ?

\cc @hasheddan @negz

@negz
Copy link
Member

negz commented Oct 25, 2020

I suggest opening a PR against upbound/build to make the covermode configurable. Count and atomic are similar, but count is faster when the race detector is not desired.

@wonderflow
Copy link
Member

@negz I'm not very familiar with makefile shell, could you help add that PR on upbound/build, thanks!

@wonderflow wonderflow self-assigned this Nov 6, 2020
@wonderflow
Copy link
Member

I have tried to send a PR upbound/build#125 , please help review thanks @negz

wonderflow added a commit to wonderflow/oam-kubernetes-runtime that referenced this issue Nov 11, 2020
…r legacy chart

Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
wonderflow added a commit to wonderflow/oam-kubernetes-runtime that referenced this issue Nov 11, 2020
…r legacy chart

Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
wangyikewxgm pushed a commit to wangyikewxgm/oam-kubernetes-runtime that referenced this issue May 28, 2021
…r legacy chart

Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
Signed-off-by: wangyike <wangyike.wyk@alibaba-inc.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants