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

feat: Log error on cleanup in e2e #4835

Merged
merged 3 commits into from
Aug 13, 2024
Merged

Conversation

lukemassa
Copy link
Contributor

@lukemassa lukemassa commented Aug 12, 2024

what

Log error that comes from cleanup() function in e2e tests.

why

Since the cleanup function is deferred, we swallow the error and there's no way for the end user to know that it occurred.

I decided against trying to return this error from the main function, or even something like a log.Fatal, since it's just for cleanup, so stopping earlier isn't going to help anyone.

tests

I ran a version of this PR with an intentional error in cleanup, and observed it did not fail the tests but did log:
https://github.com/runatlantis/atlantis/actions/runs/10356111645/job/28665262207?pr=4835#step:7:52

references

Found while working on #4582

@lukemassa lukemassa requested review from a team as code owners August 12, 2024 16:57
@lukemassa lukemassa requested review from chenrui333, nitrocode and X-Guardian and removed request for a team August 12, 2024 16:57
@github-actions github-actions bot added go Pull requests that update Go code size/xs labels Aug 12, 2024
@lukemassa lukemassa force-pushed the log_error_on_cleanup_in_e2e branch from 2830116 to 94b2463 Compare August 12, 2024 22:31
@chenrui333 chenrui333 added the e2e label Aug 12, 2024
@lukemassa lukemassa merged commit f7829b0 into main Aug 13, 2024
28 checks passed
@lukemassa lukemassa deleted the log_error_on_cleanup_in_e2e branch August 13, 2024 02:20
terakoya76 pushed a commit to terakoya76/atlantis that referenced this pull request Dec 31, 2024
kvanzuijlen pushed a commit to kvanzuijlen/atlantis that referenced this pull request Jan 4, 2025
Signed-off-by: kvanzuijlen <8818390+kvanzuijlen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e go Pull requests that update Go code size/xs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants