Skip to content

Commit 416a38f

Browse files
committed
Revert runner changes, run unit tests without -race
1 parent 1c6d342 commit 416a38f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/darwin-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
runs-on: ${{ matrix.OS }}
3232
strategy:
3333
matrix:
34-
# TODO: Add support for ARM runners: https://github.com/actions/runner-images?tab=readme-ov-file#available-images
35-
OS: [ "macos-13", "macos-14-large" ]
34+
# The "macos-13-xlarge" runner is arm64: https://github.com/actions/runner-images/issues/8439
35+
OS: [ "macos-13", "macos-13-xlarge", "macos-14", "macos-15" ]
3636
steps:
3737
- name: Check out the codebase.
3838
uses: actions/checkout@v4
@@ -51,7 +51,7 @@ jobs:
5151
make install-tools
5252
mkdir -p unit-test-results/junit
5353
trap "go-junit-report -set-exit-code < unit-test-results/go-unit-tests.out > unit-test-results/junit/results.xml" EXIT
54-
make for-all CMD="make test" | tee unit-test-results/go-unit-tests.out
54+
make for-all CMD="make test-without-race" | tee unit-test-results/go-unit-tests.out
5555
5656
- name: Uploading artifacts
5757
uses: actions/upload-artifact@v4

Makefile.Common

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ COVER_PKGS := $(shell go list ./... | tr "\n" ",")
2929
# build tags required by any component should be defined as an independent variables and later added to GO_BUILD_TAGS below
3030
GO_BUILD_TAGS=""
3131
GOTEST_OPT?= -race -v -timeout 180s --tags=$(GO_BUILD_TAGS)
32+
GOTEST_OPT_WITHOUT_RACE?= -v -timeout 180s --tags=$(GO_BUILD_TAGS)
3233
GOCMD?= go
3334
GOTEST=$(GOCMD) test
3435
GOOS=$(shell $(GOCMD) env GOOS)
@@ -82,6 +83,13 @@ test-with-codecov:
8283
mkdir -p $(PWD)/coverage/unit
8384
$(GOTEST) $(GOTEST_OPT) ./... -cover -covermode=atomic -coverpkg $(COVER_PKGS) -args -test.gocoverdir="$(PWD)/coverage/unit"
8485

86+
# Currently, running CGO_ENABLED=0 go test -race is broken in gopsutil/v4
87+
# This target should be removed in favor of "test" once the following issue is resolved:
88+
# https://github.com/shirou/gopsutil/issues/1774
89+
.PHONY: test-without-race
90+
test-without-race:
91+
$(GOTEST) $(GOTEST_OPT_WITHOUT_RACE) $(ALL_PKG_DIRS)
92+
8593
.PHONY: addlicense
8694
addlicense:
8795
@ADDLICENCESEOUT=`$(ADDLICENCESE) -y "" -c 'Splunk, Inc.' $(ALL_SRC) 2>&1`; \

0 commit comments

Comments
 (0)