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

Migrate to github.com/hashicorp/hc-install for Acceptance Testing Installation #823

Closed
bflad opened this issue Nov 10, 2021 · 7 comments · Fixed by #825
Closed

Migrate to github.com/hashicorp/hc-install for Acceptance Testing Installation #823

bflad opened this issue Nov 10, 2021 · 7 comments · Fixed by #825
Assignees
Labels
subsystem/tests Issues and feature requests related to the testing framework. technical-debt
Milestone

Comments

@bflad
Copy link
Member

bflad commented Nov 10, 2021

Description

The upstream dependency https://github.com/hashicorp/terraform-exec has removed the tfinstall package. Terraform binary search and Installation as part of the acceptance testing handling in this project will now need to use the new github.com/hashicorp/hc-install to upgrade terraform-exec.

References

@bflad bflad added technical-debt subsystem/tests Issues and feature requests related to the testing framework. labels Nov 10, 2021
@bflad
Copy link
Member Author

bflad commented Nov 16, 2021

We'll likely want something like this feature request to land so we can keep our logic simpler: hashicorp/hc-install#39

@radeksimko
Copy link
Member

hc-install v0.3.0 was just cut which includes fs.AnyVersion ExactBinPath field. https://github.com/hashicorp/hc-install/releases/tag/v0.3.0 so this should be unblocked.

Let me know if there is anything else preventing you from adopting the library and I'd be happy to look into it. 😉

@bflad
Copy link
Member Author

bflad commented Nov 30, 2021

I think v0.3.0 with the Validate() fixes were talking about should be good to get us migrated! I will open a pull request and manually test out the acceptance testing framework behaviors once that's released. 👍

@bflad
Copy link
Member Author

bflad commented Nov 30, 2021

Wow! I really went down a rabbit hole here because I didn't realize tfinstall was automatically running terraform version itself, which when using TF_LOG_PATH in the acceptance testing framework had that output show up in that log file. Since that output no longer exists by default with hc-install, the file was empty and I thought something weird was happening with loggers. 😅

@radeksimko
Copy link
Member

Personally I would consider debugging output from terraform version as part of installation unnecessary in that context, but happy to hear other opinions 😄

The relevant logic is basically all here https://github.com/hashicorp/hc-install/blob/7e86c538be9d48d3ff55df4553b39b1527d08664/product/terraform.go#L29-L49

@bflad bflad added this to the v2.10.0 milestone Dec 6, 2021
@bflad bflad closed this as completed in #825 Dec 6, 2021
bflad added a commit that referenced this issue Dec 6, 2021
…/tfinstall to github.com/hashicorp/hc-install

Reference: #823
@radeksimko
Copy link
Member

@bflad Sorry for the late note, but in case you want to do any debugging and get some output you can pass a logger via SetLogger:
https://pkg.go.dev/github.com/hashicorp/hc-install#Installer.SetLogger

We don't send any terraform version stdout/stderr there, but it should otherwise be generally verbose enough to be able to debug problems in all other areas. I also opened hashicorp/hc-install#46 to track this problem.

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
subsystem/tests Issues and feature requests related to the testing framework. technical-debt
Projects
None yet
2 participants