Skip to content

Commit

Permalink
chore: disable race detector on 32-bit
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Henderson <[email protected]>
  • Loading branch information
hairyhenderson committed Jun 23, 2024
1 parent c5ddd52 commit 2ed9108
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
- platform: ubuntu-latest
go: 1.19.x
goarch: '386'
# whether to enable the race detector - defaults to true
enable_race: 'false'
- platform: ubuntu-latest
go: 1.19.x
goarch: 'amd64'
- platform: macos-latest
go: 1.19.x
- platform: windows-latest
Expand All @@ -38,7 +43,7 @@ jobs:
with:
go-version: ${{ matrix.go }}
- name: Test
run: make test
run: make test ENABLE_RACE=${{ matrix.enable_race }}
env:
GOARCH: ${{ matrix.goarch }}
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ BROWSERTEST_VERSION = v0.7
LINT_VERSION = 1.50.1
GO_BIN = $(shell printf '%s/bin' "$$(go env GOPATH)")
SHELL = bash
ENABLE_RACE = true

.PHONY: all
all: lint test
Expand Down Expand Up @@ -31,14 +32,18 @@ test-deps:
fi
@go install github.com/mattn/[email protected]

ifeq ($(ENABLE_RACE),true)
TEST_ARGS=-race
endif

.PHONY: test
test: test-deps
go test . # Run library-level checks first, for more helpful build tag failure messages.
go test -race -coverprofile=native-cover.out ./...
go test $(TEST_ARGS) -coverprofile=native-cover.out ./...
if [[ "$$CI" != true || $$(uname -s) == Linux ]]; then \
set -ex; \
GOOS=js GOARCH=wasm go test -coverprofile=js-cover.out -covermode=atomic ./...; \
cd examples && go test -race ./...; \
cd examples && go test $(TEST_ARGS) ./...; \
fi
{ echo 'mode: atomic'; cat *-cover.out | grep -v '^mode:'; } > cover.out && rm *-cover.out
go tool cover -func cover.out | grep total:
Expand Down

0 comments on commit 2ed9108

Please sign in to comment.