mirror of https://github.com/hashicorp/consul
Backport of Shuffle CICD tests to spread worker load. into release/1.17.x (#19520)
backport of commit b8a18c4fac
Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
pull/19523/head
parent
3e0240caba
commit
b0d25d7909
|
@ -6,6 +6,6 @@ set -euo pipefail
|
|||
export RUNNER_COUNT=$1
|
||||
|
||||
# set matrix var to list of unique packages containing tests
|
||||
matrix="$(go list -json="ImportPath,TestGoFiles" ./... | jq --compact-output '. | select(.TestGoFiles != null) | .ImportPath' | jq --slurp --compact-output '.' | jq --argjson runnercount $RUNNER_COUNT -cM '[_nwise(length / $runnercount | floor)]'))"
|
||||
matrix="$(go list -json="ImportPath,TestGoFiles" ./... | jq --compact-output '. | select(.TestGoFiles != null) | .ImportPath' | shuf | jq --slurp --compact-output '.' | jq --argjson runnercount $RUNNER_COUNT -cM '[_nwise(length / $runnercount | floor)]'))"
|
||||
|
||||
echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
|
||||
|
|
Loading…
Reference in New Issue