Skip to content

Commit

Permalink
Also run coverage tests on Windows with less concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Oct 1, 2020
1 parent b21e13f commit a384ab1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ jobs:
set -x
go version
export GOMAXPROCS=2
args=("-p" "2" "-race")
args=("-race")
# Run with less concurrency on Windows to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* ]]; then
args[1]="1"
unset args[2]
unset args[0]
export GOMAXPROCS=1
fi
go test "${args[@]}" -timeout 800s ./...
Expand All @@ -102,14 +101,20 @@ jobs:
run: |
go version
export GOMAXPROCS=2
args=("-race")
# Run with less concurrency on Windows to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* ]]; then
unset args[0]
export GOMAXPROCS=1
fi
echo "mode: set" > coverage.txt
for pkg in $(go list ./... | grep -v vendor); do
list=$(go list -test -f '{{ join .Deps "\n"}}' $pkg | grep github.com/loadimpact/k6 | grep -v vendor || true)
if [ -n "$list" ]; then
list=$(echo "$list" | cut -f1 -d ' ' | sort -u | paste -sd, -)
fi
go test -race -timeout 800s --coverpkg="$list" -coverprofile=$(echo $pkg | tr / -).coverage $pkg
go test "${args[@]}" -timeout 800s --coverpkg="$list" -coverprofile=$(echo $pkg | tr / -).coverage $pkg
done
grep -h -v "^mode:" *.coverage >> coverage.txt
rm -f *.coverage
Expand Down

0 comments on commit a384ab1

Please sign in to comment.