-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: move to GHA, test against vault-enterprise 1.10.3-ent (#1461)
Move from CircleCI to GitHub Actions. Run all acceptance tests against Vault Enterprise. Additional fixes: - Fix up broken enterprise tests - Add support for testing against Postgres - Fix a regression introduced in v3.5.0 which inadvertently removed the the `disable_escaping` feature from some db engines - Fix bogus quota test that caused the tests to fail
- Loading branch information
Showing
21 changed files
with
349 additions
and
195 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 |
---|---|---|
@@ -1,69 +1,13 @@ | ||
version: 2.1 | ||
|
||
workflows: | ||
build: | ||
jobs: | ||
- build: | ||
context: | ||
- vault-plugin-secrets-terraform | ||
|
||
jobs: | ||
build: | ||
docker: | ||
- image: docker.mirror.hashicorp.services/cimg/go:1.17.5 | ||
- image: circleci/mongo:latest | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME: root | ||
- MONGO_INITDB_ROOT_PASSWORD: mongodb | ||
- MONGO_INITDB_DATABASE: admin | ||
- image: circleci/mysql:latest | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=mysql | ||
- image: hashicorp/vault:latest | ||
environment: | ||
- VAULT_DEV_ROOT_TOKEN_ID=root | ||
- image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu | ||
environment: | ||
- ACCEPT_EULA=Y | ||
- SA_PASSWORD=yourStrong1000Password | ||
working_directory: /tmp/go/src/github.com/hashicorp/terraform-provider-vault | ||
- image: cimg/base:2022.03 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Wait for containers to starts | ||
command: dockerize -wait http://127.0.0.1:8200 -wait tcp://127.0.0.1:3306 -wait tcp://127.0.0.1:1433 -timeout 30s | ||
- run: | ||
name: "Set Environment Variables" | ||
command: | | ||
echo 'GO111MODULE=on' >> $BASH_ENV | ||
echo 'export GOBIN=$GOPATH/bin' >> $BASH_ENV | ||
- run: | ||
name: "Run Tests" | ||
no_output_timeout: 30m | ||
command: | | ||
make test TESTARGS='-v' | ||
- run: | ||
name: "Run Acceptance Tests" | ||
no_output_timeout: 35m | ||
command: | | ||
export VAULT_TOKEN="root" | ||
export VAULT_ADDR="http://127.0.0.1:8200" | ||
export TF_ACC_TERRAFORM_VERSION="1.0.7" | ||
export MYSQL_URL="root:mysql@tcp(127.0.0.1:3306)/" | ||
export MYSQL_CONNECTION_URL="{{username}}:{{password}}@tcp(127.0.0.1:3306)/" | ||
export MYSQL_CONNECTION_USERNAME="root" | ||
export MYSQL_CONNECTION_PASSWORD="mysql" | ||
export MONGODB_URL="mongodb://root:[email protected]:27017/admin?ssl=false" | ||
export MSSQL_URL="sqlserver://sa:[email protected]:1433" | ||
# This will be removed after VAULT-4324 is fixed | ||
make testacc TESTARGS='-v' SKIP_MSSQL_MULTI_CI=true SKIP_RAFT_TESTS=true | ||
- run: | ||
name: "Run Build" | ||
command: | | ||
go build | ||
- run: | ||
name: "Generate Coverage Report" | ||
name: "Moved to GitHub Actions" | ||
command: | | ||
cd cmd/coverage/ | ||
go build | ||
./coverage -openapi-doc=/tmp/go/src/github.com/hashicorp/terraform-provider-vault/testdata/openapi.json | ||
sudo apt-get update && sudo apt-get install -y figlet | ||
figlet 'Moved to GitHub Actions' | ||
echo 'See https://github.com/hashicorp/terraform-provider-vault/actions' |
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,79 @@ | ||
name: Build | ||
|
||
on: push | ||
|
||
jobs: | ||
go-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.go-version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: go-version | ||
run: echo "::set-output name=version::$(cat ./.go-version)" | ||
build: | ||
needs: [go-version] | ||
runs-on: ubuntu-latest | ||
container: | ||
image: "docker.mirror.hashicorp.services/golang:${{ needs.go-version.outputs.version }}" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build | ||
run: | | ||
make build | ||
acceptance: | ||
needs: [go-version, build] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# TODO: enable 1.9 job once the provider is Vault version aware | ||
#image: ["vault-enterprise:1.9-ent", "vault-enterprise:1.10-ent"] | ||
image: ["vault-enterprise:1.10-ent"] | ||
container: | ||
image: "docker.mirror.hashicorp.services/golang:${{ needs.go-version.outputs.version }}" | ||
services: | ||
vault: | ||
image: hashicorp/${{ matrix.image }} | ||
env: | ||
VAULT_DEV_ROOT_TOKEN_ID: root | ||
VAULT_LICENSE: ${{ secrets.VAULT_LICENSE }} | ||
mysql: | ||
image: docker.mirror.hashicorp.services/mysql:latest | ||
env: | ||
MYSQL_ROOT_PASSWORD: mysql | ||
mssql: | ||
image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu | ||
env: | ||
ACCEPT_EULA: Y | ||
SA_PASSWORD: ${{ secrets.MSSQL_SA_PASSWORD }} | ||
mongo: | ||
image: docker.mirror.hashicorp.services/mongo:latest | ||
env: | ||
MONGO_INITDB_ROOT_USERNAME: root | ||
MONGO_INITDB_ROOT_PASSWORD: mongodb | ||
MONGO_INITDB_DATABASE: admin | ||
postgres: | ||
image: docker.mirror.hashicorp.services/postgres:latest | ||
env: | ||
POSTGRES_PASSWORD: secret | ||
POSTGRES_DB: database | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Acceptance Tests | ||
env: | ||
VAULT_TOKEN: "root" | ||
VAULT_ADDR: "http://vault:8200" | ||
TF_ACC_TERRAFORM_VERSION: "1.0.7" | ||
MYSQL_URL: "root:mysql@tcp(mysql:3306)/" | ||
MYSQL_CONNECTION_URL: "{{username}}:{{password}}@tcp(mysql:3306)/" | ||
MYSQL_CONNECTION_USERNAME: "root" | ||
MYSQL_CONNECTION_PASSWORD: "mysql" | ||
MONGODB_URL: "mongodb://root:mongodb@mongo:27017/admin?ssl=false" | ||
MSSQL_URL: "sqlserver://sa:${{ secrets.MSSQL_SA_PASSWORD }}@mssql:1433" | ||
POSTGRES_URL: "postgres://postgres:secret@postgres:5432/database?sslmode=disable" | ||
run: | | ||
make testacc-ent TESTARGS='-v' SKIP_MSSQL_MULTI_CI=true SKIP_RAFT_TESTS=true | ||
- name: "Generate Vault API Path Coverage Report" | ||
run: | | ||
go run cmd/coverage/main.go -openapi-doc=./testdata/openapi.json |
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.17.5 | ||
1.17.10 |
File renamed without changes.
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
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
Oops, something went wrong.