-
Notifications
You must be signed in to change notification settings - Fork 118
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
Enable binary acceptance test driver #99
Conversation
c36d841
to
c6550a1
Compare
f388f6f
to
3c09d1b
Compare
GNUmakefile
Outdated
@@ -3,6 +3,9 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) | |||
WEBSITE_REPO=github.com/hashicorp/terraform-website | |||
PKG_NAME=random | |||
|
|||
.EXPORT_ALL_VARIABLES: | |||
GOFLAGS=-mod=vendor |
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.
I wasn't sure myself on enforcing the use of the vendor folder for local development. I would say the vendoring is a relic of speeding up builds for CI in a pre go cache world. I had been actually enforcing modules on just in Travis with GO111MODULE=on GOFLAGS=-mod=vendor
. It's something we likely want to harmonize but we can figure that out another day, I'm happy to merge anything that "just works"
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.
Yes, I agree vendoring is a bigger discussion. At the moment, most providers are using vendoring, at least on TeamCity where it is used for nightly test and release builds. I think we should try to make the development environment match the test/release environment as much as possible, which means that for the moment while vendoring is still being used in TC, it should be used for local development. Since Travis uses the Makefile, setting GOFLAGS
here brings both local dev and PR test environments into alignment with TC.
If we remove vendoring in the future, we will have to touch either the Makefile or .travis.yml
, wherever we have set GOFLAGS=-mod=vendor
(the build will error if there is no vendor/
directory, so we can't leave it in harmlessly).
What do you think?
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.
In fact, I think I've persuaded myself: whatever we decide to do about vendoring, it's not really related to this PR. Will remove this commit.
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.
Agree with how this shook out, but wanted to know that our official internal guidance at the moment is to use vendoring when using Go Modules, and deciding against doing that should probably be an RFC.
.travis.yml
Outdated
@@ -4,7 +4,10 @@ services: | |||
- docker | |||
language: go | |||
go: | |||
- "1.11.x" | |||
- "1.13.x" |
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.
Please bump the version of go in .go-version
to match so releases and accetance tests on TeamCity remain consistent
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.
This didn't need to be bumped, so I've reverted it.
b0c69bc
to
8f3b849
Compare
This commit enables the new binary test driver introduced in SDK v1.7.0 for all acceptance tests in this provider. No test results should change. Please see hashicorp/terraform-plugin-sdk#262 for more details about this test driver.
8f3b849
to
0ebdeba
Compare
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR enables the new binary acceptance test driver available in v1.7.0 of the plugin SDK.
Provider acceptance tests now run real
terraform
CLI commands under the hood. The test API remains the same, and there should be no other changes to test results or output. Please see hashicorp/terraform-plugin-sdk#262 for more details.In addition, this PR includes the following changes:
vendor/
directory was ignored, and Go modules were downloaded anew during each build, as can be seen in old Travis logs. Please see this memo for more details regarding this change.make testacc
during the Travis build, since this provider's acceptance tests are very quick and do not rely on any external APIs.