Skip to content

Commit

Permalink
build with race for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
df-wg committed Jan 30, 2025
1 parent 6addbd3 commit 1ce7845
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion router-tests/testenv/testexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func buildRouterBin(t *testing.T, ctx context.Context) {
buildOnce.Do(func() {
t.Log("Building router binary...")

cmd := exec.Command("make", "build")
cmd := exec.Command("make", "build-race")
cmd.Dir = routerDir
runCmdWithLogs(t, ctx, cmd, true) // Run the build command

Expand Down
3 changes: 3 additions & 0 deletions router/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ COMMIT?=$(shell git rev-parse HEAD)
build:
CGO_ENABLED=0 go build -trimpath -ldflags "-extldflags -static -X github.com/wundergraph/cosmo/router/core.Version=$(VERSION) -X github.com/wundergraph/cosmo/router/core.Date=$(DATE) -X github.com/wundergraph/cosmo/router/core.Commit=$(COMMIT)" -a -o router cmd/router/main.go

build-race:
CGO_ENABLED=0 go build -trimpath -race -ldflags "-extldflags -static -X github.com/wundergraph/cosmo/router/core.Version=$(VERSION) -X github.com/wundergraph/cosmo/router/core.Date=$(DATE) -X github.com/wundergraph/cosmo/router/core.Commit=$(COMMIT)" -a -o router cmd/router/main.go

build-custom:
CGO_ENABLED=0 go build -trimpath -ldflags "-extldflags -static -X github.com/wundergraph/cosmo/router/core.Version=$(VERSION) -X github.com/wundergraph/cosmo/router/core.Date=$(DATE) -X github.com/wundergraph/cosmo/router/core.Commit=$(COMMIT)" -a -o router cmd/custom/main.go

Expand Down

0 comments on commit 1ce7845

Please sign in to comment.