From 29b60d55a912b6c7e4009aab031b8f94bd85468d Mon Sep 17 00:00:00 2001 From: John Murret Date: Fri, 7 Apr 2023 15:13:22 -0600 Subject: [PATCH 01/22] add test-integrations workflow --- .github/workflows/test-integrations.yml | 379 ++++++++++++++++++++++++ 1 file changed, 379 insertions(+) create mode 100644 .github/workflows/test-integrations.yml diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml new file mode 100644 index 000000000000..c8657cebadca --- /dev/null +++ b/.github/workflows/test-integrations.yml @@ -0,0 +1,379 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +name: test-integrations + +on: + pull_request: + branches-ignore: + - stable-website + - 'docs/**' + - 'ui/**' + - 'mktg-**' # Digital Team Terraform-generated branch prefix + - 'backport/docs/**' + - 'backport/ui/**' + - 'backport/mktg-**' + +env: + TEST_RESULTS_DIR: /tmp/test-results + TEST_RESULTS_ARTIFACT_NAME: test-results + CONSUL_LICENSE: ${{ secrets.CONSUL_LICENSE }} + GOTAGS: ${{ endsWith(github.repository, '-enterprise') && 'consulent' || '' }} + +jobs: + setup: + runs-on: ubuntu-latest + name: Setup + outputs: + compute-small: ${{ steps.runners.outputs.compute-small }} + compute-medium: ${{ steps.runners.outputs.compute-medium }} + compute-large: ${{ steps.runners.outputs.compute-large }} + compute-xl: ${{ steps.runners.outputs.compute-xl }} + enterprise: ${{ steps.runners.outputs.enterprise }} + steps: + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + - id: runners + run: .github/scripts/get_runner_classes.sh + + generate-envoy-job-matrices: + needs: [setup] + runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} + name: Generate Envoy Job Matrices + outputs: + envoy-matrix: ${{ steps.set-matrix.outputs.envoy-matrix }} + steps: + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + - name: Generate Envoy Job Matrix + id: set-matrix + env: + # this is further going to multiplied in envoy-integration tests by the + # other dimensions in the matrix. Currently TOTAL_RUNNERS would be + # multiplied by 8 based on these values: + # envoy-version: ["1.22.7", "1.23.4", "1.24.2", "1.25.1"] + # xds-target: ["server", "client"] + TOTAL_RUNNERS: 3 + JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' + run: | + { + echo -n "envoy-matrix=" + find ./test/integration/connect/envoy -maxdepth 1 -type d -print0 \ + | xargs -0 -n 1 basename \ + | jq --raw-input --argjson runnercount "$TOTAL_RUNNERS" "$JQ_SLICER" \ + | jq --compact-output 'map(join("|"))' + } >> "$GITHUB_OUTPUT" + cat "$GITHUB_OUTPUT" + + dev-build: + needs: [setup] + uses: ./.github/workflows/reusable-dev-build.yml + with: + runs-on: ${{ needs.setup.outputs.compute-xl }} + repository-name: ${{ github.repository }} + uploaded-binary-name: 'consul-bin' + secrets: + elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} + + nomad-integration-test: + runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }} + needs: + - setup + - dev-build + strategy: + matrix: + nomad-version: ['v1.3.3', 'v1.2.10', 'v1.1.16'] + steps: + - name: Setup gotestsum + uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + with: + gotestsum_version: 1.9.0 + - name: Checkout Nomad + uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + with: + repository: hashicorp/nomad + ref: ${{ matrix.nomad-version }} + + - name: Install Go + uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + with: + go-version-file: 'go.mod' + + - name: Fetch Consul binary + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: 'consul-bin' + path: ./bin + - name: Restore Consul permissions + run: | + chmod +x ./bin/consul + echo "$(pwd)/bin" >> $GITHUB_PATH + + - name: Make Nomad dev build + run: make pkg/linux_amd64/nomad + + - name: Run integration tests + run: | + gotestsum \ + --format=short-verbose \ + --rerun-fails \ + --rerun-fails-report=/tmp/gotestsum-rerun-fails \ + --packages="./command/agent/consul" \ + --junitfile $TEST_RESULTS_DIR/results.xml -- \ + -run TestConsul + + vault-integration-test: + runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }} + needs: + - setup + - dev-build + strategy: + matrix: + vault-version: ["1.12.2", "1.11.6", "1.10.9", "1.9.10"] + env: + VAULT_BINARY_VERSION: ${{ matrix.vault-version }} + steps: + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + + # NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos. + - name: Setup Git + if: ${{ endsWith(github.repository, '-enterprise') }} + run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" + + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + with: + go-version-file: 'go.mod' + + - uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + with: + gotestsum_version: 1.9.0 + + - name: Install Vault + run: | + wget -q -O /tmp/vault.zip "https://releases.hashicorp.com/vault/${{ env.VAULT_BINARY_VERSION }}/vault_${{ env.VAULT_BINARY_VERSION }}_linux_amd64.zip" + unzip -d /tmp /tmp/vault.zip + echo "/tmp" >> $GITHUB_PATH + + - name: Run Connect CA Provider Tests + run: | + mkdir -p "${{ env.TEST_RESULTS_DIR }}" + make test-connect-ca-providers + + envoy-integration-test: + runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} + permissions: + id-token: write # NOTE: this permission is explicitly required for Vault auth. + contents: read + needs: + - setup + - generate-envoy-job-matrices + - dev-build + strategy: + fail-fast: false + matrix: + envoy-version: ["1.22.7", "1.23.4", "1.24.2", "1.25.1"] + xds-target: ["server", "client"] + test-cases: ${{ fromJSON(needs.generate-envoy-job-matrices.outputs.envoy-matrix) }} + env: + ENVOY_VERSION: ${{ matrix.envoy-version }} + XDS_TARGET: ${{ matrix.xds-target }} + AWS_LAMBDA_REGION: us-west-2 + steps: + # NOTE: ENT specific step as we store secrets in Vault. + - name: Authenticate to Vault + if: ${{ endsWith(github.repository, '-enterprise') }} + id: vault-auth + run: vault-auth + + # NOTE: ENT specific step as we store secrets in Vault. + - name: Fetch Secrets + if: ${{ endsWith(github.repository, '-enterprise') }} + id: secrets + uses: hashicorp/vault-action@v2.5.0 + with: + url: ${{ steps.vault-auth.outputs.addr }} + caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }} + token: ${{ steps.vault-auth.outputs.token }} + secrets: | + kv/data/github/${{ github.repository }}/aws arn | AWS_ROLE_ARN ; + + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + with: + go-version-file: 'go.mod' + - name: Setup gotestsum + uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + with: + gotestsum_version: 1.9.0 + + - name: fetch binary + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: 'consul-bin' + path: ./bin + - name: restore mode+x + run: chmod +x ./bin/consul + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1 + + - name: Docker build + run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile ./bin + + - name: Envoy Integration Tests + env: + GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml + GOTESTSUM_FORMAT: standard-verbose + COMPOSE_INTERACTIVE_NO_CLI: 1 + LAMBDA_TESTS_ENABLED: "true" + # tput complains if this isn't set to something. + TERM: ansi + run: | + # shellcheck disable=SC2001 + echo "Running $(sed 's,|, ,g' <<< "${{ matrix.test-cases }}" |wc -w) subtests" + # shellcheck disable=SC2001 + sed 's,|,\n,g' <<< "${{ matrix.test-cases }}" + gotestsum \ + --debug \ + --rerun-fails \ + --rerun-fails-report=/tmp/gotestsum-rerun-fails \ + --jsonfile /tmp/jsonfile/go-test.log \ + --packages=./test/integration/connect/envoy \ + -- -timeout=30m -tags integration -run="TestEnvoy/(${{ matrix.test-cases }})" + + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: container-logs + path: ./test/integration/connect/envoy/workdir/logs + + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: ${{ env.TEST_RESULTS_ARTIFACT_NAME }} + path: ${{ env.TEST_RESULTS_DIR }} + + compatibility-integration-test: + runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} + needs: + - setup + - dev-build + steps: + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + with: + go-version-file: 'go.mod' + - name: Setup gotestsum + uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + with: + gotestsum_version: 1.9.0 + + # Build the consul:local image from the already built binary + - name: fetch binary + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: 'consul-bin' + path: . + - name: restore mode+x + run: chmod +x consul + + - name: Build consul:local image + run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile . + - name: Compatibility Integration Tests + run: | + mkdir -p "${{ env.TEST_RESULTS_DIR }}" + cd ./test/integration/consul-container + docker run --rm consul:local consul version + # shellcheck disable=SC2046 + gotestsum \ + --raw-command \ + --format=short-verbose \ + --debug \ + --rerun-fails=3 \ + --packages="./..." \ + -- \ + go test \ + -p=4 \ + -tags "${{ env.GOTAGS }}" \ + -timeout=30m \ + -json \ + $(go list ./... | grep -v upgrade) \ + --target-image consul \ + --target-version local \ + --latest-image consul \ + --latest-version latest + ls -lrt + env: + # this is needed because of incompatibility between RYUK container and circleci + GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml + GOTESTSUM_FORMAT: standard-verbose + COMPOSE_INTERACTIVE_NO_CLI: 1 + # tput complains if this isn't set to something. + TERM: ansi + + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: ${{ env.TEST_RESULTS_ARTIFACT_NAME }} + path: ${{ env.TEST_RESULTS_DIR }} + + upgrade-integration-test: + runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} + needs: + - setup + - dev-build + strategy: + matrix: + consul-version: [ "1.14", "1.15"] + env: + CONSUL_VERSION: ${{ matrix.consul-version }} + steps: + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + with: + go-version-file: 'go.mod' + - name: Setup gotestsum + uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + with: + gotestsum_version: 1.9.0 + + # Get go binary from workspace + - name: fetch binary + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: 'consul-bin' + path: . + - name: restore mode+x + run: chmod +x consul + - name: Build consul:local image + run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile . + - name: Upgrade Integration Tests + run: | + mkdir -p "${{ env.TEST_RESULTS_DIR }}" + cd ./test/integration/consul-container/test/upgrade + docker run --rm consul:local consul version + PACKAGE_NAMES=$(go list -tags "${{ env.GOTAGS }}" ./...) + gotestsum \ + --raw-command \ + --format=short-verbose \ + --debug \ + --rerun-fails=3 \ + --packages="${PACKAGE_NAMES}" \ + -- \ + go test \ + -p=8 \ + -tags "${{ env.GOTAGS }}" \ + -timeout=30m \ + -json \ + ./... \ + --target-image consul \ + --target-version local \ + --latest-image consul \ + --latest-version "$CONSUL_VERSION" + ls -lrt + env: + # this is needed because of incompatibility between RYUK container and circleci + GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml + GOTESTSUM_FORMAT: standard-verbose + COMPOSE_INTERACTIVE_NO_CLI: 1 + # tput complains if this isn't set to something. + TERM: ansi + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: ${{ env.TEST_RESULTS_ARTIFACT_NAME }} + path: ${{ env.TEST_RESULTS_DIR }} From 670e4f6fbb4aa7da0c6701b5c619a392d50ba7de Mon Sep 17 00:00:00 2001 From: John Murret Date: Fri, 7 Apr 2023 15:51:11 -0600 Subject: [PATCH 02/22] add test-integrations success job --- .github/workflows/test-integrations.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index c8657cebadca..e64bb9b051e3 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -377,3 +377,21 @@ jobs: with: name: ${{ env.TEST_RESULTS_ARTIFACT_NAME }} path: ${{ env.TEST_RESULTS_DIR }} + + test-integrations-success: + needs: + - setup + - generate-envoy-job-matrices + - dev-build + - nomad-integration-test + - vault-integration-test + - envoy-integration-test + - compatibility-integration-test + - upgrade-integration-test + runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} + if: | + (always() && ! cancelled()) && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + steps: + - run: echo "test-integrations succeeded" From 50e563549e01a7d08d90edb2db3657ef0e5ba5bc Mon Sep 17 00:00:00 2001 From: John Eikenberry Date: Mon, 10 Apr 2023 22:38:44 +0000 Subject: [PATCH 03/22] update vault integration testing versions (#16949) --- .github/workflows/test-integrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index e64bb9b051e3..c6a50a08194e 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -127,7 +127,7 @@ jobs: - dev-build strategy: matrix: - vault-version: ["1.12.2", "1.11.6", "1.10.9", "1.9.10"] + vault-version: ["1.13.1", "1.12.5", "1.11.9", "1.10.11"] env: VAULT_BINARY_VERSION: ${{ matrix.vault-version }} steps: From 38d2aea24827991aa62b91a949bacf14c8dd0334 Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 20:58:07 -0600 Subject: [PATCH 04/22] change parallelism to 4 forgotestsum. use env.CONSUL_VERSION so we can see the version. --- .github/workflows/test-integrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index c6a50a08194e..a25c18442d18 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -356,7 +356,7 @@ jobs: --packages="${PACKAGE_NAMES}" \ -- \ go test \ - -p=8 \ + -p=4 \ -tags "${{ env.GOTAGS }}" \ -timeout=30m \ -json \ @@ -364,7 +364,7 @@ jobs: --target-image consul \ --target-version local \ --latest-image consul \ - --latest-version "$CONSUL_VERSION" + --latest-version "${{ env.CONSUL_VERSION }}" ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci From 7cf7cb90589dba110cc55d434339e000cc6031fa Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 21:26:35 -0600 Subject: [PATCH 05/22] use env for repeated values --- .github/workflows/test-integrations.yml | 78 +++++++++++++------------ 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index a25c18442d18..8212a9001511 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -19,6 +19,8 @@ env: TEST_RESULTS_ARTIFACT_NAME: test-results CONSUL_LICENSE: ${{ secrets.CONSUL_LICENSE }} GOTAGS: ${{ endsWith(github.repository, '-enterprise') && 'consulent' || '' }} + GOTESTSUM_VERSION: "1.9.0" + CONSUL_BINARY_UPLOAD_NAME: gotestsum_version: consul-bin jobs: setup: @@ -35,41 +37,13 @@ jobs: - id: runners run: .github/scripts/get_runner_classes.sh - generate-envoy-job-matrices: - needs: [setup] - runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} - name: Generate Envoy Job Matrices - outputs: - envoy-matrix: ${{ steps.set-matrix.outputs.envoy-matrix }} - steps: - - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - - name: Generate Envoy Job Matrix - id: set-matrix - env: - # this is further going to multiplied in envoy-integration tests by the - # other dimensions in the matrix. Currently TOTAL_RUNNERS would be - # multiplied by 8 based on these values: - # envoy-version: ["1.22.7", "1.23.4", "1.24.2", "1.25.1"] - # xds-target: ["server", "client"] - TOTAL_RUNNERS: 3 - JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' - run: | - { - echo -n "envoy-matrix=" - find ./test/integration/connect/envoy -maxdepth 1 -type d -print0 \ - | xargs -0 -n 1 basename \ - | jq --raw-input --argjson runnercount "$TOTAL_RUNNERS" "$JQ_SLICER" \ - | jq --compact-output 'map(join("|"))' - } >> "$GITHUB_OUTPUT" - cat "$GITHUB_OUTPUT" - dev-build: needs: [setup] uses: ./.github/workflows/reusable-dev-build.yml with: runs-on: ${{ needs.setup.outputs.compute-xl }} repository-name: ${{ github.repository }} - uploaded-binary-name: 'consul-bin' + uploaded-binary-name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' secrets: elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} @@ -85,7 +59,7 @@ jobs: - name: Setup gotestsum uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 with: - gotestsum_version: 1.9.0 + gotestsum_version: ${{ env.GOTESTSUM_VERSION }} - name: Checkout Nomad uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 with: @@ -100,7 +74,7 @@ jobs: - name: Fetch Consul binary uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: 'consul-bin' + name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' path: ./bin - name: Restore Consul permissions run: | @@ -144,7 +118,7 @@ jobs: - uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 with: - gotestsum_version: 1.9.0 + gotestsum_version: ${{ env.GOTESTSUM_VERSION }} - name: Install Vault run: | @@ -157,6 +131,34 @@ jobs: mkdir -p "${{ env.TEST_RESULTS_DIR }}" make test-connect-ca-providers + generate-envoy-job-matrices: + needs: [setup] + runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} + name: Generate Envoy Job Matrices + outputs: + envoy-matrix: ${{ steps.set-matrix.outputs.envoy-matrix }} + steps: + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + - name: Generate Envoy Job Matrix + id: set-matrix + env: + # this is further going to multiplied in envoy-integration tests by the + # other dimensions in the matrix. Currently TOTAL_RUNNERS would be + # multiplied by 8 based on these values: + # envoy-version: ["1.22.7", "1.23.4", "1.24.2", "1.25.1"] + # xds-target: ["server", "client"] + TOTAL_RUNNERS: 3 + JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' + run: | + { + echo -n "envoy-matrix=" + find ./test/integration/connect/envoy -maxdepth 1 -type d -print0 \ + | xargs -0 -n 1 basename \ + | jq --raw-input --argjson runnercount "$TOTAL_RUNNERS" "$JQ_SLICER" \ + | jq --compact-output 'map(join("|"))' + } >> "$GITHUB_OUTPUT" + cat "$GITHUB_OUTPUT" + envoy-integration-test: runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} permissions: @@ -202,12 +204,12 @@ jobs: - name: Setup gotestsum uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 with: - gotestsum_version: 1.9.0 + gotestsum_version: ${{ env.GOTESTSUM_VERSION }} - name: fetch binary uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: 'consul-bin' + name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' path: ./bin - name: restore mode+x run: chmod +x ./bin/consul @@ -262,13 +264,13 @@ jobs: - name: Setup gotestsum uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 with: - gotestsum_version: 1.9.0 + gotestsum_version: ${{ env.GOTESTSUM_VERSION }} # Build the consul:local image from the already built binary - name: fetch binary uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: 'consul-bin' + name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' path: . - name: restore mode+x run: chmod +x consul @@ -330,13 +332,13 @@ jobs: - name: Setup gotestsum uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 with: - gotestsum_version: 1.9.0 + gotestsum_version: ${{ env.GOTESTSUM_VERSION }} # Get go binary from workspace - name: fetch binary uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: 'consul-bin' + name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' path: . - name: restore mode+x run: chmod +x consul From c6d97b52bc3fd860b400c77c05c2be2b893a1ff9 Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 21:49:25 -0600 Subject: [PATCH 06/22] match test to circleci --- .github/workflows/test-integrations.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 8212a9001511..4b3a199eab7b 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -349,24 +349,23 @@ jobs: mkdir -p "${{ env.TEST_RESULTS_DIR }}" cd ./test/integration/consul-container/test/upgrade docker run --rm consul:local consul version - PACKAGE_NAMES=$(go list -tags "${{ env.GOTAGS }}" ./...) gotestsum \ --raw-command \ --format=short-verbose \ --debug \ --rerun-fails=3 \ - --packages="${PACKAGE_NAMES}" \ + --packages="./..." \ -- \ go test \ -p=4 \ -tags "${{ env.GOTAGS }}" \ -timeout=30m \ -json \ - ./... \ + ./.../upgrade/ \ --target-image consul \ --target-version local \ --latest-image consul \ - --latest-version "${{ env.CONSUL_VERSION }}" + --latest-version ${{ env.CONSUL_VERSION }} ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci From 5c71126403ac42cf2b307497c546eb2b083f200e Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 21:51:05 -0600 Subject: [PATCH 07/22] fix envvar --- .github/workflows/test-integrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 4b3a199eab7b..978e753cc094 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -20,7 +20,7 @@ env: CONSUL_LICENSE: ${{ secrets.CONSUL_LICENSE }} GOTAGS: ${{ endsWith(github.repository, '-enterprise') && 'consulent' || '' }} GOTESTSUM_VERSION: "1.9.0" - CONSUL_BINARY_UPLOAD_NAME: gotestsum_version: consul-bin + CONSUL_BINARY_UPLOAD_NAME: consul-bin jobs: setup: From 49a57158646f61588b4e7de8aa855843c3b462a6 Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 21:54:02 -0600 Subject: [PATCH 08/22] fix envvar 2 --- .github/workflows/test-integrations.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 978e753cc094..0f50efa80b7c 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -280,9 +280,8 @@ jobs: - name: Compatibility Integration Tests run: | mkdir -p "${{ env.TEST_RESULTS_DIR }}" - cd ./test/integration/consul-container + cd ./test/integration/consul-container/test/upgrade docker run --rm consul:local consul version - # shellcheck disable=SC2046 gotestsum \ --raw-command \ --format=short-verbose \ @@ -295,11 +294,11 @@ jobs: -tags "${{ env.GOTAGS }}" \ -timeout=30m \ -json \ - $(go list ./... | grep -v upgrade) \ + ./.../upgrade/ \ --target-image consul \ --target-version local \ --latest-image consul \ - --latest-version latest + --latest-version ${{ env.CONSUL_VERSION ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci @@ -349,23 +348,24 @@ jobs: mkdir -p "${{ env.TEST_RESULTS_DIR }}" cd ./test/integration/consul-container/test/upgrade docker run --rm consul:local consul version + PACKAGE_NAMES=$(go list -tags "${{ env.GOTAGS }}" ./...) gotestsum \ --raw-command \ --format=short-verbose \ --debug \ --rerun-fails=3 \ - --packages="./..." \ + --packages="${PACKAGE_NAMES}" \ -- \ go test \ -p=4 \ -tags "${{ env.GOTAGS }}" \ -timeout=30m \ -json \ - ./.../upgrade/ \ + ./... \ --target-image consul \ --target-version local \ --latest-image consul \ - --latest-version ${{ env.CONSUL_VERSION }} + --latest-version "${{ env.CONSUL_VERSION }}" ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci From dd794e2c80158af3f33df61bcd2f8fc30607614f Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 21:55:23 -0600 Subject: [PATCH 09/22] fix envvar 3 --- .github/workflows/test-integrations.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 0f50efa80b7c..0279f0cf0133 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -43,7 +43,7 @@ jobs: with: runs-on: ${{ needs.setup.outputs.compute-xl }} repository-name: ${{ github.repository }} - uploaded-binary-name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + uploaded-binary-name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' secrets: elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} @@ -74,7 +74,7 @@ jobs: - name: Fetch Consul binary uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' path: ./bin - name: Restore Consul permissions run: | @@ -209,7 +209,7 @@ jobs: - name: fetch binary uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' path: ./bin - name: restore mode+x run: chmod +x ./bin/consul @@ -270,7 +270,7 @@ jobs: - name: fetch binary uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' path: . - name: restore mode+x run: chmod +x consul @@ -337,7 +337,7 @@ jobs: - name: fetch binary uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: 'gotestsum_version: ${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' path: . - name: restore mode+x run: chmod +x consul From c7149f851a4b2d39676d403730da8072e40aeb15 Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 21:56:56 -0600 Subject: [PATCH 10/22] fix envvar 4 --- .github/workflows/test-integrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 0279f0cf0133..42713aa5d905 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -43,7 +43,7 @@ jobs: with: runs-on: ${{ needs.setup.outputs.compute-xl }} repository-name: ${{ github.repository }} - uploaded-binary-name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + uploaded-binary-name: ${{ env.CONSUL_BINARY_UPLOAD_NAME }} secrets: elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} @@ -298,7 +298,7 @@ jobs: --target-image consul \ --target-version local \ --latest-image consul \ - --latest-version ${{ env.CONSUL_VERSION + --latest-version ${{ env.CONSUL_VERSION }} ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci From 5bc02b36e706a2b77b5c5233a2f79c6777132a18 Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 21:58:32 -0600 Subject: [PATCH 11/22] fix envvar 5 --- .github/workflows/test-integrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 42713aa5d905..9863abc7e379 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -43,7 +43,7 @@ jobs: with: runs-on: ${{ needs.setup.outputs.compute-xl }} repository-name: ${{ github.repository }} - uploaded-binary-name: ${{ env.CONSUL_BINARY_UPLOAD_NAME }} + uploaded-binary-name: 'consul-bin' secrets: elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} From f610f6c23d3d6afbe1e5ced98d9e1033ab8b1378 Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 22:03:25 -0600 Subject: [PATCH 12/22] make upgrade and compatibility tests match circleci --- .github/workflows/test-integrations.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 9863abc7e379..006a5bd18eb6 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -280,7 +280,7 @@ jobs: - name: Compatibility Integration Tests run: | mkdir -p "${{ env.TEST_RESULTS_DIR }}" - cd ./test/integration/consul-container/test/upgrade + cd ./test/integration/consul-container docker run --rm consul:local consul version gotestsum \ --raw-command \ @@ -291,14 +291,13 @@ jobs: -- \ go test \ -p=4 \ - -tags "${{ env.GOTAGS }}" \ -timeout=30m \ -json \ - ./.../upgrade/ \ + `go list ./... | grep -v upgrade` \ --target-image consul \ --target-version local \ --latest-image consul \ - --latest-version ${{ env.CONSUL_VERSION }} + --latest-version latest ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci From 6d8db7e376e2c248e65a3b48be4c1c0b8af9be3b Mon Sep 17 00:00:00 2001 From: John Murret Date: Mon, 10 Apr 2023 22:39:20 -0600 Subject: [PATCH 13/22] run go env to check environment --- .circleci/config.yml | 2 ++ .github/workflows/test-integrations.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 878d6fd59492..3f1fff6732bb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -483,6 +483,7 @@ jobs: sudo tar -C /usr/local -xzvf go${GO_VERSION}.linux-amd64.tar.gz environment: <<: *ENVIRONMENT + - run: go env - run: *install-gotestsum - run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile . - run: @@ -546,6 +547,7 @@ jobs: sudo tar -C /usr/local -xzvf go${GO_VERSION}.linux-amd64.tar.gz environment: <<: *ENVIRONMENT + - run: go env - run: *install-gotestsum - run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile . - run: diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 006a5bd18eb6..63552b30ca47 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -261,6 +261,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: go-version-file: 'go.mod' + - run: go env - name: Setup gotestsum uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 with: @@ -327,6 +328,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: go-version-file: 'go.mod' + - run: go env - name: Setup gotestsum uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 with: From f5af6f7fd3d119b15a731abc327e932cfa79d920 Mon Sep 17 00:00:00 2001 From: Dan Bond Date: Tue, 11 Apr 2023 13:50:42 -0700 Subject: [PATCH 14/22] debug docker Signed-off-by: Dan Bond --- .github/workflows/test-integrations.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 63552b30ca47..8228f5ddaae2 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -257,6 +257,9 @@ jobs: - setup - dev-build steps: + - name: Debug Docker + run: docker inspect -f '{{index .Options "com.docker.network.bridge.enable_icc"}}' [network] + - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: From 9d3270bef001a35069192a089921a4205e1e4f17 Mon Sep 17 00:00:00 2001 From: Dan Bond Date: Tue, 11 Apr 2023 14:05:18 -0700 Subject: [PATCH 15/22] debug docker Signed-off-by: Dan Bond --- .github/workflows/test-integrations.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 8228f5ddaae2..925606210da4 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -258,7 +258,9 @@ jobs: - dev-build steps: - name: Debug Docker - run: docker inspect -f '{{index .Options "com.docker.network.bridge.enable_icc"}}' [network] + run: | + docker inspect -f '{{index .Options "com.docker.network.bridge.enable_icc"}}' host + docker inspect -f '{{index .Options "com.docker.network.bridge.enable_icc"}}' bridge - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 From f9b4bd363454c17d6fb8ad806721f1fee76ab4c1 Mon Sep 17 00:00:00 2001 From: Dan Bond Date: Tue, 11 Apr 2023 14:19:07 -0700 Subject: [PATCH 16/22] revert debug docker Signed-off-by: Dan Bond --- .github/workflows/test-integrations.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 925606210da4..63552b30ca47 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -257,11 +257,6 @@ jobs: - setup - dev-build steps: - - name: Debug Docker - run: | - docker inspect -f '{{index .Options "com.docker.network.bridge.enable_icc"}}' host - docker inspect -f '{{index .Options "com.docker.network.bridge.enable_icc"}}' bridge - - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: From cf7bea7aed37cf55b47cb759a687f5180f09e394 Mon Sep 17 00:00:00 2001 From: John Murret Date: Wed, 12 Apr 2023 14:45:28 -0600 Subject: [PATCH 17/22] going back to command that worked 5 days ago for compatibility tests --- .github/workflows/test-integrations.yml | 42 +++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 63552b30ca47..b1f06fc4f155 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -280,26 +280,28 @@ jobs: run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile . - name: Compatibility Integration Tests run: | - mkdir -p "${{ env.TEST_RESULTS_DIR }}" - cd ./test/integration/consul-container - docker run --rm consul:local consul version - gotestsum \ - --raw-command \ - --format=short-verbose \ - --debug \ - --rerun-fails=3 \ - --packages="./..." \ - -- \ - go test \ - -p=4 \ - -timeout=30m \ - -json \ - `go list ./... | grep -v upgrade` \ - --target-image consul \ - --target-version local \ - --latest-image consul \ - --latest-version latest - ls -lrt + mkdir -p "/tmp/test-results" + cd ./test/integration/consul-container + docker run --rm consul:local consul version + # shellcheck disable=SC2046 + gotestsum \ + --raw-command \ + --format=short-verbose \ + --debug \ + --rerun-fails=3 \ + --packages="./..." \ + -- \ + go test \ + -p=4 \ + -tags "" \ + -timeout=30m \ + -json \ + $(go list ./... | grep -v upgrade) \ + --target-image consul \ + --target-version local \ + --latest-image consul \ + --latest-version latest + ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml From 9e7728077f855422bf31eb0082fdbc6d1ba60c68 Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Wed, 12 Apr 2023 17:49:01 -0400 Subject: [PATCH 18/22] Update Envoy versions to reflect changes in #16889 --- .github/workflows/test-integrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index b1f06fc4f155..ab37d2ef9b77 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -145,7 +145,7 @@ jobs: # this is further going to multiplied in envoy-integration tests by the # other dimensions in the matrix. Currently TOTAL_RUNNERS would be # multiplied by 8 based on these values: - # envoy-version: ["1.22.7", "1.23.4", "1.24.2", "1.25.1"] + # envoy-version: ["1.22.11", "1.23.8", "1.24.6", "1.25.4"] # xds-target: ["server", "client"] TOTAL_RUNNERS: 3 JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' @@ -171,7 +171,7 @@ jobs: strategy: fail-fast: false matrix: - envoy-version: ["1.22.7", "1.23.4", "1.24.2", "1.25.1"] + envoy-version: ["1.22.11", "1.23.8", "1.24.6", "1.25.4"] xds-target: ["server", "client"] test-cases: ${{ fromJSON(needs.generate-envoy-job-matrices.outputs.envoy-matrix) }} env: From 31c392fda6b676ba4a449d4ba42eabd5a813f893 Mon Sep 17 00:00:00 2001 From: John Murret Date: Fri, 7 Apr 2023 15:51:11 -0600 Subject: [PATCH 19/22] add test-integrations success job --- .github/workflows/test-integrations.yml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index ab37d2ef9b77..9fcc32c5d7f8 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -13,6 +13,10 @@ on: - 'backport/docs/**' - 'backport/ui/**' - 'backport/mktg-**' + push: + branches: + - anita-upgrade-fix # !testing! delete me + env: TEST_RESULTS_DIR: /tmp/test-results @@ -351,24 +355,7 @@ jobs: mkdir -p "${{ env.TEST_RESULTS_DIR }}" cd ./test/integration/consul-container/test/upgrade docker run --rm consul:local consul version - PACKAGE_NAMES=$(go list -tags "${{ env.GOTAGS }}" ./...) - gotestsum \ - --raw-command \ - --format=short-verbose \ - --debug \ - --rerun-fails=3 \ - --packages="${PACKAGE_NAMES}" \ - -- \ - go test \ - -p=4 \ - -tags "${{ env.GOTAGS }}" \ - -timeout=30m \ - -json \ - ./... \ - --target-image consul \ - --target-version local \ - --latest-image consul \ - --latest-version "${{ env.CONSUL_VERSION }}" + go test -v -count=1 -timeout 25m ./... -parallel=4 -p=4 --follow-log=false ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci From e7401248083adf55be2a9b118508447df7f0bfde Mon Sep 17 00:00:00 2001 From: Anita Akaeze Date: Wed, 12 Apr 2023 13:52:02 -0700 Subject: [PATCH 20/22] kick piepeline --- .github/workflows/test-integrations.yml | 540 +++++++++--------- .../test/upgrade/acl_node_test.go | 1 + .../test/upgrade/basic_test.go | 1 + .../test/upgrade/fullstopupgrade_test.go | 1 + .../test/upgrade/healthcheck_test.go | 1 + .../test/upgrade/ingress_gateway_grpc_test.go | 1 + .../test/upgrade/ingress_gateway_sds_test.go | 2 + .../test/upgrade/ingress_gateway_test.go | 1 + .../resolver_default_subset_test.go | 1 + .../upgrade/peering_control_plane_mgw_test.go | 2 + .../test/upgrade/peering_http_test.go | 4 + 11 files changed, 284 insertions(+), 271 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index 9fcc32c5d7f8..e0082dd29415 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -51,273 +51,271 @@ jobs: secrets: elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} - nomad-integration-test: - runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }} - needs: - - setup - - dev-build - strategy: - matrix: - nomad-version: ['v1.3.3', 'v1.2.10', 'v1.1.16'] - steps: - - name: Setup gotestsum - uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 - with: - gotestsum_version: ${{ env.GOTESTSUM_VERSION }} - - name: Checkout Nomad - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - with: - repository: hashicorp/nomad - ref: ${{ matrix.nomad-version }} - - - name: Install Go - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 - with: - go-version-file: 'go.mod' - - - name: Fetch Consul binary - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - with: - name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' - path: ./bin - - name: Restore Consul permissions - run: | - chmod +x ./bin/consul - echo "$(pwd)/bin" >> $GITHUB_PATH - - - name: Make Nomad dev build - run: make pkg/linux_amd64/nomad - - - name: Run integration tests - run: | - gotestsum \ - --format=short-verbose \ - --rerun-fails \ - --rerun-fails-report=/tmp/gotestsum-rerun-fails \ - --packages="./command/agent/consul" \ - --junitfile $TEST_RESULTS_DIR/results.xml -- \ - -run TestConsul - - vault-integration-test: - runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }} - needs: - - setup - - dev-build - strategy: - matrix: - vault-version: ["1.13.1", "1.12.5", "1.11.9", "1.10.11"] - env: - VAULT_BINARY_VERSION: ${{ matrix.vault-version }} - steps: - - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - - # NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos. - - name: Setup Git - if: ${{ endsWith(github.repository, '-enterprise') }} - run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" - - - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 - with: - go-version-file: 'go.mod' - - - uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 - with: - gotestsum_version: ${{ env.GOTESTSUM_VERSION }} - - - name: Install Vault - run: | - wget -q -O /tmp/vault.zip "https://releases.hashicorp.com/vault/${{ env.VAULT_BINARY_VERSION }}/vault_${{ env.VAULT_BINARY_VERSION }}_linux_amd64.zip" - unzip -d /tmp /tmp/vault.zip - echo "/tmp" >> $GITHUB_PATH - - - name: Run Connect CA Provider Tests - run: | - mkdir -p "${{ env.TEST_RESULTS_DIR }}" - make test-connect-ca-providers - - generate-envoy-job-matrices: - needs: [setup] - runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} - name: Generate Envoy Job Matrices - outputs: - envoy-matrix: ${{ steps.set-matrix.outputs.envoy-matrix }} - steps: - - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - - name: Generate Envoy Job Matrix - id: set-matrix - env: - # this is further going to multiplied in envoy-integration tests by the - # other dimensions in the matrix. Currently TOTAL_RUNNERS would be - # multiplied by 8 based on these values: - # envoy-version: ["1.22.11", "1.23.8", "1.24.6", "1.25.4"] - # xds-target: ["server", "client"] - TOTAL_RUNNERS: 3 - JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' - run: | - { - echo -n "envoy-matrix=" - find ./test/integration/connect/envoy -maxdepth 1 -type d -print0 \ - | xargs -0 -n 1 basename \ - | jq --raw-input --argjson runnercount "$TOTAL_RUNNERS" "$JQ_SLICER" \ - | jq --compact-output 'map(join("|"))' - } >> "$GITHUB_OUTPUT" - cat "$GITHUB_OUTPUT" + # nomad-integration-test: + # runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }} + # needs: + # - setup + # - dev-build + # strategy: + # matrix: + # nomad-version: ['v1.3.3', 'v1.2.10', 'v1.1.16'] + # steps: + # - name: Setup gotestsum + # uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + # with: + # gotestsum_version: ${{ env.GOTESTSUM_VERSION }} + # - name: Checkout Nomad + # uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + # with: + # repository: hashicorp/nomad + # ref: ${{ matrix.nomad-version }} + + # - name: Install Go + # uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + # with: + # go-version-file: 'go.mod' + + # - name: Fetch Consul binary + # uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + # with: + # name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + # path: ./bin + # - name: Restore Consul permissions + # run: | + # chmod +x ./bin/consul + # echo "$(pwd)/bin" >> $GITHUB_PATH + + # - name: Make Nomad dev build + # run: make pkg/linux_amd64/nomad + + # - name: Run integration tests + # run: | + # gotestsum \ + # --format=short-verbose \ + # --rerun-fails \ + # --rerun-fails-report=/tmp/gotestsum-rerun-fails \ + # --packages="./command/agent/consul" \ + # --junitfile $TEST_RESULTS_DIR/results.xml -- \ + # -run TestConsul + + # vault-integration-test: + # runs-on: ${{ fromJSON(needs.setup.outputs.compute-large) }} + # needs: + # - setup + # - dev-build + # strategy: + # matrix: + # vault-version: ["1.13.1", "1.12.5", "1.11.9", "1.10.11"] + # env: + # VAULT_BINARY_VERSION: ${{ matrix.vault-version }} + # steps: + # - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + + # # NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos. + # - name: Setup Git + # if: ${{ endsWith(github.repository, '-enterprise') }} + # run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com" + + # - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + # with: + # go-version-file: 'go.mod' + + # - uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + # with: + # gotestsum_version: ${{ env.GOTESTSUM_VERSION }} + + # - name: Install Vault + # run: | + # wget -q -O /tmp/vault.zip "https://releases.hashicorp.com/vault/${{ env.VAULT_BINARY_VERSION }}/vault_${{ env.VAULT_BINARY_VERSION }}_linux_amd64.zip" + # unzip -d /tmp /tmp/vault.zip + # echo "/tmp" >> $GITHUB_PATH + + # - name: Run Connect CA Provider Tests + # run: | + # mkdir -p "${{ env.TEST_RESULTS_DIR }}" + # make test-connect-ca-providers + + # generate-envoy-job-matrices: + # needs: [setup] + # runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} + # name: Generate Envoy Job Matrices + # outputs: + # envoy-matrix: ${{ steps.set-matrix.outputs.envoy-matrix }} + # steps: + # - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + # - name: Generate Envoy Job Matrix + # id: set-matrix + # env: + # # this is further going to multiplied in envoy-integration tests by the + # # other dimensions in the matrix. Currently TOTAL_RUNNERS would be + # # multiplied by 8 based on these values: + # # envoy-version: ["1.22.7", "1.23.4", "1.24.2", "1.25.1"] + # # xds-target: ["server", "client"] + # TOTAL_RUNNERS: 3 + # JQ_SLICER: '[ inputs ] | [_nwise(length / $runnercount | floor)]' + # run: | + # { + # echo -n "envoy-matrix=" + # find ./test/integration/connect/envoy -maxdepth 1 -type d -print0 \ + # | xargs -0 -n 1 basename \ + # | jq --raw-input --argjson runnercount "$TOTAL_RUNNERS" "$JQ_SLICER" \ + # | jq --compact-output 'map(join("|"))' + # } >> "$GITHUB_OUTPUT" + # cat "$GITHUB_OUTPUT" - envoy-integration-test: - runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} - permissions: - id-token: write # NOTE: this permission is explicitly required for Vault auth. - contents: read - needs: - - setup - - generate-envoy-job-matrices - - dev-build - strategy: - fail-fast: false - matrix: - envoy-version: ["1.22.11", "1.23.8", "1.24.6", "1.25.4"] - xds-target: ["server", "client"] - test-cases: ${{ fromJSON(needs.generate-envoy-job-matrices.outputs.envoy-matrix) }} - env: - ENVOY_VERSION: ${{ matrix.envoy-version }} - XDS_TARGET: ${{ matrix.xds-target }} - AWS_LAMBDA_REGION: us-west-2 - steps: - # NOTE: ENT specific step as we store secrets in Vault. - - name: Authenticate to Vault - if: ${{ endsWith(github.repository, '-enterprise') }} - id: vault-auth - run: vault-auth - - # NOTE: ENT specific step as we store secrets in Vault. - - name: Fetch Secrets - if: ${{ endsWith(github.repository, '-enterprise') }} - id: secrets - uses: hashicorp/vault-action@v2.5.0 - with: - url: ${{ steps.vault-auth.outputs.addr }} - caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }} - token: ${{ steps.vault-auth.outputs.token }} - secrets: | - kv/data/github/${{ github.repository }}/aws arn | AWS_ROLE_ARN ; - - - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 - with: - go-version-file: 'go.mod' - - name: Setup gotestsum - uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 - with: - gotestsum_version: ${{ env.GOTESTSUM_VERSION }} - - - name: fetch binary - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - with: - name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' - path: ./bin - - name: restore mode+x - run: chmod +x ./bin/consul - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1 - - - name: Docker build - run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile ./bin - - - name: Envoy Integration Tests - env: - GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml - GOTESTSUM_FORMAT: standard-verbose - COMPOSE_INTERACTIVE_NO_CLI: 1 - LAMBDA_TESTS_ENABLED: "true" - # tput complains if this isn't set to something. - TERM: ansi - run: | - # shellcheck disable=SC2001 - echo "Running $(sed 's,|, ,g' <<< "${{ matrix.test-cases }}" |wc -w) subtests" - # shellcheck disable=SC2001 - sed 's,|,\n,g' <<< "${{ matrix.test-cases }}" - gotestsum \ - --debug \ - --rerun-fails \ - --rerun-fails-report=/tmp/gotestsum-rerun-fails \ - --jsonfile /tmp/jsonfile/go-test.log \ - --packages=./test/integration/connect/envoy \ - -- -timeout=30m -tags integration -run="TestEnvoy/(${{ matrix.test-cases }})" + # envoy-integration-test: + # runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} + # permissions: + # id-token: write # NOTE: this permission is explicitly required for Vault auth. + # contents: read + # needs: + # - setup + # - generate-envoy-job-matrices + # - dev-build + # strategy: + # fail-fast: false + # matrix: + # envoy-version: ["1.22.7", "1.23.4", "1.24.2", "1.25.1"] + # xds-target: ["server", "client"] + # test-cases: ${{ fromJSON(needs.generate-envoy-job-matrices.outputs.envoy-matrix) }} + # env: + # ENVOY_VERSION: ${{ matrix.envoy-version }} + # XDS_TARGET: ${{ matrix.xds-target }} + # AWS_LAMBDA_REGION: us-west-2 + # steps: + # # NOTE: ENT specific step as we store secrets in Vault. + # - name: Authenticate to Vault + # if: ${{ endsWith(github.repository, '-enterprise') }} + # id: vault-auth + # run: vault-auth + + # # NOTE: ENT specific step as we store secrets in Vault. + # - name: Fetch Secrets + # if: ${{ endsWith(github.repository, '-enterprise') }} + # id: secrets + # uses: hashicorp/vault-action@v2.5.0 + # with: + # url: ${{ steps.vault-auth.outputs.addr }} + # caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }} + # token: ${{ steps.vault-auth.outputs.token }} + # secrets: | + # kv/data/github/${{ github.repository }}/aws arn | AWS_ROLE_ARN ; + + # - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + # - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + # with: + # go-version-file: 'go.mod' + # - name: Setup gotestsum + # uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + # with: + # gotestsum_version: ${{ env.GOTESTSUM_VERSION }} + + # - name: fetch binary + # uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + # with: + # name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + # path: ./bin + # - name: restore mode+x + # run: chmod +x ./bin/consul + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1 + + # - name: Docker build + # run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile ./bin + + # - name: Envoy Integration Tests + # env: + # GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml + # GOTESTSUM_FORMAT: standard-verbose + # COMPOSE_INTERACTIVE_NO_CLI: 1 + # LAMBDA_TESTS_ENABLED: "true" + # # tput complains if this isn't set to something. + # TERM: ansi + # run: | + # # shellcheck disable=SC2001 + # echo "Running $(sed 's,|, ,g' <<< "${{ matrix.test-cases }}" |wc -w) subtests" + # # shellcheck disable=SC2001 + # sed 's,|,\n,g' <<< "${{ matrix.test-cases }}" + # gotestsum \ + # --debug \ + # --rerun-fails \ + # --rerun-fails-report=/tmp/gotestsum-rerun-fails \ + # --jsonfile /tmp/jsonfile/go-test.log \ + # --packages=./test/integration/connect/envoy \ + # -- -timeout=30m -tags integration -run="TestEnvoy/(${{ matrix.test-cases }})" - - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - with: - name: container-logs - path: ./test/integration/connect/envoy/workdir/logs - - - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - with: - name: ${{ env.TEST_RESULTS_ARTIFACT_NAME }} - path: ${{ env.TEST_RESULTS_DIR }} - - compatibility-integration-test: - runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} - needs: - - setup - - dev-build - steps: - - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 - with: - go-version-file: 'go.mod' - - run: go env - - name: Setup gotestsum - uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 - with: - gotestsum_version: ${{ env.GOTESTSUM_VERSION }} - - # Build the consul:local image from the already built binary - - name: fetch binary - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - with: - name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' - path: . - - name: restore mode+x - run: chmod +x consul - - - name: Build consul:local image - run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile . - - name: Compatibility Integration Tests - run: | - mkdir -p "/tmp/test-results" - cd ./test/integration/consul-container - docker run --rm consul:local consul version - # shellcheck disable=SC2046 - gotestsum \ - --raw-command \ - --format=short-verbose \ - --debug \ - --rerun-fails=3 \ - --packages="./..." \ - -- \ - go test \ - -p=4 \ - -tags "" \ - -timeout=30m \ - -json \ - $(go list ./... | grep -v upgrade) \ - --target-image consul \ - --target-version local \ - --latest-image consul \ - --latest-version latest - ls -lrt - env: - # this is needed because of incompatibility between RYUK container and circleci - GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml - GOTESTSUM_FORMAT: standard-verbose - COMPOSE_INTERACTIVE_NO_CLI: 1 - # tput complains if this isn't set to something. - TERM: ansi - - - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - with: - name: ${{ env.TEST_RESULTS_ARTIFACT_NAME }} - path: ${{ env.TEST_RESULTS_DIR }} + # - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + # with: + # name: container-logs + # path: ./test/integration/connect/envoy/workdir/logs + + # - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + # with: + # name: ${{ env.TEST_RESULTS_ARTIFACT_NAME }} + # path: ${{ env.TEST_RESULTS_DIR }} + + # compatibility-integration-test: + # runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} + # needs: + # - setup + # - dev-build + # steps: + # - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + # - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 + # with: + # go-version-file: 'go.mod' + # - run: go env + # - name: Setup gotestsum + # uses: autero1/action-gotestsum@2e48af62f5248bd3b014f598cd1aa69a01dd36e3 # v1.0.0 + # with: + # gotestsum_version: ${{ env.GOTESTSUM_VERSION }} + + # # Build the consul:local image from the already built binary + # - name: fetch binary + # uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + # with: + # name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}' + # path: . + # - name: restore mode+x + # run: chmod +x consul + + # - name: Build consul:local image + # run: docker build -t consul:local -f ./build-support/docker/Consul-Dev.dockerfile . + # - name: Compatibility Integration Tests + # run: | + # mkdir -p "${{ env.TEST_RESULTS_DIR }}" + # cd ./test/integration/consul-container + # docker run --rm consul:local consul version + # gotestsum \ + # --raw-command \ + # --format=short-verbose \ + # --debug \ + # --rerun-fails=3 \ + # --packages="./..." \ + # -- \ + # go test \ + # -p=4 \ + # -timeout=30m \ + # -json \ + # `go list ./... | grep -v upgrade` \ + # --target-image consul \ + # --target-version local \ + # --latest-image consul \ + # --latest-version latest + # ls -lrt + # env: + # # this is needed because of incompatibility between RYUK container and circleci + # GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml + # GOTESTSUM_FORMAT: standard-verbose + # COMPOSE_INTERACTIVE_NO_CLI: 1 + # # tput complains if this isn't set to something. + # TERM: ansi + + # - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + # with: + # name: ${{ env.TEST_RESULTS_ARTIFACT_NAME }} + # path: ${{ env.TEST_RESULTS_DIR }} upgrade-integration-test: runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} @@ -355,7 +353,7 @@ jobs: mkdir -p "${{ env.TEST_RESULTS_DIR }}" cd ./test/integration/consul-container/test/upgrade docker run --rm consul:local consul version - go test -v -count=1 -timeout 25m ./... -parallel=4 -p=4 --follow-log=false + go test ./... -v -p=1 -count=1 -timeout 25m --follow-log=false ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci @@ -372,12 +370,12 @@ jobs: test-integrations-success: needs: - setup - - generate-envoy-job-matrices + # - generate-envoy-job-matrices - dev-build - - nomad-integration-test - - vault-integration-test - - envoy-integration-test - - compatibility-integration-test + # - nomad-integration-test + # - vault-integration-test + # - envoy-integration-test + # - compatibility-integration-test - upgrade-integration-test runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} if: | diff --git a/test/integration/consul-container/test/upgrade/acl_node_test.go b/test/integration/consul-container/test/upgrade/acl_node_test.go index 52b0728b52cb..bd80857eeaac 100644 --- a/test/integration/consul-container/test/upgrade/acl_node_test.go +++ b/test/integration/consul-container/test/upgrade/acl_node_test.go @@ -33,6 +33,7 @@ func TestACL_NodeToken(t *testing.T) { }, ApplyDefaultProxySettings: true, }) + defer cluster.Terminate() agentToken, err := cluster.CreateAgentToken("dc1", cluster.Agents[1].GetAgentName()) diff --git a/test/integration/consul-container/test/upgrade/basic_test.go b/test/integration/consul-container/test/upgrade/basic_test.go index e65b7a1b2369..c306c82a819f 100644 --- a/test/integration/consul-container/test/upgrade/basic_test.go +++ b/test/integration/consul-container/test/upgrade/basic_test.go @@ -33,6 +33,7 @@ func TestBasic(t *testing.T) { cluster, err := libcluster.NewN(t, *serverConf, numServers) require.NoError(t, err) + defer cluster.Terminate() client := cluster.APIClient(0) diff --git a/test/integration/consul-container/test/upgrade/fullstopupgrade_test.go b/test/integration/consul-container/test/upgrade/fullstopupgrade_test.go index 2539a66f9dd9..64ad50f5ce58 100644 --- a/test/integration/consul-container/test/upgrade/fullstopupgrade_test.go +++ b/test/integration/consul-container/test/upgrade/fullstopupgrade_test.go @@ -67,6 +67,7 @@ func TestStandardUpgradeToTarget_fromLatest(t *testing.T) { cluster, err := libcluster.NewN(t, *serverConf, numServers) require.NoError(t, err) + defer cluster.Terminate() client := cluster.APIClient(0) diff --git a/test/integration/consul-container/test/upgrade/healthcheck_test.go b/test/integration/consul-container/test/upgrade/healthcheck_test.go index da7572511fc6..c89cb5e42509 100644 --- a/test/integration/consul-container/test/upgrade/healthcheck_test.go +++ b/test/integration/consul-container/test/upgrade/healthcheck_test.go @@ -46,6 +46,7 @@ func TestTargetServersWithLatestGAClients(t *testing.T) { } cluster, _, _ := libtopology.NewCluster(t, clusterConfig) + defer cluster.Terminate() // change the version of Client agent to latest version config := cluster.Agents[3].GetConfig() diff --git a/test/integration/consul-container/test/upgrade/ingress_gateway_grpc_test.go b/test/integration/consul-container/test/upgrade/ingress_gateway_grpc_test.go index 21c6738c9c0f..572a5100c29c 100644 --- a/test/integration/consul-container/test/upgrade/ingress_gateway_grpc_test.go +++ b/test/integration/consul-container/test/upgrade/ingress_gateway_grpc_test.go @@ -27,6 +27,7 @@ func TestIngressGateway_GRPC_UpgradeToTarget_fromLatest(t *testing.T) { }, ApplyDefaultProxySettings: true, }) + defer cluster.Terminate() require.NoError(t, cluster.ConfigEntryWrite(&api.ServiceConfigEntry{ Name: libservice.StaticServerServiceName, diff --git a/test/integration/consul-container/test/upgrade/ingress_gateway_sds_test.go b/test/integration/consul-container/test/upgrade/ingress_gateway_sds_test.go index abb1b55724bf..4ecefa20eca7 100644 --- a/test/integration/consul-container/test/upgrade/ingress_gateway_sds_test.go +++ b/test/integration/consul-container/test/upgrade/ingress_gateway_sds_test.go @@ -43,8 +43,10 @@ func TestIngressGateway_SDS_UpgradeToTarget_fromLatest(t *testing.T) { }, ApplyDefaultProxySettings: true, }) + defer cluster.Terminate() sdsServerContainerName, rootPEM := createSDSServer(t, cluster) + require.NoError(t, cluster.ConfigEntryWrite(&api.ServiceConfigEntry{ Name: libservice.StaticServerServiceName, diff --git a/test/integration/consul-container/test/upgrade/ingress_gateway_test.go b/test/integration/consul-container/test/upgrade/ingress_gateway_test.go index 56852a52ee6a..6c532b001306 100644 --- a/test/integration/consul-container/test/upgrade/ingress_gateway_test.go +++ b/test/integration/consul-container/test/upgrade/ingress_gateway_test.go @@ -54,6 +54,7 @@ func TestIngressGateway_UpgradeToTarget_fromLatest(t *testing.T) { }, ApplyDefaultProxySettings: true, }) + defer cluster.Terminate() require.NoError(t, cluster.ConfigEntryWrite(&api.ProxyConfigEntry{ Name: api.ProxyConfigGlobal, diff --git a/test/integration/consul-container/test/upgrade/l7_traffic_management/resolver_default_subset_test.go b/test/integration/consul-container/test/upgrade/l7_traffic_management/resolver_default_subset_test.go index c45c6698b497..e8fd668e4755 100644 --- a/test/integration/consul-container/test/upgrade/l7_traffic_management/resolver_default_subset_test.go +++ b/test/integration/consul-container/test/upgrade/l7_traffic_management/resolver_default_subset_test.go @@ -25,6 +25,7 @@ func TestTrafficManagement_ResolveDefaultSubset(t *testing.T) { t.Parallel() cluster, staticServerProxy, staticClientProxy := setup(t) + defer cluster.Terminate() node := cluster.Agents[0] client := node.GetClient() diff --git a/test/integration/consul-container/test/upgrade/peering_control_plane_mgw_test.go b/test/integration/consul-container/test/upgrade/peering_control_plane_mgw_test.go index 1aa68d2bb2dc..7cac30a671fe 100644 --- a/test/integration/consul-container/test/upgrade/peering_control_plane_mgw_test.go +++ b/test/integration/consul-container/test/upgrade/peering_control_plane_mgw_test.go @@ -32,6 +32,8 @@ func TestPeering_ControlPlaneMGW(t *testing.T) { acceptingCluster = accepting.Cluster dialingCluster = dialing.Cluster ) + defer accepting.Cluster.Terminate() + defer dialing.Cluster.Terminate() dialingClient, err := dialingCluster.GetClient(nil, false) require.NoError(t, err) diff --git a/test/integration/consul-container/test/upgrade/peering_http_test.go b/test/integration/consul-container/test/upgrade/peering_http_test.go index 9132208d8505..caac10cd961a 100644 --- a/test/integration/consul-container/test/upgrade/peering_http_test.go +++ b/test/integration/consul-container/test/upgrade/peering_http_test.go @@ -29,6 +29,8 @@ func TestPeering_HTTPRouter(t *testing.T) { t.Parallel() accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false) acceptingCluster := accepting.Cluster + defer acceptingCluster.Terminate() + defer dialing.Cluster.Terminate() // Create a second static-server at the client agent of accepting cluster and // a service-router that routes /static-server-2 to static-server-2 @@ -92,6 +94,8 @@ func TestPeering_HTTPResolverAndFailover(t *testing.T) { accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false) dialingCluster := dialing.Cluster + defer dialingCluster.Terminate() + defer accepting.Cluster.Terminate() require.NoError(t, dialingCluster.ConfigEntryWrite(&api.ProxyConfigEntry{ Kind: api.ProxyDefaults, From b9f61970c4a94324c0cef25a243207f160cce239 Mon Sep 17 00:00:00 2001 From: Anita Akaeze Date: Wed, 12 Apr 2023 15:22:21 -0700 Subject: [PATCH 21/22] update consul version --- .github/workflows/test-integrations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index e0082dd29415..b09af03d2f1b 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -353,7 +353,7 @@ jobs: mkdir -p "${{ env.TEST_RESULTS_DIR }}" cd ./test/integration/consul-container/test/upgrade docker run --rm consul:local consul version - go test ./... -v -p=1 -count=1 -timeout 25m --follow-log=false + go test ./... -v -p=1 -count=1 -timeout 25m --target-image consul --target-version local --latest-image consul --latest-version $CONSUL_VERSION -follow-log=false ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci From a55a00c86fd6169d75e8c1cec349acc5cc7f932d Mon Sep 17 00:00:00 2001 From: Anita Akaeze Date: Wed, 12 Apr 2023 16:21:05 -0700 Subject: [PATCH 22/22] test --- .github/workflows/test-integrations.yml | 2 +- .../integration/consul-container/libs/cluster/container.go | 7 ++++--- .../consul-container/test/upgrade/acl_node_test.go | 2 +- .../consul-container/test/upgrade/basic_test.go | 2 +- .../consul-container/test/upgrade/fullstopupgrade_test.go | 2 +- .../consul-container/test/upgrade/healthcheck_test.go | 6 +++--- .../test/upgrade/ingress_gateway_grpc_test.go | 1 - .../test/upgrade/ingress_gateway_sds_test.go | 1 - .../consul-container/test/upgrade/ingress_gateway_test.go | 1 - .../l7_traffic_management/resolver_default_subset_test.go | 2 -- .../test/upgrade/peering_control_plane_mgw_test.go | 1 - .../consul-container/test/upgrade/peering_http_test.go | 6 ++---- 12 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-integrations.yml b/.github/workflows/test-integrations.yml index b09af03d2f1b..8256cf69441a 100644 --- a/.github/workflows/test-integrations.yml +++ b/.github/workflows/test-integrations.yml @@ -353,7 +353,7 @@ jobs: mkdir -p "${{ env.TEST_RESULTS_DIR }}" cd ./test/integration/consul-container/test/upgrade docker run --rm consul:local consul version - go test ./... -v -p=1 -count=1 -timeout 25m --target-image consul --target-version local --latest-image consul --latest-version $CONSUL_VERSION -follow-log=false + go test ./... -v -p 1 -count=1 -timeout 25m --target-image consul --target-version local --latest-image consul --latest-version $CONSUL_VERSION -follow-log=false ls -lrt env: # this is needed because of incompatibility between RYUK container and circleci diff --git a/test/integration/consul-container/libs/cluster/container.go b/test/integration/consul-container/libs/cluster/container.go index 687f06bcf318..89c4febbace8 100644 --- a/test/integration/consul-container/libs/cluster/container.go +++ b/test/integration/consul-container/libs/cluster/container.go @@ -508,7 +508,7 @@ func startContainer(ctx context.Context, req testcontainers.ContainerRequest) (t }) } -const pauseImage = "registry.k8s.io/pause:3.3" +const pauseImage = "registry.k8s.io/pause:3.8" type containerOpts struct { configFile string @@ -548,8 +548,9 @@ func newContainerRequest(config Config, opts containerOpts, ports ...int) (podRe "9998/tcp", // Envoy App Listener "9999/tcp", // Envoy App Listener }, - Hostname: opts.hostname, - Networks: opts.addtionalNetworks, + Hostname: opts.hostname, + Networks: opts.addtionalNetworks, + // WaitingFor: wait.ForExposedPort().WithStartupTimeout(999 * time.Second), } // Envoy upstream listener diff --git a/test/integration/consul-container/test/upgrade/acl_node_test.go b/test/integration/consul-container/test/upgrade/acl_node_test.go index bd80857eeaac..4c2d262c8baf 100644 --- a/test/integration/consul-container/test/upgrade/acl_node_test.go +++ b/test/integration/consul-container/test/upgrade/acl_node_test.go @@ -19,7 +19,7 @@ import ( // 1. Upgraded agent can inherit the persistend token and join the cluster // 2. Agent token prior to upgrade is still valid after upgrade func TestACL_NodeToken(t *testing.T) { - t.Parallel() + // NOTE: Disable auto.encrypt due to its conflict with ACL token during bootstrap cluster, _, _ := libtopology.NewCluster(t, &libtopology.ClusterConfig{ diff --git a/test/integration/consul-container/test/upgrade/basic_test.go b/test/integration/consul-container/test/upgrade/basic_test.go index c306c82a819f..4ba8133b0699 100644 --- a/test/integration/consul-container/test/upgrade/basic_test.go +++ b/test/integration/consul-container/test/upgrade/basic_test.go @@ -16,7 +16,7 @@ import ( // Test upgrade a cluster of latest version to the target version func TestBasic(t *testing.T) { - t.Parallel() + configCtx := libcluster.NewBuildContext(t, libcluster.BuildOptions{ ConsulImageName: utils.TargetImageName, diff --git a/test/integration/consul-container/test/upgrade/fullstopupgrade_test.go b/test/integration/consul-container/test/upgrade/fullstopupgrade_test.go index 64ad50f5ce58..c5b4996b9c82 100644 --- a/test/integration/consul-container/test/upgrade/fullstopupgrade_test.go +++ b/test/integration/consul-container/test/upgrade/fullstopupgrade_test.go @@ -31,7 +31,7 @@ var ( // Test upgrade a cluster of latest version to the target version func TestStandardUpgradeToTarget_fromLatest(t *testing.T) { - t.Parallel() + tcs = append(tcs, testcase{ diff --git a/test/integration/consul-container/test/upgrade/healthcheck_test.go b/test/integration/consul-container/test/upgrade/healthcheck_test.go index c89cb5e42509..a3c5e0877f89 100644 --- a/test/integration/consul-container/test/upgrade/healthcheck_test.go +++ b/test/integration/consul-container/test/upgrade/healthcheck_test.go @@ -22,7 +22,7 @@ import ( // Note: this upgrade test doesn't use StandardUpgrade since it requires // a cluster with clients and servers with mixed versions func TestTargetServersWithLatestGAClients(t *testing.T) { - t.Parallel() + fromVersion, err := version.NewVersion(utils.LatestVersion) require.NoError(t, err) @@ -70,14 +70,14 @@ func TestTargetServersWithLatestGAClients(t *testing.T) { // Test health check GRPC call using Mixed (majority latest) Servers and Latest GA Clients func TestMixedServersMajorityLatestGAClient(t *testing.T) { - t.Parallel() + testMixedServersGAClient(t, false) } // Test health check GRPC call using Mixed (majority target) Servers and Latest GA Clients func TestMixedServersMajorityTargetGAClient(t *testing.T) { - t.Parallel() + testMixedServersGAClient(t, true) } diff --git a/test/integration/consul-container/test/upgrade/ingress_gateway_grpc_test.go b/test/integration/consul-container/test/upgrade/ingress_gateway_grpc_test.go index 572a5100c29c..32c26448e2cc 100644 --- a/test/integration/consul-container/test/upgrade/ingress_gateway_grpc_test.go +++ b/test/integration/consul-container/test/upgrade/ingress_gateway_grpc_test.go @@ -17,7 +17,6 @@ import ( ) func TestIngressGateway_GRPC_UpgradeToTarget_fromLatest(t *testing.T) { - t.Parallel() cluster, _, client := topology.NewCluster(t, &topology.ClusterConfig{ NumServers: 1, NumClients: 1, diff --git a/test/integration/consul-container/test/upgrade/ingress_gateway_sds_test.go b/test/integration/consul-container/test/upgrade/ingress_gateway_sds_test.go index 4ecefa20eca7..dca210a31f7f 100644 --- a/test/integration/consul-container/test/upgrade/ingress_gateway_sds_test.go +++ b/test/integration/consul-container/test/upgrade/ingress_gateway_sds_test.go @@ -32,7 +32,6 @@ const sdsServerPort = 1234 // 4. does HTTPS calls against the gateway and checks that the certs returned // are from the SDS server as expected func TestIngressGateway_SDS_UpgradeToTarget_fromLatest(t *testing.T) { - t.Parallel() cluster, _, client := topology.NewCluster(t, &topology.ClusterConfig{ NumServers: 1, diff --git a/test/integration/consul-container/test/upgrade/ingress_gateway_test.go b/test/integration/consul-container/test/upgrade/ingress_gateway_test.go index 6c532b001306..8103cac44e40 100644 --- a/test/integration/consul-container/test/upgrade/ingress_gateway_test.go +++ b/test/integration/consul-container/test/upgrade/ingress_gateway_test.go @@ -43,7 +43,6 @@ import ( // - upgrades the cluster // - performs these tests again func TestIngressGateway_UpgradeToTarget_fromLatest(t *testing.T) { - t.Parallel() cluster, _, client := topology.NewCluster(t, &topology.ClusterConfig{ NumServers: 1, diff --git a/test/integration/consul-container/test/upgrade/l7_traffic_management/resolver_default_subset_test.go b/test/integration/consul-container/test/upgrade/l7_traffic_management/resolver_default_subset_test.go index e8fd668e4755..3ab63f492404 100644 --- a/test/integration/consul-container/test/upgrade/l7_traffic_management/resolver_default_subset_test.go +++ b/test/integration/consul-container/test/upgrade/l7_traffic_management/resolver_default_subset_test.go @@ -22,8 +22,6 @@ import ( // - Create 2 additional static-server instances: one in V1 subset and the other in V2 subset // - resolver directs traffic to the default subset, which is V2. func TestTrafficManagement_ResolveDefaultSubset(t *testing.T) { - t.Parallel() - cluster, staticServerProxy, staticClientProxy := setup(t) defer cluster.Terminate() diff --git a/test/integration/consul-container/test/upgrade/peering_control_plane_mgw_test.go b/test/integration/consul-container/test/upgrade/peering_control_plane_mgw_test.go index 7cac30a671fe..ee0f7a08468c 100644 --- a/test/integration/consul-container/test/upgrade/peering_control_plane_mgw_test.go +++ b/test/integration/consul-container/test/upgrade/peering_control_plane_mgw_test.go @@ -25,7 +25,6 @@ import ( // 3. Upgrade both clusters // 4. Verify the peering is re-established through mesh gateway func TestPeering_ControlPlaneMGW(t *testing.T) { - t.Parallel() accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, true) var ( diff --git a/test/integration/consul-container/test/upgrade/peering_http_test.go b/test/integration/consul-container/test/upgrade/peering_http_test.go index caac10cd961a..bf9da7b89a4d 100644 --- a/test/integration/consul-container/test/upgrade/peering_http_test.go +++ b/test/integration/consul-container/test/upgrade/peering_http_test.go @@ -19,14 +19,14 @@ import ( ) func TestPeering_Basic(t *testing.T) { - t.Parallel() + accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false) peeringUpgrade(t, accepting, dialing, utils.TargetVersion) peeringPostUpgradeValidation(t, dialing) } func TestPeering_HTTPRouter(t *testing.T) { - t.Parallel() + accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false) acceptingCluster := accepting.Cluster defer acceptingCluster.Terminate() @@ -90,7 +90,6 @@ func TestPeering_HTTPRouter(t *testing.T) { // - service-resolved named static-server with failover to static-server in accepting cluster // - service-resolved named peer-static-server to static-server in accepting cluster func TestPeering_HTTPResolverAndFailover(t *testing.T) { - t.Parallel() accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false) dialingCluster := dialing.Cluster @@ -185,7 +184,6 @@ func TestPeering_HTTPResolverAndFailover(t *testing.T) { // - service-resolved named local-static-server // - service-resolved named peer-static-server func TestPeering_HTTPResolverAndSplitter(t *testing.T) { - t.Parallel() accepting, dialing := libtopology.BasicPeeringTwoClustersSetup(t, utils.LatestVersion, false) dialingCluster := dialing.Cluster