Skip to content

Commit

Permalink
Refactor env vars to be inline with go test in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Aug 17, 2023
1 parent 59c1ae6 commit b44ef43
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ jobs:
args[1]="1"
export GOMAXPROCS=1
fi
export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome
export K6_BROWSER_HEADLESS=true
go test "${args[@]}" -timeout 5m ./...
K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome K6_BROWSER_HEADLESS=true go test "${args[@]}" -timeout 5m ./...
test-tip:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -76,9 +74,7 @@ jobs:
go version
export GOMAXPROCS=2
args=("-p" "2" "-race")
export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome
export K6_BROWSER_HEADLESS=true
go test "${args[@]}" -timeout 5m ./...
K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome K6_BROWSER_HEADLESS=true go test "${args[@]}" -timeout 5m ./...
test-current-cov:
strategy:
Expand Down Expand Up @@ -106,16 +102,14 @@ jobs:
args[1]="1"
export GOMAXPROCS=1
fi
export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome
export K6_BROWSER_HEADLESS=true
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/grafana/xk6-browser | grep -v vendor || true)
if [ -n "$list" ]; then
list=$(echo "$list" | cut -f1 -d ' ' | sort -u | paste -sd, -)
fi
go test "${args[@]}" -timeout 5m --coverpkg="$list" -coverprofile=$(echo $pkg | tr / -).coverage $pkg
K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome K6_BROWSER_HEADLESS=true go test "${args[@]}" -timeout 5m --coverpkg="$list" -coverprofile=$(echo $pkg | tr / -).coverage $pkg
done
grep -h -v "^mode:" *.coverage >> coverage.txt
rm -f *.coverage
Expand Down Expand Up @@ -159,6 +153,4 @@ jobs:
go get go.k6.io/k6@master
go mod tidy
cat go.mod | grep go.k6.io/k6
export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome
export K6_BROWSER_HEADLESS=true
go test "${args[@]}" -timeout 5m ./...
K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome K6_BROWSER_HEADLESS=true go test "${args[@]}" -timeout 5m ./...

0 comments on commit b44ef43

Please sign in to comment.