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

functionaltests: handle terraform output errors #15355

Merged
merged 4 commits into from
Jan 24, 2025
Merged

Conversation

endorama
Copy link
Member

Motivation/summary

Code in functionaltests relying on terraform.Runner.Output() was not checking errors. If for any reason the output
value 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

@endorama endorama requested a review from a team as a code owner January 23, 2025 20:35
Copy link
Contributor

mergify bot commented Jan 23, 2025

This pull request does not have a backport label. Could you fix it @endorama? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.17 is the label to automatically backport to the 7.17 branch.
  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • backport-8.x is the label to automatically backport to the 8.x branch.

Copy link
Contributor

mergify bot commented Jan 23, 2025

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Jan 23, 2025
kruskall
kruskall previously approved these changes Jan 23, 2025
Comment on lines 63 to 64
err = tf.Output("apm_url", &escfg.APMServerURL)
require.NoError(t, err)
Copy link
Contributor

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:

Suggested change
err = tf.Output("apm_url", &escfg.APMServerURL)
require.NoError(t, err)
require.NoError(t, tf.Output("apm_url", &escfg.APMServerURL))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed and updated

@endorama endorama merged commit 8c523e6 into main Jan 24, 2025
13 checks passed
@endorama endorama deleted the functionaltests-tferror branch January 24, 2025 17:30
mergify bot pushed a commit that referenced this pull request Jan 24, 2025
* handle terraform output errors

* shorten checks

(cherry picked from commit 8c523e6)
mergify bot added a commit that referenced this pull request Jan 24, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants