From 882e9e5760e2342c59105983f19a0210cefce726 Mon Sep 17 00:00:00 2001 From: Willem Basson Date: Tue, 13 Aug 2024 15:46:57 +0200 Subject: [PATCH 1/4] Surgery Fix xdist regression tests --- .github/workflows/continuous-deploy.yml | 52 +------------------------ 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/.github/workflows/continuous-deploy.yml b/.github/workflows/continuous-deploy.yml index 5b25ef87f..adf96769d 100644 --- a/.github/workflows/continuous-deploy.yml +++ b/.github/workflows/continuous-deploy.yml @@ -387,24 +387,6 @@ jobs: authkey: ${{ secrets.TAILSCALE_AUTHKEY }} version: ${{ env.TAILSCALE_VERSION }} - # - name: Helmfile Diff - # if: github.event.inputs.run-reset-deployments == 'true' - # uses: helmfile/helmfile-action@v1.9.1 - # with: - # helmfile-args: | - # diff \ - # --environment ${{ vars.ENVIRONMENT }} \ - # -f ./charts/helmfiles/aries-cloudapi-python.yaml \ - # --set image.tag=${{ env.IMAGE_TAG }} \ - # --set image.registry=ghcr.io/${{ github.repository_owner }} - # helm-plugins: | - # https://github.com/databus23/helm-diff, - # https://github.com/jkroepke/helm-secrets - # helmfile-version: ${{ env.HELMFILE_VERSION }} - # helm-version: ${{ env.HELM_VERSION }} - # env: - # IMAGE_TAG: ${{ needs.build.outputs.image_version }} - - name: Helmfile Destroy id: destroy_deployments if: github.event.inputs.run-reset-deployments == 'true' @@ -484,7 +466,7 @@ jobs: env: IMAGE_TAG: ${{ needs.build.outputs.image_version }} - - name: Helmfile Apply (Exclude Agents) # Always exclude agents and apply (zero diff if resetting deployments) + - name: Helmfile Apply (RDS Proxy) # Always exclude agents and apply (zero diff if resetting deployments) if: github.event.inputs.run-reset-deployments != 'true' uses: helmfile/helmfile-action@v1.9.1 with: @@ -494,37 +476,7 @@ jobs: -f ./charts/helmfiles/aries-cloudapi-python.yaml \ --state-values-set image.tag=${{ env.IMAGE_TAG }} \ --state-values-set image.registry=ghcr.io/${{ github.repository_owner }} \ - --selector app!=governance-ga-agent,app!=governance-multitenant-agent - helm-plugins: | - https://github.com/databus23/helm-diff, - https://github.com/jkroepke/helm-secrets - helmfile-version: ${{ env.HELMFILE_VERSION }} - helm-version: ${{ env.HELM_VERSION }} - env: - IMAGE_TAG: ${{ needs.build.outputs.image_version }} - - - name: Create values file - run: | - echo 'env:' > ./charts/helmfiles/acapy-wallet-storage-config.yaml - echo ' ACAPY_WALLET_STORAGE_CONFIG: |-' >> ./charts/helmfiles/acapy-wallet-storage-config.yaml - echo ' ${{ secrets.ACAPY_WALLET_STORAGE_CONFIG }}' >> ./charts/helmfiles/acapy-wallet-storage-config.yaml - pwd - ls -la - - - name: Helmfile Patch Proxy # Always patch agents with proxy. - id: patch_proxy - uses: helmfile/helmfile-action@v1.9.1 - with: - helmfile-args: | - apply \ - --environment ${{ vars.ENVIRONMENT }} \ - -f ./charts/helmfiles/aries-cloudapi-python.yaml \ - --state-values-set image.tag=${{ env.IMAGE_TAG }} \ - --state-values-set image.registry=ghcr.io/${{ github.repository_owner }} \ - --selector app=governance-ga-agent \ - --selector app=governance-multitenant-agent \ - --set env.WALLET_DB_HOST=${{ secrets.DB_PROXY_HOST }} \ - --values acapy-wallet-storage-config.yaml + --state-values-set rdsProxyEnabled=true helm-plugins: | https://github.com/databus23/helm-diff, https://github.com/jkroepke/helm-secrets From 6c7cd409e9cfb21bdb1a2eb618e9658d5a99e43e Mon Sep 17 00:00:00 2001 From: wdbasson Date: Tue, 13 Aug 2024 18:32:49 +0200 Subject: [PATCH 2/4] Override regression pytest helm command by setting state values --- .github/workflows/continuous-deploy.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-deploy.yml b/.github/workflows/continuous-deploy.yml index adf96769d..e2359fda5 100644 --- a/.github/workflows/continuous-deploy.yml +++ b/.github/workflows/continuous-deploy.yml @@ -604,7 +604,7 @@ jobs: --state-values-set release=cloudapi-pytest-regression \ --set fullnameOverride=cloudapi-pytest-regression \ --set env.RUN_REGRESSION_TESTS="true" \ - --set command[2]=pytest + --state-values-set regressionEnabled=true helm-plugins: | https://github.com/databus23/helm-diff, https://github.com/jkroepke/helm-secrets @@ -629,8 +629,7 @@ jobs: --set fullnameOverride=cloudapi-pytest-regression \ --set env.RUN_REGRESSION_TESTS="true" \ --set env.FAIL_ON_RECREATING_FIXTURES="true" \ - --set command[2]="pytest --junitxml="/mnt/test_output.xml" --cov-report=term-missing:skip-covered --cov=trustregistry --cov=app --cov=endorser --cov=webhooks | tee /mnt/test_coverage.txt" - + --state-values-set regressionEnabled=true helm-plugins: | https://github.com/databus23/helm-diff, https://github.com/jkroepke/helm-secrets From 85a92437e9975a665e19e691e0d63a776dbd1e23 Mon Sep 17 00:00:00 2001 From: wdbasson Date: Tue, 13 Aug 2024 19:20:33 +0200 Subject: [PATCH 3/4] Start regression tests before clean tests because they take longer --- .github/workflows/continuous-deploy.yml | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/continuous-deploy.yml b/.github/workflows/continuous-deploy.yml index e2359fda5..4263a00e3 100644 --- a/.github/workflows/continuous-deploy.yml +++ b/.github/workflows/continuous-deploy.yml @@ -567,9 +567,9 @@ jobs: authkey: ${{ secrets.TAILSCALE_AUTHKEY }} version: ${{ env.TAILSCALE_VERSION }} - - name: Helmfile run pytest - if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-tests != 'false') }} - id: pytest + - name: Helmfile init regression pytest + if: github.event.inputs.run-reset-deployments == 'true' && github.event.inputs.run-regression-tests == 'true' + id: pytest-init-regression uses: helmfile/helmfile-action@v1.9.1 with: helmfile-args: | @@ -579,8 +579,10 @@ jobs: --set image.tag=${{ env.IMAGE_TAG }} \ --set image.registry=ghcr.io/${{ github.repository_owner }} \ --set completions=${{ env.PYTEST_COMPLETIONS }} \ - --state-values-set release=cloudapi-pytest \ - --set fullnameOverride=cloudapi-pytest + --state-values-set release=cloudapi-pytest-regression \ + --set fullnameOverride=cloudapi-pytest-regression \ + --set env.RUN_REGRESSION_TESTS="true" \ + --state-values-set regressionEnabled=true helm-plugins: | https://github.com/databus23/helm-diff, https://github.com/jkroepke/helm-secrets @@ -589,9 +591,9 @@ jobs: env: IMAGE_TAG: ${{ needs.build.outputs.image_version }} - - name: Helmfile init regression pytest - if: github.event.inputs.run-reset-deployments == 'true' && github.event.inputs.run-regression-tests == 'true' - id: pytest-init-regression + - name: Helmfile run regression pytest + if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-reset-deployments == 'false' && github.event.inputs.run-regression-tests == 'true') }} + id: pytest-run-regression uses: helmfile/helmfile-action@v1.9.1 with: helmfile-args: | @@ -604,6 +606,7 @@ jobs: --state-values-set release=cloudapi-pytest-regression \ --set fullnameOverride=cloudapi-pytest-regression \ --set env.RUN_REGRESSION_TESTS="true" \ + --set env.FAIL_ON_RECREATING_FIXTURES="true" \ --state-values-set regressionEnabled=true helm-plugins: | https://github.com/databus23/helm-diff, @@ -613,9 +616,9 @@ jobs: env: IMAGE_TAG: ${{ needs.build.outputs.image_version }} - - name: Helmfile run regression pytest - if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-reset-deployments == 'false' && github.event.inputs.run-regression-tests == 'true') }} - id: pytest-run-regression + - name: Helmfile run pytest + if: ${{ github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run-tests != 'false') }} + id: pytest uses: helmfile/helmfile-action@v1.9.1 with: helmfile-args: | @@ -625,11 +628,8 @@ jobs: --set image.tag=${{ env.IMAGE_TAG }} \ --set image.registry=ghcr.io/${{ github.repository_owner }} \ --set completions=${{ env.PYTEST_COMPLETIONS }} \ - --state-values-set release=cloudapi-pytest-regression \ - --set fullnameOverride=cloudapi-pytest-regression \ - --set env.RUN_REGRESSION_TESTS="true" \ - --set env.FAIL_ON_RECREATING_FIXTURES="true" \ - --state-values-set regressionEnabled=true + --state-values-set release=cloudapi-pytest \ + --set fullnameOverride=cloudapi-pytest helm-plugins: | https://github.com/databus23/helm-diff, https://github.com/jkroepke/helm-secrets From 67b9adfd307b36e7f3f5d9ab64d75fc96f4deff9 Mon Sep 17 00:00:00 2001 From: wdbasson Date: Wed, 14 Aug 2024 13:10:03 +0200 Subject: [PATCH 4/4] Update .github/workflows/continuous-deploy.yml Co-authored-by: Robbie Blaine <4052340+rblaine95@users.noreply.github.com> --- .github/workflows/continuous-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-deploy.yml b/.github/workflows/continuous-deploy.yml index 4263a00e3..324066ae1 100644 --- a/.github/workflows/continuous-deploy.yml +++ b/.github/workflows/continuous-deploy.yml @@ -466,7 +466,7 @@ jobs: env: IMAGE_TAG: ${{ needs.build.outputs.image_version }} - - name: Helmfile Apply (RDS Proxy) # Always exclude agents and apply (zero diff if resetting deployments) + - name: Helmfile Apply (RDS Proxy) if: github.event.inputs.run-reset-deployments != 'true' uses: helmfile/helmfile-action@v1.9.1 with: