-
Notifications
You must be signed in to change notification settings - Fork 103
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
[TF-7941] Add support for Terraform Test #755
Conversation
3bbdcfa
to
ee2e662
Compare
ee2e662
to
d653293
Compare
d653293
to
802e5f5
Compare
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.
Looks highly idiomatic! Just a few minor concerns
} | ||
|
||
moduleID := RegistryModuleID{ | ||
Organization: options.RegistryModule.Organization.Name, |
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.
Organization could be nil here, causing a panic. You could check for this in TestRunCreateOptions valid
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.
Done!
errors.go
Outdated
@@ -354,6 +354,10 @@ var ( | |||
|
|||
ErrRequiredRegistryModule = errors.New("registry module is required") | |||
|
|||
ErrInvalidRegistryModuleID = errors.New("invalid value for registry module ID") |
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 don't think this is being used
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.
Removed!
Co-authored-by: Brandon Croft <[email protected]>
48267eb
to
b7edd43
Compare
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.
👍
Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes. |
Description
This PR adds support for the new Terraform Test Runs API.
We can create new kinds of registry modules (branch-based), upload configuration versions against registry modules, and create, monitor, and cancel test runs.
Testing plan
I've ran numerous e2e tests manually using my local build of Terraform Core. You can see the PR in the Terraform repo that uses this to integrate the testing framework with TFC: hashicorp/terraform#33710
I've added integration tests for the new API calls in this PR as well, but they are unfortunately untestable at the moment as the test endpoints are protected by a feature flag while the testing framework is going through the Beta rollout. This means that organisations created newly within the testing framework don't have access to the test runs endpoint.
Testing output
I have executed the tests locally, by hacking the create organisation helper function to load an already whitelisted organisation from the staging environment instead of creating a new one and they've passed.