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

Dumps logs even if test failed #78

Merged
merged 3 commits into from
Aug 28, 2024
Merged

Dumps logs even if test failed #78

merged 3 commits into from
Aug 28, 2024

Conversation

jpm-canonical
Copy link
Contributor

Summary

Affected:

Dump journal entries for snaps in test cleanup, after uninstall. This allows logs to be dumped, even if the tests failed.

Testing Steps

Check that log files are written even if tests fail:

  • Set the LOCAL_INFRA_IF value to something that does not exist
  • Set the REMOTE_INFRA_IF value to something that does not exist

@jpm-canonical jpm-canonical marked this pull request as ready for review August 27, 2024 13:39
@jpm-canonical jpm-canonical changed the title Dumps logs in cleanup after uninstall Dumps logs even if test failed Aug 27, 2024
tests/common.go Show resolved Hide resolved
@farshidtz
Copy link
Member

I think we'll have much more readable logs if we dump them before the removal. The shutdown logic results in a lot of output that is irrelevant to the failure, making it hard to pinpoint the actual error.

@jpm-canonical
Copy link
Contributor Author

jpm-canonical commented Aug 28, 2024

My approach here was to log as much as possible. In case something went wrong, we have everything logged, and nothing missing. With that in mind I thought logging the installation and removal was a good idea.

Thinking about it, when we look at the logs it is because something failed, which is unlikely to be the removal. We want to see the failure's logs. The chance of the removal failing is slim, and even if removal fails, something else would have likely failed before that.

So I see your point, and agree that adding the removal logs could obfuscate the actual failure. I'll change it to dump the logs before removal.

@jpm-canonical jpm-canonical merged commit c3a48b6 into main Aug 28, 2024
6 checks passed
@jpm-canonical jpm-canonical deleted the IENG-1146-dump-logs branch August 28, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants