Skip to content

Commit

Permalink
[#151] Fix Go toolchains to force building test files during TCR buil…
Browse files Browse the repository at this point in the history
…d phase
  • Loading branch information
mengdaming committed Oct 14, 2022
1 parent 0ff1f4e commit 710e207
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tcr-engine/testdata/go/.tcr/toolchain/go-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
- os: [ darwin, linux, windows ]
arch: [ "386", amd64, arm64 ]
command: go
arguments: [ build, ./... ]
arguments: [ test, "-count=0", ./... ]
test:
- os: [ darwin, linux, windows ]
arch: [ "386", amd64, arm64 ]
Expand Down
2 changes: 1 addition & 1 deletion tcr-engine/testdata/go/.tcr/toolchain/gotestsum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
- os: [ darwin, linux, windows ]
arch: [ "386", amd64, arm64 ]
command: go
arguments: [ build, ./... ]
arguments: [ test, "-count=0", ./... ]
test:
- os: [ darwin, linux, windows ]
arch: [ "386", amd64, arm64 ]
Expand Down
2 changes: 1 addition & 1 deletion tcr-engine/testdata/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

.PHONY: build
build:
@go build ./...
@go test -count=0 ./...

.PHONY: test
test:
Expand Down
2 changes: 1 addition & 1 deletion tcr-engine/toolchain/go_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
Os: GetAllOsNames(),
Arch: GetAllArchNames(),
Path: "go",
Arguments: []string{"build", "./..."},
Arguments: []string{"test", "-count=0", "./..."},
}},
testCommands: []Command{{
Os: GetAllOsNames(),
Expand Down
2 changes: 1 addition & 1 deletion tcr-engine/toolchain/go_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func Test_go_tools_toolchain_build_command_path(t *testing.T) {
}

func Test_go_tools_toolchain_build_command_args(t *testing.T) {
assertBuildCommandArgs(t, []string{"build", "./..."}, goToolchainName)
assertBuildCommandArgs(t, []string{"test", "-count=0", "./..."}, goToolchainName)
}

func Test_go_tools_toolchain_test_command_path(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tcr-engine/toolchain/gotestsum.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
Os: GetAllOsNames(),
Arch: GetAllArchNames(),
Path: "go",
Arguments: []string{"build", "./..."},
Arguments: []string{"test", "-count=0", "./..."},
}},
testCommands: []Command{{
Os: GetAllOsNames(),
Expand Down
2 changes: 1 addition & 1 deletion tcr-engine/toolchain/gotestsum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func Test_gotestsum_toolchain_build_command_path(t *testing.T) {
}

func Test_gotestsum_toolchain_build_command_args(t *testing.T) {
assertBuildCommandArgs(t, []string{"build", "./..."}, gotestsumToolchainName)
assertBuildCommandArgs(t, []string{"test", "-count=0", "./..."}, gotestsumToolchainName)
}

func Test_gotestsum_toolchain_test_command_path(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tools/.tcr/toolchain/go-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
- os: [ darwin, linux, windows ]
arch: [ "386", amd64, arm64 ]
command: go
arguments: [ build, ./... ]
arguments: [ test, "-count=0", ./... ]
test:
- os: [ darwin, linux, windows ]
arch: [ "386", amd64, arm64 ]
Expand Down
2 changes: 1 addition & 1 deletion tools/.tcr/toolchain/gotestsum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
- os: [ darwin, linux, windows ]
arch: [ "386", amd64, arm64 ]
command: go
arguments: [ build, ./... ]
arguments: [ test, "-count=0", ./... ]
test:
- os: [ darwin, linux, windows ]
arch: [ "386", amd64, arm64 ]
Expand Down

0 comments on commit 710e207

Please sign in to comment.