generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HCPCP-2204: Acceptance Tests - Vault (#1169)
* Add separate acceptance test workflow for Vault * HCPCP-1928 Update vault acceptance test workflow to use new environment variables for dedicated test accounts * HCPCP-2204 Add test helper for creating unique resource names * HCPCP-1928 Vault: Update vault cluster test * HCPCP-2204 Consistent naming for Vault cluster tests * HCPCP-2204 Skip: Temp skip for Vault create on AWS * HCPCP-2204 Vault: Update test for plugin * HCPCP-1928 Vault: Update performance replication test for * HCPCP-1928 Vault: Temp skip for replication test
- Loading branch information
Showing
5 changed files
with
118 additions
and
15 deletions.
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: TestAcc Vault | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
pull_request: | ||
# Vault resources still use SDKv2 so we have to target files manually until migrated | ||
paths: | ||
- 'internal/clients/vault_cluster.go' | ||
- 'internal/providersdkv2/resource_vault_*' | ||
|
||
# This prevents more than one run of this workflow from executing at a time. | ||
# Up to 1 additional run will be queued, with anything futher being cancelled from the queue. | ||
concurrency: | ||
group: testacc-vault | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
acceptance_tests: | ||
name: Acceptance Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.HCP_SDK_PIPELINE_TOKEN }} | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | ||
with: | ||
cache: true | ||
go-version-file: 'go.mod' | ||
cache-dependency-path: go.sum | ||
id: go | ||
|
||
- name: Install Dependencies | ||
env: | ||
GOPRIVATE: 'github.com/hashicorp/*' | ||
run: | | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3 | ||
go mod tidy | ||
sudo wget https://github.com/jmespath/jp/releases/latest/download/jp-linux-amd64 -O /usr/local/bin/jp | ||
sudo chmod +x /usr/local/bin/jp | ||
- name: Run 'go mod tidy' | ||
run: | | ||
make depscheck | ||
- name: Get dependencies | ||
run: | | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3 | ||
go mod download | ||
- name: Go Build | ||
run: | | ||
go build -v . | ||
- name: Run TestAcc | ||
env: | ||
TF_ACC: 1 | ||
|
||
HCP_API_HOST: ${{ secrets.HCP_API_HOST_INT }} | ||
HCP_AUTH_URL: ${{ secrets.HCP_AUTH_URL_INT }} | ||
|
||
HCP_ORGANIZATION_ID: ${{ secrets.VAULT_HCP_ORGANIZATION_ID }} | ||
HCP_PROJECT_ID: ${{ secrets.VAULT_HCP_PROJECT_ID }} | ||
HCP_CLIENT_ID: ${{ secrets.VAULT_HCP_CLIENT_ID }} | ||
HCP_CLIENT_SECRET: ${{ secrets.VAULT_HCP_CLIENT_SECRET }} | ||
run: | | ||
go test ./internal/providersdkv2 \ | ||
-v \ | ||
-short \ | ||
-test.v \ | ||
-parallel=10 \ | ||
-timeout=360m \ | ||
-run=TestAcc_Vault.* \ | ||
-coverprofile=testacc-vault.out | ||
go tool cover \ | ||
-html=testacc-vault.out \ | ||
-o testacc-vault.html | ||
- name: Upload TestAcc Coverage Artifact | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | ||
with: | ||
name: Test Coverage | ||
path: testacc-vault.html |
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
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
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
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