From f5e0f55f8ba862947d2ff68e614e954472cfcaff Mon Sep 17 00:00:00 2001 From: John Murret Date: Fri, 21 Apr 2023 21:59:52 +0000 Subject: [PATCH 1/3] backport of commit 07d9aeb85182d87bfbf18d7609ca8f093a186994 --- .github/workflows/test-integrations.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 816034e5fbd5..c1c2f97ddcee 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -159,10 +159,14 @@ jobs: JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' run: | NUM_RUNNERS=$TOTAL_RUNNERS - NUM_DIRS=$(find ./test/integration/connect/envoy -maxdepth 1 -type d | wc -l) + NUM_DIRS=$(find ./test -maxdepth 2 -type d | wc -l) + + #remove on for the top level directory + NUM_DIRS=$((NUM_DIRS-1)) + if [ "$NUM_DIRS" -lt "$NUM_RUNNERS" ]; then echo "TOTAL_RUNNERS is larger than the number of tests/packages to split." - NUM_RUNNERS=$NUM_DIRS + NUM_RUNNERS=$((NUM_DIRS-1)) fi # fix issue where test splitting calculation generates 1 more split than TOTAL_RUNNERS. NUM_RUNNERS=$((NUM_RUNNERS-1)) @@ -382,10 +386,14 @@ jobs: run: | 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) + NUM_DIRS=$(find ./test -maxdepth 2 -type d | wc -l) + + #remove on for the top level directory + NUM_DIRS=$((NUM_DIRS-1)) + if [ "$NUM_DIRS" -lt "$NUM_RUNNERS" ]; then echo "TOTAL_RUNNERS is larger than the number of tests/packages to split." - NUM_RUNNERS=$NUM_DIRS + NUM_RUNNERS=$((NUM_DIRS-1)) fi # fix issue where test splitting calculation generates 1 more split than TOTAL_RUNNERS. NUM_RUNNERS=$((NUM_RUNNERS-1)) From 1ca6ce6ddb5ac91efa3c1585bcdd56604c5693ee Mon Sep 17 00:00:00 2001 From: John Murret Date: Fri, 21 Apr 2023 22:24:44 +0000 Subject: [PATCH 2/3] backport of commit 0c0a33928af2b9f01d42935871d6090f15de4036 --- .github/workflows/test-integrations.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index c1c2f97ddcee..c5dc62f87c6b 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -159,7 +159,7 @@ jobs: JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' run: | NUM_RUNNERS=$TOTAL_RUNNERS - NUM_DIRS=$(find ./test -maxdepth 2 -type d | wc -l) + NUM_DIRS=$(find ./test/integration/connect/envoy -maxdepth 1 -type d | wc -l) #remove on for the top level directory NUM_DIRS=$((NUM_DIRS-1)) @@ -386,11 +386,8 @@ jobs: run: | cd ./test/integration/consul-container/test/upgrade NUM_RUNNERS=$TOTAL_RUNNERS - NUM_DIRS=$(find ./test -maxdepth 2 -type d | wc -l) + NUM_DIRS=$(go test ./... -list=. -json | jq -r '.Output | select (. !=null) | select(. | startswith("Test")) | gsub("[\\n\\t]"; "")' | wc -l) - #remove on for the top level directory - NUM_DIRS=$((NUM_DIRS-1)) - if [ "$NUM_DIRS" -lt "$NUM_RUNNERS" ]; then echo "TOTAL_RUNNERS is larger than the number of tests/packages to split." NUM_RUNNERS=$((NUM_DIRS-1)) From 7f7f55ed012dd9f84e83d250a3bcc0f5bba9fa49 Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 24 Apr 2023 14:25:57 -0600 Subject: [PATCH 3/3] ci: fix runner calculation to exclude the top level directory as part of the calculation (#17090) * fix runner calculation to exclude the top level directory as part of the calculation * fix the logic for generating the directories/functions * De-scope tenenacy requirements to OSS only for now. (#17087) Partition and namespace must be "default" Peername must be "local" * Fix virtual services being included in intention topology as downstreams. (#17099) * Merge pull request #5200 from hashicorp/NET-3758 (#17102) * Merge pull request #5200 from hashicorp/NET-3758 NET-3758: connect: update supported envoy versions to 1.26.0 * lint * CI: remove uneeded AWS creds from test-integrations (#17104) * Update test-integrations.yml * removing permission lies now that vault is not used in this job. --------- Co-authored-by: John Murret * update based on feedback --------- Co-authored-by: Semir Patel Co-authored-by: Derek Menteer <105233703+hashi-derek@users.noreply.github.com> Co-authored-by: Anita Akaeze Co-authored-by: Dan Bond --- .github/workflows/test-integrations.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index c5dc62f87c6b..401b3302b18d 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -159,10 +159,7 @@ jobs: JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' run: | NUM_RUNNERS=$TOTAL_RUNNERS - NUM_DIRS=$(find ./test/integration/connect/envoy -maxdepth 1 -type d | wc -l) - - #remove on for the top level directory - NUM_DIRS=$((NUM_DIRS-1)) + NUM_DIRS=$(find ./test/integration/connect/envoy -mindepth 1 -maxdepth 1 -type d | wc -l) if [ "$NUM_DIRS" -lt "$NUM_RUNNERS" ]; then echo "TOTAL_RUNNERS is larger than the number of tests/packages to split." @@ -277,10 +274,7 @@ jobs: run: | cd ./test/integration/consul-container NUM_RUNNERS=$TOTAL_RUNNERS - NUM_DIRS=$(find ./test -maxdepth 2 -type d | wc -l) - - #remove on for the top level directory - NUM_DIRS=$((NUM_DIRS-1)) + NUM_DIRS=$(find ./test -mindepth 1 -maxdepth 2 -type d | wc -l) if [ "$NUM_DIRS" -lt "$NUM_RUNNERS" ]; then echo "TOTAL_RUNNERS is larger than the number of tests/packages to split."