-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
to e2e, or not e2e, that is the question #22918
Conversation
versions The terraform version was hard-coded to 0.10.2, and the provider versions supported the older provider protocol version 4.
filepath.EvalSymlinks is our friend! The code already does this, the tests needed to be updated to do the same.
The DefaultFunc for insecure_skip_tls_verify was sending an empty string instead of a bool. Fixes to default to `false`.
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.
Some little bits inline, but this looks great! Thanks for fixing these up.
@@ -131,6 +131,9 @@ func (b *Backend) configure(ctx context.Context) error { | |||
if data.Get("key_id").(string) == "" { | |||
validationError = multierror.Append(validationError, errors.New("`Key ID` must be configured for the Triton provider")) | |||
} | |||
if data.Get("key_id").(string) == "" { | |||
validationError = multierror.Append(validationError, errors.New("`Key ID` must be configured for the Triton provider")) |
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 seems the same as the block above it ... 🤔 is there a subtle difference I'm not seeing?
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! The difference is "I need to update that with the correct attribute" 🤣 thank you so much
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.
On second thought, that shouldn't be in there at all - removed!
@@ -19,7 +19,11 @@ func TestDirFromModule_registry(t *testing.T) { | |||
} | |||
|
|||
fixtureDir := filepath.Clean("testdata/empty") | |||
dir, done := tempChdir(t, fixtureDir) | |||
tmpDir, done := tempChdir(t, fixtureDir) | |||
dir, err := filepath.EvalSymlinks(tmpDir) |
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.
Could you add a little comment above here explaining why this is necessary? It's surprising that a tempChdir
result would need EvalSymlinks
applied to it but I'm sure there was a reason! 😀
(Similarly for the other EvalSymlinks
calls elsewhere here)
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! Added a comment!
For PR posterity: The module installer runs filepath.EvalSymlinks
on the destination directory, and the result of that is what's returned by the install hooks. If you are on, for eg, a mac whose TMPDIR
env var points to a symlinked directory, the tests - which compare expected installation dir with what's returned by the install hooks - would fail.
I could also (easily) make the tests path by changing my machine's configured TMPDIR to a non-symlinked directory, but as I suspect this impacts most folks using mac osx and developing locally, I felt it was worth addressing in the test.
faster The acceptance tests for etcdv3, oss and manta were not validating required env variablea, chosing to assume that if one was running acceptance tests they had already configured the credentials. It was not always clear if this was a bug in the tests or the provider, so I opted to make the tests fail faster when required attributes were unset (or "").
1c7a18d
to
68dfc30
Compare
This commit was generated from hashicorp/terraform#22918.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
While working on a new feature I found that certain e2e tests had not been updated for 0.12. This sent me down a bit of a rabbit trail getting the e2e tests to either pass or (in the case of backends) fail cleanly. (The first two commits represent tests I needed to get working for my feature while the latter two were fixed merely because the messiness of the failures annoyed me).
Some of these backend failures might represent bugs in the backend themselves (such as etcv3] but overall it seemed that the tests were simply making assumptions about env vars being set, then failing in weird ways when that was not the case.
I did find one clear bug in the
manta
backend: a bool attribute was defaulting to""
and causing a panic, so I updated it tofalse
(matching the documented default).