Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Bond <danbond@protonmail.com>
  • Loading branch information
jmurret and loshz authored Apr 21, 2023
1 parent 5185c5a commit 171df26
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/test-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,12 @@ jobs:
run: |
NUM_RUNNERS=$TOTAL_RUNNERS
NUM_DIRS=$(find ./test/integration/connect/envoy -maxdepth 1 -type d | wc -l)
if [ $NUM_DIRS -lt $NUM_RUNNERS ]
then
if [ "$NUM_DIRS" -lt "$NUM_RUNNERS" ]; then
echo "TOTAL_RUNNERS is larger than the number of tests/packages to split."
NUM_RUNNERS=$NUM_DIRS
fi
# fix issue where test splitting calculation generates 1 more split than TOTAL_RUNNERS.
NUM_RUNNERS=$(($NUM_RUNNERS-1))
NUM_RUNNERS=$((NUM_RUNNERS-1))
{
echo -n "envoy-matrix="
find ./test/integration/connect/envoy -maxdepth 1 -type d -print0 \
Expand Down Expand Up @@ -276,13 +275,12 @@ jobs:
cd ./test/integration/consul-container
NUM_RUNNERS=$TOTAL_RUNNERS
NUM_DIRS=$(find ./test -maxdepth 2 -type d | wc -l)
if [ $NUM_DIRS -lt $NUM_RUNNERS ]
then
if [ "$NUM_DIRS" -lt "$NUM_RUNNERS" ]; then
echo "TOTAL_RUNNERS is larger than the number of tests/packages to split."
NUM_RUNNERS=$NUM_DIRS
fi
# fix issue where test splitting calculation generates 1 more split than TOTAL_RUNNERS.
NUM_RUNNERS=$(($NUM_RUNNERS-1))
NUM_RUNNERS=$((NUM_RUNNERS-1))
{
echo -n "compatibility-matrix="
find ./test -maxdepth 2 -type d -print0 | xargs -0 -n 1 \
Expand Down Expand Up @@ -382,13 +380,12 @@ jobs:
cd ./test/integration/consul-container/test/upgrade
NUM_RUNNERS=$TOTAL_RUNNERS
NUM_DIRS=$(go test ./... -list=. -json | jq -r '.Output | select (. !=null) | select(. | startswith("Test")) | gsub("[\\n\\t]"; "")' | wc -l)
if [ $NUM_DIRS -lt $NUM_RUNNERS ]
then
if [ "$NUM_DIRS" -lt "$NUM_RUNNERS" ]; then
echo "TOTAL_RUNNERS is larger than the number of tests/packages to split."
NUM_RUNNERS=$NUM_DIRS
fi
# fix issue where test splitting calculation generates 1 more split than TOTAL_RUNNERS.
NUM_RUNNERS=$(($NUM_RUNNERS-1))
NUM_RUNNERS=$((NUM_RUNNERS-1))
{
echo -n "upgrade-matrix="
go test ./... -list=. -json | jq -r '.Output | select (. !=null) | select(. | startswith("Test")) | gsub("[\\n\\t]"; "")' \
Expand Down

0 comments on commit 171df26

Please sign in to comment.