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

Add -race to list when it is specified for test options #26

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

shibayu36
Copy link
Contributor

The build cache is completely different between go test and go test -race. Therefore, if you run go test and then go test -race, it will recompile.

Now gotosplit does not specify -race in go test -list even if -race is specified in the test options. Therefore, when -race is specified, go test is executed in test list creation, and go test -race is executed in test execution. As a result, the compilation is run twice.

gotesplit -total 4 -index 0 -junit-dir=build/test-results . /playground -- -race

So, in this PR, if -race is specified, change it so that -race is also specified when go test -list is used.

confirm

In addition to adding the test, I checked that the options are correct with printf debugging.

# on https://github.com/shibayu36/go-playground
$ gotesplit -total 4 -index 0 -junit-dir=build/test-results ./playground -- -race
[test -list . -race ./playground]
$ gotesplit -total 4 -index 0 -junit-dir=build/test-results ./playground
[test -list . ./playground]
$ gotesplit -total 4 -index 0 -junit-dir=build/test-results ./playground -- -p 1
[test -list . ./playground]

@Songmu Songmu merged commit 9d7c306 into Songmu:main Sep 27, 2023
3 checks passed
@github-actions github-actions bot mentioned this pull request Sep 27, 2023
@Songmu
Copy link
Owner

Songmu commented Sep 27, 2023

I see. This is small but important.

@Songmu
Copy link
Owner

Songmu commented Sep 27, 2023

Released as v0.3.1.

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