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
…16.x (#19519)

backport of commit b8a18c4

Co-authored-by: Derek Menteer <[email protected]>
  • Loading branch information
hc-github-team-consul-core and hashi-derek authored Nov 6, 2023
1 parent 7d518fe commit 1d14d5a
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 1d14d5a

Please sign in to comment.