From 4beba4e5fe882755a5dc36e84a62f2b5a99798c6 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 12 Jul 2024 13:54:19 +0100 Subject: [PATCH 1/4] 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 020a031eb5..c995f148a0 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 5596a4a42c..2495785010 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 7481e5e4c9..124822a538 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 8770c6771c..28d1c0ebd7 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 3f2cc9ae9a..acb18abbd1 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 f3b6ecf392..0a2da02ecf 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 3d113d5d1e..68db8a1968 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 2095913f29..0e6b066a43 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 e3eca3282e..3ef166166a 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 aeb56bda94..c89bd645b7 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 3adf6cb578..657854b94f 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 2b6c12c92c..d68897f71a 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 a321233482..e63ffa76a0 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 41647df7d2..34df5b99a6 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 6429afee5f..e6c311d737 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 ba7978463c..c16fc69be8 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 605bfb95d2..22f4ab356d 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/4] 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 c995f148a0..166a874d5d 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 2495785010..1f465d795d 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 124822a538..c4961a8366 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 28d1c0ebd7..744112e17d 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 acb18abbd1..e5e42b4495 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/4] 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 56e76603e1..4ea9dc3d3d 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 From fbbfeae32de719bdf8cefc0362a23028dfa1dc4a Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 12 Jul 2024 16:08:39 +0100 Subject: [PATCH 4/4] Remove use of actions.preTest --- .../internal/pkg/templates/bridged-provider.config.yaml | 9 --------- .../bridged-provider/.github/workflows/main.yml | 3 --- .../bridged-provider/.github/workflows/nightly-test.yml | 3 --- .../bridged-provider/.github/workflows/prerelease.yml | 3 --- .../bridged-provider/.github/workflows/prerequisites.yml | 3 --- .../bridged-provider/.github/workflows/release.yml | 3 --- .../.github/workflows/run-acceptance-tests.yml | 3 --- 7 files changed, 27 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider.config.yaml b/provider-ci/internal/pkg/templates/bridged-provider.config.yaml index 166a874d5d..3338b6d892 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider.config.yaml +++ b/provider-ci/internal/pkg/templates/bridged-provider.config.yaml @@ -112,15 +112,6 @@ env: # Bridge-related - could be set in makefile instead? TF_APPEND_USER_AGENT: pulumi -# actions can contain preBuild and preTest additional steps to be spliced into workflows. -# The use of these hooks vary - quite a few just build upstream and run provider tests. -# Usage: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22actions%3A%22&type=code -actions: {} - # preBuild: - # - Your action here - # preTest: - # - Your action here - # Additional tests run as part of `run-acceptance-tests.yml`, `master.yml`, `main.yml`, # `prerelease.yml` and `release.yml`. # Only used for aws: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22extraTests%3A%22&type=code 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 1f465d795d..400b873533 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 @@ -211,9 +211,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 -#{{- if .Config.actions.preTest }}# -#{{ .Config.actions.preTest | toYaml | indent 4 }}# -#{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Run provider tests working-directory: provider 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 4ea9dc3d3d..1b7ba2f2a1 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 @@ -124,9 +124,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 -#{{- if .Config.actions.preTest }}# -#{{ .Config.actions.preTest | toYaml | indent 4 }}# -#{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Run provider tests if: matrix.testTarget == 'local' 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 c4961a8366..4c223f57f1 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 @@ -152,9 +152,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 -#{{- if .Config.actions.preTest }}# -#{{ .Config.actions.preTest | toYaml | indent 4 }}# -#{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Run provider tests working-directory: provider diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml index f8802fd5ea..fdc125c88d 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml @@ -57,9 +57,6 @@ jobs: uses: ./.github/actions/setup-tools with: tools: go, pulumictl, pulumicli, schema-tools -#{{- if .Config.actions.preBuild }}# -#{{ .Config.actions.preBuild | toYaml | indent 4 }}# -#{{- end }}# - name: Build schema generator binary run: make tfgen_build_only - name: Install plugins 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 744112e17d..1f5cbdd058 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 @@ -151,9 +151,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 -#{{- if .Config.actions.preTest }}# -#{{ .Config.actions.preTest | toYaml | indent 4 }}# -#{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Run provider tests working-directory: provider 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 e5e42b4495..fd7687ea1b 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 @@ -194,9 +194,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 -#{{- if .Config.actions.preTest }}# -#{{ .Config.actions.preTest | toYaml | indent 4 }}# -#{{- end }}# #{{- if .Config.integrationTestProvider }}# - name: Run provider tests if: matrix.testTarget == 'local'