Skip to content

Commit e9e9559

Browse files
authored
ci: Concurrent Provider Acceptance Tests against Different Terraform Versions (#124)
## What * Concurrent provider acceptance tests against different terraform versions * Install Terraform beforehand, do not delegate Terraform SDK v2 to do download and install Terraform ## Why * There is an issue caused when parallel Terraform Provider acceptance tests install Terraform at the same time. Explained fairly well in hashicorp/terraform-provider-kubernetes#2256 * Better testing by using different versions of the Terraform binary (3 latest stable minor versions — their latest stable patch version resolved by [terraform-switcher](https://github.com/warrensbox/terraform-switcher) aka `tfswitch`) ## Notes * Will probably need to test against OpenTofu in the future ## Checklist * [x] _I have read [CONTRIBUTING.md](https://github.com/codefresh-io/terraform-provider-codefresh/blob/master/CONTRIBUTING.md)._ * [x] _I have [allowed changes to my fork to be made](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)._ * [x] _I have added tests, assuming new tests are warranted_. * [x] _I understand that the `/test` comment will be ignored by the CI trigger [unless it is made by a repo admin or collaborator](https://codefresh.io/docs/docs/pipelines/triggers/git-triggers/#support-for-building-pull-requests-from-forks)._
1 parent 887901f commit e9e9559

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

codefresh.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,24 @@ steps:
2222
go_test:
2323
title: "Run tests"
2424
stage: test
25-
image: goreleaser/goreleaser:v1.17.0
25+
image: golang:1.18.10-alpine3.17
2626
environment:
2727
- TF_ACC="test"
28+
- CGO_ENABLED=0
2829
commands:
30+
- go install github.com/warrensbox/[email protected]
31+
- terraform-switcher --latest-stable ${TF_VERSION}
2932
- go test -v ./...
3033
retry:
3134
maxAttempts: 3
3235
delay: 5
3336
exponentialFactor: 2
37+
matrix:
38+
# The following will resolve to their latest patch version
39+
environment:
40+
- TF_VERSION=1.3.0
41+
- TF_VERSION=1.4.0
42+
- TF_VERSION=1.5.0
3443

3544
prepare_env_vars:
3645
title: "Preparing environment variables..."

0 commit comments

Comments
 (0)