eraser
eraser copied to clipboard
feat: upload logs
What this PR does / why we need it: Uploads manager and collector pod logs for e2e tests. Collector pod logs not included for collector-pipeline test since it deploys using manifest and imagelist-change test since it causes a timeout due to updating imagelist with delay.
Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):
Fixes #280
Special notes for your reviewer:
Maybe you can write the logs to a file and have upload as a CI artifact? Should be a bit easier parse that way.
Maybe something like TEST_LOGDIR
to determine where to write the files and then further namespace that on <package name>/t.Name()/<pod name/manager>
?
Also seems like a lot of duplication here. It seems like we could make a util function like:
func CaptureLogs(t *testing.T, c Client, pods []*v1.Pod)
Maybe needs more arguments than that but just to give you an idea.
upload-artifact action that can help to push logs as a CI artifact: https://github.com/actions/upload-artifact
Codecov Report
Merging #377 (e166ff1) into main (3bf5e63) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## main #377 +/- ##
=======================================
Coverage 21.94% 21.94%
=======================================
Files 10 10
Lines 606 606
=======================================
Hits 133 133
Misses 461 461
Partials 12 12
Flag | Coverage Δ | |
---|---|---|
unittests | 21.94% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Could you also add .txt
as a file suffix on these logs? This way when trying to read them the OS knows how to open it.