Skip to content

Commit

Permalink
Remove unused extraTests (#1230)
Browse files Browse the repository at this point in the history
https://github.com/search?q=org%3Apulumi%20path%3A.ci-mgmt.yaml%20extraTests&type=code

The extra tests in AWS have all been refactored as more typical
unit/integration tests, so this configuration is no longer needed.

This PR removes the config and updates the test provider's
`ci-mgmt.yaml` to reflect the currently checked-in copy.
  • Loading branch information
blampe authored Dec 16, 2024
1 parent 532904f commit 538e600
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 463 deletions.
5 changes: 0 additions & 5 deletions provider-ci/internal/pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ type Config struct {
// https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22actions%3A%22&type=code
Actions actions `yaml:"actions"`

// ExtraTests 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
ExtraTests map[string]any `yaml:"extraTests"` // Only used by AWS...

// IntegrationTestProvider will run e2e tests in the provider as well as in
// the examples directory when set to true. Defaults to false.
IntegrationTestProvider bool `yaml:"integrationTestProvider"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,3 @@ jobs:
#{{- else }}#
testTarget: [local]
#{{- end }}#
#{{- if .Config.ExtraTests }}#
#{{ .Config.ExtraTests | toYaml | indent 2 }}#
#{{ end }}#
8 changes: 0 additions & 8 deletions provider-ci/internal/pkg/templates/defaults.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,6 @@ actions:
# 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
extraTests:
# your_test_name:
# name: My Test
# ...

# Run e2e tests in the provider as well as in the examples directory
integrationTestProvider: false

Expand Down
238 changes: 10 additions & 228 deletions provider-ci/test-providers/aws/.ci-mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ parallel: 1
timeout: 150
generate-nightly-test-workflow: true
providerVersion: github.com/hashicorp/terraform-provider-aws/version.ProviderVersion
toolVersions:
dotnet: "6.0.x"
go: "1.23.x"
java: "11"
gradle: "7.6"
nodejs: "20.x"
pulumi: "dev"
python: "3.11.8"
env:
PULUMI_MISSING_DOCS_ERROR: true
AWS_REGION: "us-west-2"
OIDC_ROLE_ARN: ${{ secrets.OIDC_ROLE_ARN }}
template: bridged-provider
makeTemplate: bridged
checkoutSubmodules: true
freeDiskSpaceBeforeBuild: true
freeDiskSpaceBeforeSdkBuild: true
Expand Down Expand Up @@ -50,234 +58,8 @@ actions:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ env.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-duration-seconds: 3600
role-duration-seconds: 7200
role-session-name: aws@githubActions
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
- name: Make upstream
run: make upstream

extraTests:
go_test_shim:
name: Run test of provider shim
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ env.PR_COMMIT_SHA }}
submodules: true
- uses: pulumi/provider-version-action@v1
with:
set-env: 'PROVIDER_VERSION'
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumi, go
- name: Make upstream
run: make upstream
- name: go test
run: |
cd upstream
go get github.com/hashicorp/aws-sdk-go-base@v1.1.0
cd shim
go test -v -coverprofile="coverage.txt" .
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

upstream_lint:
name: Run upstream provider-lint
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
swap-storage: false
tool-cache: false
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ env.PR_COMMIT_SHA }}
submodules: true
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
cache: false
- name: Make upstream
run: make upstream
- name: upstream lint
run: |
cd upstream
make provider-lint
test_oidc:
name: test_oidc
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
swap-storage: false
dotnet: ${{ matrix.language != 'dotnet' }}
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ env.PR_COMMIT_SHA }}
submodules: true
- uses: pulumi/provider-version-action@v1
with:
set-env: 'PROVIDER_VERSION'
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumi, go, node
- name: Download provider + tfgen binaries
uses: actions/download-artifact@v4
with:
name: aws-provider.tar.gz
path: ${{ github.workspace }}/bin
- name: Untar provider binaries
run: >-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace}}/bin
find ${{ github.workspace }} -name "pulumi-*-aws" -print -exec chmod +x {} \;
- name: Download SDK
uses: actions/download-artifact@v4
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress SDK folder
run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{
github.workspace }}/sdk/${{ matrix.language }}
- name: Update path
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Install dependencies
run: make install_${{ matrix.language}}_sdk
- name: Install gotestfmt
uses: GoTestTools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: v2.4.0
- name: Make upstream
run: make upstream
- name: Run selected tests with manual web identity/OIDC auth
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: Configure AWS Credentials for OIDC
uses: aws-actions/configure-aws-credentials@v4
with:
unset-current-credentials: true
aws-region: ${{ env.AWS_REGION }}
role-duration-seconds: 3600
role-session-name: aws@githubActions
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }}
- name: Run selected tests with configure-aws-credentials web identity/OIDC auth
run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
with:
author_name: Failure in running ${{ matrix.language }} tests
fields: repo,commit,author,action
status: ${{ job.status }}
strategy:
fail-fast: false
matrix:
language:
- nodejs

provider_test:
name: provider_test
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
swap-storage: false
tool-cache: false
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ env.PR_COMMIT_SHA }}
submodules: true
- uses: pulumi/provider-version-action@v1
with:
set-env: 'PROVIDER_VERSION'
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumi, go, node, dotnet, python, java
- name: Make upstream
run: make upstream
- name: Download provider + tfgen binaries
uses: actions/download-artifact@v4
with:
name: aws-provider.tar.gz
path: ${{ github.workspace }}/bin
- name: Untar provider binaries
run: >-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace}}/bin
find ${{ github.workspace }} -name "pulumi-*-aws" -print -exec chmod +x {} \;
- run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Download SDK
uses: actions/download-artifact@v4
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress SDK folder
run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{
github.workspace }}/sdk/${{ matrix.language }}
- name: Update path
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Install Python deps
run: |-
pip3 install virtualenv==20.0.23
pip3 install pipenv
- name: Install dependencies
run: make install_${{ matrix.language}}_sdk
- name: Install gotestfmt
uses: GoTestTools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: v2.5.0
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ env.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-duration-seconds: 3600
role-session-name: aws@githubActions
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
- name: Run provider tests
run: |
cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
with:
author_name: Failure in running ${{ matrix.language }} provider tests
fields: repo,commit,author,action
status: ${{ job.status }}
strategy:
fail-fast: false
matrix:
language:
- nodejs
- python
- dotnet
- go
- java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
if: inputs.tools == 'all' || contains(inputs.tools, 'go')
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: "1.21.x"
go-version: "1.23.x"
cache-dependency-path: |
provider/*.sum
upstream/*.sum
Expand Down
Loading

0 comments on commit 538e600

Please sign in to comment.