From de28b7fdcea8eb9c261e13e90fac7a8d1e31e5a3 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Mon, 6 Nov 2023 08:41:13 -0600 Subject: [PATCH] Backport of Shuffle CICD tests to spread worker load. into release/1.16.x (#19519) backport of commit b8a18c4fac7778028dd01c03783e7abf63d0e7c2 Co-authored-by: Derek Menteer --- .github/scripts/set_test_package_matrix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/set_test_package_matrix.sh b/.github/scripts/set_test_package_matrix.sh index 5608a8397..3de3f8313 100755 --- a/.github/scripts/set_test_package_matrix.sh +++ b/.github/scripts/set_test_package_matrix.sh @@ -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}"