Skip to content

Commit

Permalink
only run race detector on linux
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Cragun <me@ryan.ec>
  • Loading branch information
ryancragun committed Feb 1, 2022
1 parent de4da91 commit 9f8475a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ commands:
type: string
platform:
type: string
test-args:
type: string
default: "-race -p 2"
steps:
- run:
name: "Run go tests"
command: |
PACKAGE_NAMES=$(go list ./... | circleci tests split --split-by=timings --timings-type=classname)
echo "Running $(echo $PACKAGE_NAMES | wc -w) packages"
echo $PACKAGE_NAMES
<< parameters.cmd >> --format=short-verbose --junitfile $TEST_RESULTS_DIR/hcl2/gotestsum-report.xml -- -race -p 2 -cover -coverprofile=<< parameters.platform >>_cov_$CIRCLE_NODE_INDEX.part $PACKAGE_NAMES
<< parameters.cmd >> --format=short-verbose --junitfile $TEST_RESULTS_DIR/hcl2/gotestsum-report.xml -- << parameters.test-args >> -cover -coverprofile=<< parameters.platform >>_cov_$CIRCLE_NODE_INDEX.part $PACKAGE_NAMES
jobs:
go-checks:
Expand Down Expand Up @@ -147,6 +150,7 @@ jobs:
- run-gotests:
cmd: "./gotestsum.exe"
platform: "win"
test-args: "-p 2"

# save coverage report parts
- persist_to_workspace:
Expand Down

0 comments on commit 9f8475a

Please sign in to comment.