Backport of Shuffle CICD tests to spread worker load. into release/1.16.x (#19519)

backport of commit b8a18c4fac7778028dd01c03783e7abf63d0e7c2

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
This commit is contained in:
hc-github-team-consul-core 2023-11-06 08:41:13 -06:00 committed by GitHub
parent 9860f68703
commit de28b7fdce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -6,6 +6,6 @@ set -euo pipefail
export RUNNER_COUNT=$1 export RUNNER_COUNT=$1
# set matrix var to list of unique packages containing tests # 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}" echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"