-
Notifications
You must be signed in to change notification settings - Fork 232
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
Not Helpful Err When Running Tests For Provider #1200
Comments
Thank you for the detailed bug report @cicoyle, appreciate you taking the time to provide all of the relevant details. As discussed out of band, this will be addressed both within the terraform-plugin-sdk and terraform-plugin-testing repos. |
Also worth noting, I see the same err when using the
The moment I mv my second binary to a
With the tfplugindocs, I am unable to set which path to my binary to choose. The randomly choosing a binary in my path doesn't work for me :/ |
Hi @cicoyle 👋 To ensure we're all on the same page, what is in your Similar to other tooling which calls other executables, the provider testing and documentation generation tools should be using the Maybe to state it differently or more explicitly, if the given
The |
Hello! From terminal, my path is:
From in Goland, I added to my acceptance test:
Im not entirely sure why my Goland vs terminal commands return diff results when the path is relatively the same order wise, with cloud-makefiles coming up as one of the first ones. Fair enough, I've not looked at the ordering of things in my PATH before bc it's never been a problem before, I guess I can update that accordingly. Better err messaging upfront would be sufficient. I had no clue I had multiple binaries, let alone the fact that I could specify a certain one with only 1 terraform tool. Maybe that could help get around this too if there were env vars or flags that could be provided to the |
SDK version
Relevant provider source code
Generic test code, since the repo I am working with is not yet public...
Terraform Configuration Files
Debug Output
TLDR: I have my
terraform
binary in my/usr/local/bin
, but apparently I have anotherterraform
binary within this directory too:/Users/cassiecoyle/go/src/github.com/cloud-makefiles/bin/terraform
. When running my tests with the below command, you can see the main problem is:test_terraform_path=/Users/cassiecoyle/go/src/github.com/cloud-makefiles/bin/terraform
where the sdk testing code is looking for anyterraform
binary on my machine and using the one I didn't expect.After switching my command to include the
TF_ACC_TERRAFORM_PATH
env var:$ TF_ACC_TERRAFORM_PATH=/usr/local/bin TF_LOG=TRACE TF_ACC=1 go test -count=1 -run='TestAccMyResource' -v ./internal/provider
I actually see a permission denied (probably since my binary is in/usr/local/bin
?):Upon looking at my
terraform
binary file permissions and trying to update it, I'm not sure why I see permission denied in terminal:I still see the same permission denied.
But, when I run the tests in my Goland IDE, I somehow get past the permission denied and it runs just fine. This is my Goland IDE config:
Expected Behavior
Ideally, I should get notified of any errs upfront before giving an error that doesn't help me out as a user. Seeing the err:
failed to create new working directory: unable to disable terraform-exec provider verification: signal: killed
when running my tests doesn't give me anything helpful to work with. I have no clue how to debug this based on that err output. Like, why is it trying to create a new working directory at the point when I'm running my provider tests, and why does it need to disable terraform-exec? And why is the signal killed? I would like a better err before getting to this point.Secondly, regarding the
signal: killed
, that is also equally unhelpful as output from theterraform version
. Why is the signal killed when running a simple command liketerraform version
?I would like to see better errs outputted upfront rather then at the point where I'm running tests, and something from terraform version that says,
oh, looks like you you have multiple terraform binaries. I can't use this terraform binary version for what you are doing. try upgrading or specifying the terraform binary with this env var
...Last, I would expect the sdk test code to look for a
terraform
binary in the typical/usr/local/bin
first, then if not there look elsewhere, or if there are more than 1 binary, then/usr/local/bin
should be default or override the other locations. I expect most binaries to be in/usr/local/bin
.Actual Behavior
I can't run my provider tests from terminal due to the above errs.
Steps to Reproduce
Build out a simple provider. Have more than 1
terraform
binary, both of diff versions. Allow the sdk to pick the binary you don't expect and when running thego tests
see this output:failed to create new working directory: unable to disable terraform-exec provider verification: signal: killed
.References
Internal references in Slack
The text was updated successfully, but these errors were encountered: