-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run unit tests in separate job #3666
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0f572c8
run unit tests in separate job
guineveresaenger 1f54dc5
Provide Node and Python
guineveresaenger fff97a8
tar?
guineveresaenger 68c2144
Run unit tests as extra test
guineveresaenger 8dd474c
Use full language matrix and tweak naming
guineveresaenger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,9 +58,6 @@ actions: | |
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | ||
- name: Make upstream | ||
run: make upstream | ||
- 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 | ||
preBuild: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
|
@@ -202,3 +199,138 @@ extraTests: | |
matrix: | ||
language: | ||
- nodejs | ||
|
||
provider_test: | ||
if: github.event_name == 'repository_dispatch' || | ||
github.event.pull_request.head.repo.full_name == github.repository | ||
name: provider_test | ||
needs: build_sdk | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.PR_COMMIT_SHA }} | ||
submodules: true | ||
- name: Checkout Scripts Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ci-scripts | ||
repository: pulumi/scripts | ||
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 | ||
- name: Unshallow clone for tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: | | ||
sdk/go.sum | ||
go-version: 1.21.x | ||
- name: Install pulumictl | ||
uses: jaxxstorm/[email protected] | ||
with: | ||
tag: v0.0.46 | ||
repo: pulumi/pulumictl | ||
- name: Install Pulumi CLI | ||
uses: pulumi/actions@v5 | ||
with: | ||
pulumi-version: ^3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODEVERSION }} | ||
registry-url: https://registry.npmjs.org | ||
- name: Setup DotNet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNETVERSION }} | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHONVERSION }} | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
cache: gradle | ||
distribution: temurin | ||
java-version: ${{ env.JAVAVERSION }} | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
gradle-version: ${{ env.GRADLEVERSION }} | ||
- name: Download provider + tfgen binaries | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ env.PROVIDER }}-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-*-${{ env.PROVIDER }}" -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: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
swap-storage: false | ||
tool-cache: false | ||
- if: ${{ matrix.language == 'dotnet' }} | ||
name: Setup DotNet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNETVERSION }} | ||
- 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: ${{ env.PROVIDER }}@githubActions | ||
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | ||
- name: Make upstream | ||
run: make upstream | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -296,6 +296,7 @@ jobs: | |
- test | ||
- license_check | ||
- go_test_shim | ||
- provider_test | ||
- test_oidc | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -502,9 +503,6 @@ jobs: | |
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | ||
- name: Make upstream | ||
run: make upstream | ||
- 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 | ||
- 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 | ||
|
@@ -556,6 +554,142 @@ jobs: | |
name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
timeout-minutes: 60 | ||
provider_test: | ||
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository | ||
name: provider_test | ||
needs: build_sdk | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.PR_COMMIT_SHA }} | ||
submodules: true | ||
- name: Checkout Scripts Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ci-scripts | ||
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 | ||
repository: pulumi/scripts | ||
- if: matrix.testTarget == 'pulumiExamples' | ||
name: Checkout p/examples | ||
uses: actions/checkout@v4 | ||
with: | ||
path: p-examples | ||
repository: pulumi/examples | ||
- name: Unshallow clone for tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: | | ||
sdk/go.sum | ||
go-version: 1.21.x | ||
- name: Install pulumictl | ||
uses: jaxxstorm/[email protected] | ||
with: | ||
repo: pulumi/pulumictl | ||
tag: v0.0.46 | ||
- name: Install Pulumi CLI | ||
uses: pulumi/actions@v5 | ||
with: | ||
pulumi-version: ^3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODEVERSION }} | ||
registry-url: https://registry.npmjs.org | ||
- name: Setup DotNet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNETVERSION }} | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHONVERSION }} | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
cache: gradle | ||
distribution: temurin | ||
java-version: ${{ env.JAVAVERSION }} | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
with: | ||
gradle-version: ${{ env.GRADLEVERSION }} | ||
- name: Download provider + tfgen binaries | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ env.PROVIDER }}-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-*-${{ env.PROVIDER }}" -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: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
swap-storage: false | ||
tool-cache: false | ||
- if: ${{ matrix.language == 'dotnet' }} | ||
name: Setup DotNet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNETVERSION }} | ||
- 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: ${{ env.PROVIDER }}@githubActions | ||
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | ||
- name: Make upstream | ||
run: make upstream | ||
- 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 | ||
test_oidc: | ||
name: test_oidc | ||
needs: build_sdk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost guaranteed that we will forget to edit this when adding go tests. I'd prefer a full matrix.