Skip to content
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

Binary testing: "No configuration files" #495

Closed
kmoe opened this issue Jul 9, 2020 · 6 comments · Fixed by #499
Closed

Binary testing: "No configuration files" #495

kmoe opened this issue Jul 9, 2020 · 6 comments · Fixed by #499
Labels
bug Something isn't working
Milestone

Comments

@kmoe
Copy link
Member

kmoe commented Jul 9, 2020

Version: 2.0.0-rc.2

Example log on windows:

=== RUN   TestAccResourceID
cannot run Terraform provider tests: failed to create symlink at C:\Users\paul\AppData\Local\Temp\tftest-terraform-provider-random607016463\plugins-current035595298\terraform-provider-random to C:\Users\paul\AppData\Local\Temp\go-build128261702\b233\provider.test.exe: symlink C:\Users\paul\AppData\Local\Temp\go-build128261702\b233\provider.test.exe C:\Users\paul\AppData\Local\Temp\tftest-terraform-provider-random607016463\plugins-current035595298\terraform-provider-random: A required privilege is not held by the client.
FAIL    github.com/terraform-providers/terraform-provider-random/internal/provider      0.321s
@kmoe kmoe added bug Something isn't working testing labels Jul 9, 2020
@paultyng
Copy link
Contributor

paultyng commented Jul 9, 2020

This works though when in an escalated shell, so that is the current workaround.

@paddycarver
Copy link
Contributor

With an escalated shell I still get an error about no configuration, let me reboot and I'll capture it here.

@paddycarver paddycarver added this to the v2.0.0 milestone Jul 9, 2020
@paddycarver
Copy link
Contributor

Running as Administrator, in Developer Mode:

--- FAIL: TestAccResourceID (1.89s)
    testing_new.go:94: terraform failed: exit status 1
        
        stderr:
        
        Error: No configuration files
        
        Apply requires configuration to be present. Applying without a configuration
        would mark everything for destruction, which is normally not what is desired.
        If you would like to destroy everything, run 'terraform destroy' instead.

@paultyng
Copy link
Contributor

paultyng commented Jul 9, 2020

Hmm, it works on my machine with just a "Run as administrator" Powershell instance. Don't think I'm using the developer mode though maybe.

@paultyng paultyng modified the milestones: v2.0.0, v2.x (next minor) Jul 9, 2020
@paddycarver
Copy link
Contributor

OK, so after some fun debugging, we figured this one out. Probably. It looks like the root cause is hashicorp/terraform#25233 doesn't apply just to plan files, but also to the config directories if you pass them in manually. Which... we are.

We confirmed this works in 0.13.0-beta2 and 0.13.0-beta3, which makes sense, as hashicorp/terraform#25233 was fixed in 0.13.0-beta2.

I've also confirmed that this works in 0.12.26 and higher if we use a relative path when specifying the config directory, instead of an absolute path. Given that hashicorp/terraform#25233 is about specifying things by relative path, this seems to further point to it as the root of the issue.

Given that we can fix this SDK-side without too much effort, I'm proposing we move this back into the 2.0.0 release and instead modify the SDK to use relative paths for the config files. I'll have a PR up for that shortly.

@paultyng paultyng modified the milestones: v2.x (next minor), v2.0.0 Jul 9, 2020
@paddycarver paddycarver changed the title Binary testing fails to create symlinks on Windows Binary testing: "No configuration files" Jul 9, 2020
paddycarver added a commit that referenced this issue Jul 10, 2020
Update to take advantage of the bugfix in terraform-plugin-test v1.4.4
that fixes #495.
paddycarver added a commit that referenced this issue Jul 10, 2020
Update to take advantage of the bugfix in terraform-plugin-test v1.4.4
that fixes #495.
@ghost
Copy link

ghost commented Aug 10, 2020

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.

@ghost ghost locked and limited conversation to collaborators Aug 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants