From acfd7d74a8d408f73338a5bda6640c8172d77679 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Mon, 24 Apr 2023 17:19:50 -0700 Subject: [PATCH] Backport of ci: fix runner calculation to exclude the top level directory as part of the calculation into release/1.15.x (#17111) * backport of commit 07d9aeb85182d87bfbf18d7609ca8f093a186994 * backport of commit 0c0a33928af2b9f01d42935871d6090f15de4036 * 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 --------- Co-authored-by: John Murret 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 2b1c26da14..818ffa098f 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -159,10 +159,11 @@ 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/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." - 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)) @@ -274,10 +275,11 @@ jobs: run: | cd ./test/integration/consul-container NUM_RUNNERS=$TOTAL_RUNNERS - NUM_DIRS=$(find ./test -maxdepth 2 -type d | wc -l) + 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." - 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)) @@ -381,9 +383,10 @@ 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 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))