Skip to content
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

Move integration tests to ./tests #1490

Merged
merged 9 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/eks-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ jobs:
id: test_split
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples
working-directory: tests
flags: -tags=nodejs
total: ${{ matrix.total }}
index: ${{ matrix.index }}
- name: Run tests
run: cd examples && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
strategy:
fail-fast: false
max-parallel: 10
Expand Down Expand Up @@ -368,12 +368,12 @@ jobs:
id: test_split
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples
working-directory: tests
flags: -tags=python
total: ${{ matrix.total }}
index: ${{ matrix.index }}
- name: Run tests
run: cd examples && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -470,7 +470,7 @@ jobs:
cd ${{ github.workspace }}/bin
yarn install && yarn link @pulumi/eks
- name: Run tests
run: cd examples && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
test-go:
name: Run Go Tests
needs:
Expand Down Expand Up @@ -559,7 +559,7 @@ jobs:
cd ${{ github.workspace }}/bin
yarn install && yarn link @pulumi/eks
- name: Run tests
run: cd examples && go test -tags=go -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=go -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
name: cron
"on":
schedule:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eks-record.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
inputs:
runTests:
type: string
description: "The tests in examples to record snapshots for, as a regex for `go test -run`. Defaults to `TestExamplesUpgrades`"
description: "The tests to record snapshots for, as a regex for `go test -run`. Defaults to `TestExamplesUpgrades`"
required: true
default: "TestExamplesUpgrades"
targetBranch:
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:

- name: Record provider test snapshots
run: |
cd provider && go test -tags nodejs -run '${{ inputs.runTests }}' -provider-snapshot -v -json -count=1 -cover -timeout 4h -parallel 20 . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags nodejs -run '${{ inputs.runTests }}' -provider-snapshot -v -json -count=1 -cover -timeout 4h -parallel 20 . 2>&1 | tee /tmp/gotest.log | gotestfmt

# TODO,tkappler Not sure why this is happening, but gotestfmt-action seems to download and unpack into the repository's root folder.
# https://github.com/GoTestTools/gotestfmt-action/blob/v2/index.js#L6
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,12 @@ jobs:
id: test_split
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples
working-directory: tests
flags: -tags=nodejs
total: ${{ matrix.total }}
index: ${{ matrix.index }}
- name: Run tests
run: cd examples && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
strategy:
fail-fast: false
max-parallel: 10
Expand Down Expand Up @@ -384,12 +384,12 @@ jobs:
id: test_split
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples
working-directory: tests
flags: -tags=python
total: ${{ matrix.total }}
index: ${{ matrix.index }}
- name: Run tests
run: cd examples && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -487,7 +487,7 @@ jobs:
cd ${{ github.workspace }}/bin
yarn install && yarn link @pulumi/eks
- name: Run tests
run: cd examples && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
test-go:
name: Run Go Tests
needs:
Expand Down Expand Up @@ -576,7 +576,7 @@ jobs:
cd ${{ github.workspace }}/bin
yarn install && yarn link @pulumi/eks
- name: Run tests
run: cd examples && go test -tags=go -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=go -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
name: master
"on":
push:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ jobs:
id: test_split
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples
working-directory: tests
flags: -tags=nodejs
total: ${{ matrix.total }}
index: ${{ matrix.index }}
- name: Run tests
run: cd examples && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
strategy:
fail-fast: false
max-parallel: 10
Expand Down Expand Up @@ -376,12 +376,12 @@ jobs:
id: test_split
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples
working-directory: tests
flags: -tags=python
total: ${{ matrix.total }}
index: ${{ matrix.index }}
- name: Run tests
run: cd examples && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -479,7 +479,7 @@ jobs:
cd ${{ github.workspace }}/bin
yarn install && yarn link @pulumi/eks
- name: Run tests
run: cd examples && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
test-go:
name: Run Go Tests
needs:
Expand Down Expand Up @@ -568,7 +568,7 @@ jobs:
cd ${{ github.workspace }}/bin
yarn install && yarn link @pulumi/eks
- name: Run tests
run: cd examples && go test -tags=go -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=go -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
name: release
"on":
push:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,12 @@ jobs:
id: test_split
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples
working-directory: tests
flags: -tags=nodejs
total: ${{ matrix.total }}
index: ${{ matrix.index }}
- name: Run tests
run: cd examples && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
strategy:
fail-fast: false
max-parallel: 10
Expand Down Expand Up @@ -507,12 +507,12 @@ jobs:
id: test_split
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples
working-directory: tests
flags: -tags=python
total: ${{ matrix.total }}
index: ${{ matrix.index }}
- name: Run tests
run: cd examples && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel 6 . --run="${{ steps.test_split.outputs.run}}" 2>&1 | tee /tmp/gotest.log | gotestfmt
strategy:
fail-fast: false
max-parallel: 4
Expand Down Expand Up @@ -611,7 +611,7 @@ jobs:
cd ${{ github.workspace }}/bin
yarn install && yarn link @pulumi/eks
- name: Run tests
run: cd examples && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
test-go:
name: Run Go Tests
needs:
Expand Down Expand Up @@ -701,4 +701,4 @@ jobs:
cd ${{ github.workspace }}/bin
yarn install && yarn link @pulumi/eks
- name: Run tests
run: cd examples && go test -tags=go -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: cd tests && go test -tags=go -v -json -count=1 -cover -timeout 3h -parallel 6 . 2>&1 | tee /tmp/gotest.log | gotestfmt
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,36 +167,33 @@ dist:: dist/${GZIP_PREFIX}-darwin-amd64.tar.gz
dist:: dist/${GZIP_PREFIX}-darwin-arm64.tar.gz
dist:: dist/${GZIP_PREFIX}-windows-amd64.tar.gz

test_build::
cd examples/utils/testvpc && yarn install && yarn run tsc

Comment on lines -170 to -172
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directory doesn't exist.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

test_nodejs:: PATH := $(WORKING_DIR)/bin:$(PATH)
test_nodejs:: provider install_nodejs_sdk
cd examples && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_nodejs_upgrade:: PATH := $(WORKING_DIR)/bin:$(PATH)
test_nodejs_upgrade:: provider install_nodejs_sdk
cd provider && go test -tags=nodejs -v -json -count=1 -cover -timeout 3h -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -v -run Upgrade -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_python:: install_provider test_build
cd examples && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=python -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_dotnet:: install_provider
cd examples && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=dotnet -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_java:: install_provider
cd examples && go test -tags=java -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=java -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . 2>&1 | tee /tmp/gotest.log | gotestfmt

test_unit_tests:
cd nodejs/eks && \
yarn install && \
yarn run test

specific_test:: install_nodejs_sdk test_build
cd examples && go test -tags=$(LanguageTags) -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . --run=TestAcc$(TestName) 2>&1 | tee /tmp/gotest.log | gotestfmt
cd tests && go test -tags=$(LanguageTags) -v -json -count=1 -cover -timeout 3h -parallel ${TESTPARALLELISM} . --run=TestAcc$(TestName) 2>&1 | tee /tmp/gotest.log | gotestfmt

specific_test_local:: install_nodejs_sdk test_build
cd examples && go test -tags=$(LanguageTags) -v -count=1 -cover -timeout 3h . --run=TestAcc$(TestName)
cd tests && go test -tags=$(LanguageTags) -v -count=1 -cover -timeout 3h . --run=TestAcc$(TestName)

dev:: lint build_nodejs
test:: test_nodejs
Expand Down
Loading
Loading