Skip to content

Commit e1ae150

Browse files
authored
Simplify OIDC extraTest (#4909)
Today `TestAccCloudWatch` and `TestAccCloudWatchOidcManual` are each executed twice. Once as part of the `test (nodejs, local)` (examples) job, and again as part of the `test_oidc` job defined in `extraTests`. The `test_oidc` job executes `TestAccCloudWatchOidcManual` without any ambient AWS credentials, and then `TestAccCloudWatch` after assuming `OIDC_ROLE_ARN`. This PR removes the extra `test_oidc` job by incorporating these tests into the usual examples job. * `TestAccCloudWatch` and `TestAccCloudWatchOIDCAmbient` preserve the existing behavior of running these using the ambient credentials from the examples job. * `TestAccCloudWatchOIDCManual` and `TestAccCloudWatchOIDC` preserving the `test_oidc` behavior by running without ambient credentials and after assuming `OIDC_ROLE_ARN`, respectively.
2 parents 88369b2 + 2c34100 commit e1ae150

File tree

6 files changed

+60
-317
lines changed

6 files changed

+60
-317
lines changed

.ci-mgmt.yaml

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -127,69 +127,6 @@ extraTests:
127127
cd upstream
128128
make provider-lint
129129
130-
test_oidc:
131-
name: test_oidc
132-
needs: build_sdk
133-
permissions:
134-
contents: read
135-
id-token: write
136-
runs-on: ubuntu-latest
137-
steps:
138-
- name: Free Disk Space (Ubuntu)
139-
uses: jlumbroso/free-disk-space@main
140-
with:
141-
tool-cache: false
142-
swap-storage: false
143-
dotnet: ${{ matrix.language != 'dotnet' }}
144-
- name: Checkout Repo
145-
uses: actions/checkout@v4
146-
with:
147-
ref: ${{ env.PR_COMMIT_SHA }}
148-
submodules: true
149-
- uses: pulumi/provider-version-action@v1
150-
with:
151-
set-env: 'PROVIDER_VERSION'
152-
- name: Setup tools
153-
uses: ./.github/actions/setup-tools
154-
with:
155-
tools: pulumictl, pulumi, go, node
156-
- name: Prepare local workspace
157-
run: make prepare_local_workspace
158-
- name: Download bin
159-
uses: ./.github/actions/download-bin
160-
- name: Download SDK
161-
uses: ./.github/actions/download-sdk
162-
with:
163-
language: ${{ matrix.language }}
164-
- name: Restore makefile progress
165-
run: make --touch provider schema build_${{ matrix.language }}
166-
- name: Update path
167-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
168-
- name: Install dependencies
169-
run: make install_${{ matrix.language}}_sdk
170-
- name: Install gotestfmt
171-
uses: GoTestTools/gotestfmt-action@v2
172-
with:
173-
token: ${{ secrets.GITHUB_TOKEN }}
174-
version: v2.4.0
175-
- name: Run selected tests with manual web identity/OIDC auth
176-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
177-
- name: Configure AWS Credentials for OIDC
178-
uses: aws-actions/configure-aws-credentials@v4
179-
with:
180-
unset-current-credentials: true
181-
aws-region: ${{ env.AWS_REGION }}
182-
role-duration-seconds: 3600
183-
role-session-name: aws@githubActions
184-
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }}
185-
- name: Run selected tests with configure-aws-credentials web identity/OIDC auth
186-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
187-
strategy:
188-
fail-fast: false
189-
matrix:
190-
language:
191-
- nodejs
192-
193130
provider_test:
194131
name: provider_test
195132
needs: build_sdk

.github/workflows/master.yml

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ jobs:
101101
- license_check
102102
- go_test_shim
103103
- provider_test
104-
- test_oidc
105104
- upstream_lint
106105
uses: ./.github/workflows/publish.yml
107106
secrets: inherit
@@ -307,68 +306,6 @@ jobs:
307306
- dotnet
308307
- go
309308
- java
310-
test_oidc:
311-
name: test_oidc
312-
needs: build_sdk
313-
permissions:
314-
contents: read
315-
id-token: write
316-
runs-on: ubuntu-latest
317-
steps:
318-
- name: Free Disk Space (Ubuntu)
319-
uses: jlumbroso/free-disk-space@main
320-
with:
321-
dotnet: ${{ matrix.language != 'dotnet' }}
322-
swap-storage: false
323-
tool-cache: false
324-
- name: Checkout Repo
325-
uses: actions/checkout@v4
326-
with:
327-
ref: ${{ env.PR_COMMIT_SHA }}
328-
submodules: true
329-
- uses: pulumi/provider-version-action@v1
330-
with:
331-
set-env: PROVIDER_VERSION
332-
- name: Setup tools
333-
uses: ./.github/actions/setup-tools
334-
with:
335-
tools: pulumictl, pulumi, go, node
336-
- name: Prepare local workspace
337-
run: make prepare_local_workspace
338-
- name: Download bin
339-
uses: ./.github/actions/download-bin
340-
- name: Download SDK
341-
uses: ./.github/actions/download-sdk
342-
with:
343-
language: ${{ matrix.language }}
344-
- name: Restore makefile progress
345-
run: make --touch provider schema build_${{ matrix.language }}
346-
- name: Update path
347-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
348-
- name: Install dependencies
349-
run: make install_${{ matrix.language}}_sdk
350-
- name: Install gotestfmt
351-
uses: GoTestTools/gotestfmt-action@v2
352-
with:
353-
token: ${{ secrets.GITHUB_TOKEN }}
354-
version: v2.4.0
355-
- name: Run selected tests with manual web identity/OIDC auth
356-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
357-
- name: Configure AWS Credentials for OIDC
358-
uses: aws-actions/configure-aws-credentials@v4
359-
with:
360-
aws-region: ${{ env.AWS_REGION }}
361-
role-duration-seconds: 3600
362-
role-session-name: aws@githubActions
363-
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }}
364-
unset-current-credentials: true
365-
- name: Run selected tests with configure-aws-credentials web identity/OIDC auth
366-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
367-
strategy:
368-
fail-fast: false
369-
matrix:
370-
language:
371-
- nodejs
372309
upstream_lint:
373310
name: Run upstream provider-lint
374311
runs-on: ubuntu-latest

.github/workflows/prerelease.yml

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
- license_check
6262
- go_test_shim
6363
- provider_test
64-
- test_oidc
6564
- upstream_lint
6665
uses: ./.github/workflows/publish.yml
6766
secrets: inherit
@@ -247,68 +246,6 @@ jobs:
247246
- dotnet
248247
- go
249248
- java
250-
test_oidc:
251-
name: test_oidc
252-
needs: build_sdk
253-
permissions:
254-
contents: read
255-
id-token: write
256-
runs-on: ubuntu-latest
257-
steps:
258-
- name: Free Disk Space (Ubuntu)
259-
uses: jlumbroso/free-disk-space@main
260-
with:
261-
dotnet: ${{ matrix.language != 'dotnet' }}
262-
swap-storage: false
263-
tool-cache: false
264-
- name: Checkout Repo
265-
uses: actions/checkout@v4
266-
with:
267-
ref: ${{ env.PR_COMMIT_SHA }}
268-
submodules: true
269-
- uses: pulumi/provider-version-action@v1
270-
with:
271-
set-env: PROVIDER_VERSION
272-
- name: Setup tools
273-
uses: ./.github/actions/setup-tools
274-
with:
275-
tools: pulumictl, pulumi, go, node
276-
- name: Prepare local workspace
277-
run: make prepare_local_workspace
278-
- name: Download bin
279-
uses: ./.github/actions/download-bin
280-
- name: Download SDK
281-
uses: ./.github/actions/download-sdk
282-
with:
283-
language: ${{ matrix.language }}
284-
- name: Restore makefile progress
285-
run: make --touch provider schema build_${{ matrix.language }}
286-
- name: Update path
287-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
288-
- name: Install dependencies
289-
run: make install_${{ matrix.language}}_sdk
290-
- name: Install gotestfmt
291-
uses: GoTestTools/gotestfmt-action@v2
292-
with:
293-
token: ${{ secrets.GITHUB_TOKEN }}
294-
version: v2.4.0
295-
- name: Run selected tests with manual web identity/OIDC auth
296-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
297-
- name: Configure AWS Credentials for OIDC
298-
uses: aws-actions/configure-aws-credentials@v4
299-
with:
300-
aws-region: ${{ env.AWS_REGION }}
301-
role-duration-seconds: 3600
302-
role-session-name: aws@githubActions
303-
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }}
304-
unset-current-credentials: true
305-
- name: Run selected tests with configure-aws-credentials web identity/OIDC auth
306-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
307-
strategy:
308-
fail-fast: false
309-
matrix:
310-
language:
311-
- nodejs
312249
upstream_lint:
313250
name: Run upstream provider-lint
314251
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ jobs:
6767
- license_check
6868
- go_test_shim
6969
- provider_test
70-
- test_oidc
7170
- upstream_lint
7271
uses: ./.github/workflows/publish.yml
7372
secrets: inherit
@@ -253,68 +252,6 @@ jobs:
253252
- dotnet
254253
- go
255254
- java
256-
test_oidc:
257-
name: test_oidc
258-
needs: build_sdk
259-
permissions:
260-
contents: read
261-
id-token: write
262-
runs-on: ubuntu-latest
263-
steps:
264-
- name: Free Disk Space (Ubuntu)
265-
uses: jlumbroso/free-disk-space@main
266-
with:
267-
dotnet: ${{ matrix.language != 'dotnet' }}
268-
swap-storage: false
269-
tool-cache: false
270-
- name: Checkout Repo
271-
uses: actions/checkout@v4
272-
with:
273-
ref: ${{ env.PR_COMMIT_SHA }}
274-
submodules: true
275-
- uses: pulumi/provider-version-action@v1
276-
with:
277-
set-env: PROVIDER_VERSION
278-
- name: Setup tools
279-
uses: ./.github/actions/setup-tools
280-
with:
281-
tools: pulumictl, pulumi, go, node
282-
- name: Prepare local workspace
283-
run: make prepare_local_workspace
284-
- name: Download bin
285-
uses: ./.github/actions/download-bin
286-
- name: Download SDK
287-
uses: ./.github/actions/download-sdk
288-
with:
289-
language: ${{ matrix.language }}
290-
- name: Restore makefile progress
291-
run: make --touch provider schema build_${{ matrix.language }}
292-
- name: Update path
293-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
294-
- name: Install dependencies
295-
run: make install_${{ matrix.language}}_sdk
296-
- name: Install gotestfmt
297-
uses: GoTestTools/gotestfmt-action@v2
298-
with:
299-
token: ${{ secrets.GITHUB_TOKEN }}
300-
version: v2.4.0
301-
- name: Run selected tests with manual web identity/OIDC auth
302-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
303-
- name: Configure AWS Credentials for OIDC
304-
uses: aws-actions/configure-aws-credentials@v4
305-
with:
306-
aws-region: ${{ env.AWS_REGION }}
307-
role-duration-seconds: 3600
308-
role-session-name: aws@githubActions
309-
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }}
310-
unset-current-credentials: true
311-
- name: Run selected tests with configure-aws-credentials web identity/OIDC auth
312-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
313-
strategy:
314-
fail-fast: false
315-
matrix:
316-
language:
317-
- nodejs
318255
upstream_lint:
319256
name: Run upstream provider-lint
320257
runs-on: ubuntu-latest

.github/workflows/run-acceptance-tests.yml

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ jobs:
9696
- license_check
9797
- go_test_shim
9898
- provider_test
99-
- test_oidc
10099
- upstream_lint
101100
runs-on: ubuntu-latest
102101
steps:
@@ -308,68 +307,6 @@ jobs:
308307
- dotnet
309308
- go
310309
- java
311-
test_oidc:
312-
name: test_oidc
313-
needs: build_sdk
314-
permissions:
315-
contents: read
316-
id-token: write
317-
runs-on: ubuntu-latest
318-
steps:
319-
- name: Free Disk Space (Ubuntu)
320-
uses: jlumbroso/free-disk-space@main
321-
with:
322-
dotnet: ${{ matrix.language != 'dotnet' }}
323-
swap-storage: false
324-
tool-cache: false
325-
- name: Checkout Repo
326-
uses: actions/checkout@v4
327-
with:
328-
ref: ${{ env.PR_COMMIT_SHA }}
329-
submodules: true
330-
- uses: pulumi/provider-version-action@v1
331-
with:
332-
set-env: PROVIDER_VERSION
333-
- name: Setup tools
334-
uses: ./.github/actions/setup-tools
335-
with:
336-
tools: pulumictl, pulumi, go, node
337-
- name: Prepare local workspace
338-
run: make prepare_local_workspace
339-
- name: Download bin
340-
uses: ./.github/actions/download-bin
341-
- name: Download SDK
342-
uses: ./.github/actions/download-sdk
343-
with:
344-
language: ${{ matrix.language }}
345-
- name: Restore makefile progress
346-
run: make --touch provider schema build_${{ matrix.language }}
347-
- name: Update path
348-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
349-
- name: Install dependencies
350-
run: make install_${{ matrix.language}}_sdk
351-
- name: Install gotestfmt
352-
uses: GoTestTools/gotestfmt-action@v2
353-
with:
354-
token: ${{ secrets.GITHUB_TOKEN }}
355-
version: v2.4.0
356-
- name: Run selected tests with manual web identity/OIDC auth
357-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
358-
- name: Configure AWS Credentials for OIDC
359-
uses: aws-actions/configure-aws-credentials@v4
360-
with:
361-
aws-region: ${{ env.AWS_REGION }}
362-
role-duration-seconds: 3600
363-
role-session-name: aws@githubActions
364-
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }}
365-
unset-current-credentials: true
366-
- name: Run selected tests with configure-aws-credentials web identity/OIDC auth
367-
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
368-
strategy:
369-
fail-fast: false
370-
matrix:
371-
language:
372-
- nodejs
373310
upstream_lint:
374311
name: Run upstream provider-lint
375312
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)