-
Notifications
You must be signed in to change notification settings - Fork 529
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
functionaltests: handle terraform output errors #15355
Conversation
This pull request does not have a backport label. Could you fix it @endorama? 🙏
|
|
functionaltests/8_15_test.go
Outdated
err = tf.Output("apm_url", &escfg.APMServerURL) | ||
require.NoError(t, err) |
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.
Minor nit to reduce the number of lines, I think it's still quite readable:
err = tf.Output("apm_url", &escfg.APMServerURL) | |
require.NoError(t, err) | |
require.NoError(t, tf.Output("apm_url", &escfg.APMServerURL)) |
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.
Agreed and updated
* handle terraform output errors * shorten checks (cherry picked from commit 8c523e6)
* handle terraform output errors * shorten checks (cherry picked from commit 8c523e6) Co-authored-by: Edoardo Tenani <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Motivation/summary
Code in functionaltests relying on
terraform.Runner.Output()
was not checking errors. If for any reason the outputvalue is wrong and the function returns an error this was ignored and the test would proceed, failing at a later
stage with ambiguous errors.
Add a clarifying error if the requested output name is not available from the Terraform outputs.
Checklist
How to test these changes
Run the functionaltests. I tested it locally.
Related issues