From 4beba4e5fe882755a5dc36e84a62f2b5a99798c6 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 12 Jul 2024 13:54:19 +0100 Subject: [PATCH 1/3] Add integrationTestProvider option - Prepare upstream if we're running tests via the provider module. - Run `make upstream` before running any extra `setup-script`. - Only run provider integration tests on PRs if we're in "local" mode and not "pulumiExamples". - Format main test command to avoid confusing line break. --- .../pkg/templates/bridged-provider.config.yaml | 3 +++ .../bridged-provider/.github/workflows/main.yml | 12 ++++++++++-- .../.github/workflows/prerelease.yml | 12 ++++++++++-- .../bridged-provider/.github/workflows/release.yml | 12 ++++++++++-- .../.github/workflows/run-acceptance-tests.yml | 13 +++++++++++-- .../test-providers/aws/.github/workflows/master.yml | 3 +-- .../aws/.github/workflows/prerelease.yml | 3 +-- .../aws/.github/workflows/release.yml | 3 +-- .../aws/.github/workflows/run-acceptance-tests.yml | 3 +-- .../cloudflare/.github/workflows/master.yml | 3 +-- .../cloudflare/.github/workflows/prerelease.yml | 3 +-- .../cloudflare/.github/workflows/release.yml | 3 +-- .../.github/workflows/run-acceptance-tests.yml | 3 +-- .../docker/.github/workflows/master.yml | 3 +-- .../docker/.github/workflows/prerelease.yml | 3 +-- .../docker/.github/workflows/release.yml | 3 +-- .../.github/workflows/run-acceptance-tests.yml | 3 +-- 17 files changed, 56 insertions(+), 32 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider.config.yaml b/provider-ci/internal/pkg/templates/bridged-provider.config.yaml index 020a031eb..c995f148a 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider.config.yaml +++ b/provider-ci/internal/pkg/templates/bridged-provider.config.yaml @@ -129,6 +129,9 @@ extraTests: # name: My Test # ... +# Run e2e tests in the provider as well as in the examples directory +integrationTestProvider: false + # Run e2e tests using the examples and test suite in the pulumi/examples repo. # This is unused: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22testPulumiExamples%3A%22&type=code testPulumiExamples: false diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml index 5596a4a42..249578501 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml @@ -190,6 +190,10 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Prepare upstream code + run: make upstream + #{{- end }}# #{{- if index .Config "setup-script" }}# - name: Run setup script run: #{{ index .Config "setup-script" }}# @@ -204,9 +208,13 @@ jobs: #{{- if .Config.actions.preTest }}# #{{ .Config.actions.preTest | toYaml | indent 4 }}# #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Run provider tests + working-directory: provider + run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + #{{- end }}# - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml index 7481e5e4c..124822a53 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml @@ -131,6 +131,10 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Prepare upstream code + run: make upstream + #{{- end }}# #{{- if index .Config "setup-script" }}# - name: Run setup script run: #{{ index .Config "setup-script" }}# @@ -145,9 +149,13 @@ jobs: #{{- if .Config.actions.preTest }}# #{{ .Config.actions.preTest | toYaml | indent 4 }}# #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Run provider tests + working-directory: provider + run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + #{{- end }}# - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml index 8770c6771..28d1c0ebd 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml @@ -130,6 +130,10 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Prepare upstream code + run: make upstream + #{{- end }}# #{{- if index .Config "setup-script" }}# - name: Run setup script run: #{{ index .Config "setup-script" }}# @@ -144,9 +148,13 @@ jobs: #{{- if .Config.actions.preTest }}# #{{ .Config.actions.preTest | toYaml | indent 4 }}# #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Run provider tests + working-directory: provider + run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + #{{- end }}# - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml index 3f2cc9ae9..acb18abbd 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml @@ -173,6 +173,10 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Prepare upstream code + run: make upstream + #{{- end }}# #{{- if index .Config "setup-script" }}# - name: Run setup script run: #{{ index .Config "setup-script" }}# @@ -187,10 +191,15 @@ jobs: #{{- if .Config.actions.preTest }}# #{{ .Config.actions.preTest | toYaml | indent 4 }}# #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Run provider tests + if: matrix.testTarget == 'local' + working-directory: provider + run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + #{{- end }}# - name: Run tests if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run pulumi/examples tests if: matrix.testTarget == 'pulumiExamples' run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ diff --git a/provider-ci/test-providers/aws/.github/workflows/master.yml b/provider-ci/test-providers/aws/.github/workflows/master.yml index f3b6ecf39..0a2da02ec 100644 --- a/provider-ci/test-providers/aws/.github/workflows/master.yml +++ b/provider-ci/test-providers/aws/.github/workflows/master.yml @@ -181,8 +181,7 @@ jobs: - name: Make upstream run: make upstream - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml index 3d113d5d1..68db8a196 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml @@ -124,8 +124,7 @@ jobs: - name: Make upstream run: make upstream - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/aws/.github/workflows/release.yml b/provider-ci/test-providers/aws/.github/workflows/release.yml index 2095913f2..0e6b066a4 100644 --- a/provider-ci/test-providers/aws/.github/workflows/release.yml +++ b/provider-ci/test-providers/aws/.github/workflows/release.yml @@ -123,8 +123,7 @@ jobs: - name: Make upstream run: make upstream - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml index e3eca3282..3ef166166 100644 --- a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml @@ -162,8 +162,7 @@ jobs: run: make upstream - name: Run tests if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run pulumi/examples tests if: matrix.testTarget == 'pulumiExamples' run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml index aeb56bda9..c89bd645b 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml @@ -166,8 +166,7 @@ jobs: run: | cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml index 3adf6cb57..657854b94 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml @@ -111,8 +111,7 @@ jobs: run: | cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml index 2b6c12c92..d68897f71 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml @@ -110,8 +110,7 @@ jobs: run: | cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml index a32123348..e63ffa76a 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml @@ -153,8 +153,7 @@ jobs: cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run pulumi/examples tests if: matrix.testTarget == 'pulumiExamples' run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ diff --git a/provider-ci/test-providers/docker/.github/workflows/master.yml b/provider-ci/test-providers/docker/.github/workflows/master.yml index 41647df7d..34df5b99a 100644 --- a/provider-ci/test-providers/docker/.github/workflows/master.yml +++ b/provider-ci/test-providers/docker/.github/workflows/master.yml @@ -200,8 +200,7 @@ jobs: with: ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml index 6429afee5..e6c311d73 100644 --- a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml @@ -145,8 +145,7 @@ jobs: with: ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/docker/.github/workflows/release.yml b/provider-ci/test-providers/docker/.github/workflows/release.yml index ba7978463..c16fc69be 100644 --- a/provider-ci/test-providers/docker/.github/workflows/release.yml +++ b/provider-ci/test-providers/docker/.github/workflows/release.yml @@ -144,8 +144,7 @@ jobs: with: ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: diff --git a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml index 605bfb95d..22f4ab356 100644 --- a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml @@ -187,8 +187,7 @@ jobs: ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - name: Run tests if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run pulumi/examples tests if: matrix.testTarget == 'pulumiExamples' run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ From ea2b0d9fd946012f477dd8471302f25e9712bc13 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 12 Jul 2024 15:46:10 +0100 Subject: [PATCH 2/3] Add sskPrivateKey option for test setup This addresses the use of the preTest hook in the docker provider. --- .../internal/pkg/templates/bridged-provider.config.yaml | 5 +++++ .../templates/bridged-provider/.github/workflows/main.yml | 6 ++++++ .../bridged-provider/.github/workflows/prerelease.yml | 6 ++++++ .../bridged-provider/.github/workflows/release.yml | 6 ++++++ .../.github/workflows/run-acceptance-tests.yml | 6 ++++++ 5 files changed, 29 insertions(+) diff --git a/provider-ci/internal/pkg/templates/bridged-provider.config.yaml b/provider-ci/internal/pkg/templates/bridged-provider.config.yaml index c995f148a..166a874d5 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider.config.yaml +++ b/provider-ci/internal/pkg/templates/bridged-provider.config.yaml @@ -211,6 +211,11 @@ publish: # Used in 9 providers: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22docker%3A%22&type=code #docker: false +# Setup SSH with specified private key before running tests in CI job. +# This should be provided from a secret +# Used by the docker provider only: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22sshPrivateKey%3A%22&type=code +#sshPrivateKey: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} + # Authenticate with GCP before running tests in CI job # Used in gcp and docker: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22gcp%3A%22&type=code #gcp: false diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml index 249578501..1f465d795 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml @@ -190,6 +190,12 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.sshPrivateKey }}# + - name: Setup SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: #{{ .Config.sshPrivateKey }}# + #{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Prepare upstream code run: make upstream diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml index 124822a53..c4961a836 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml @@ -131,6 +131,12 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.sshPrivateKey }}# + - name: Setup SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: #{{ .Config.sshPrivateKey }}# + #{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Prepare upstream code run: make upstream diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml index 28d1c0ebd..744112e17 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml @@ -130,6 +130,12 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.sshPrivateKey }}# + - name: Setup SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: #{{ .Config.sshPrivateKey }}# + #{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Prepare upstream code run: make upstream diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml index acb18abbd..e5e42b449 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml @@ -173,6 +173,12 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.sshPrivateKey }}# + - name: Setup SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: #{{ .Config.sshPrivateKey }}# + #{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Prepare upstream code run: make upstream From a8d1fff27fdd9b627209b2e1709bdd8de8811c26 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 12 Jul 2024 16:10:08 +0100 Subject: [PATCH 3/3] Apply to nightly-test workflow --- .../.github/workflows/nightly-test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml index 56e76603e..4ea9dc3d3 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml @@ -103,6 +103,16 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker #{{- end }}# + #{{- if .Config.sshPrivateKey }}# + - name: Setup SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: #{{ .Config.sshPrivateKey }}# + #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Prepare upstream code + run: make upstream + #{{- end }}# #{{- if index .Config "setup-script" }}# - name: Run setup script run: #{{ index .Config "setup-script" }}# @@ -117,6 +127,12 @@ jobs: #{{- if .Config.actions.preTest }}# #{{ .Config.actions.preTest | toYaml | indent 4 }}# #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Run provider tests + if: matrix.testTarget == 'local' + working-directory: provider + run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + #{{- end }}# - name: Run tests run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt