Skip to content

Commit

Permalink
Shuffle CICD tests to spread worker load. (#19501)
Browse files Browse the repository at this point in the history
  • Loading branch information
hashi-derek authored Nov 6, 2023
1 parent 6f4e037 commit 395d32e
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 @@ -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}"

0 comments on commit 395d32e

Please sign in to comment.