Skip to content

Commit

Permalink
Backport of Shuffle CICD tests to spread worker load. into release/1.…
Browse files Browse the repository at this point in the history
…15.x (#19518)

backport of commit b8a18c4

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
  • Loading branch information
hc-github-team-consul-core and hashi-derek authored Nov 6, 2023
1 parent d477441 commit 4d648c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/scripts/set_test_package_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,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}"

0 comments on commit 4d648c8

Please sign in to comment.