add logformatter back and provide better github log output #29091
add logformatter back and provide better github log output #29091Luap99 wants to merge 2 commits into
Conversation
715d387 to
1297d16
Compare
Adapt the logformatter script to run again to produce nicely formatted html logs. Because github cannot upload and show raw html files we can only add it to the log archive which must be downloaded and viewed locally. To improve the online experience however github does have the GITHUB_STEP_SUMMARY logic which allows us to produce markdown which will be shown on the summary page for a given test run. The problem is even though github markdown supports some html is does not support CSS and out custom style of the logformatter, in addition the output size is limited so I wrote another script parsing the html output again and turning it into plain test for only the failed tests and then show this as plain text inside codeblocks in the markdown. With this we have a short failure summary which should display all failures at once in the run page so maintainers can see if the failed log was just some flake or an actual problem with the PR. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This groups log output in the github UI and makes it easier to just show the actual test results, the groups are hidden under an extra drop down and only shown when selected. Inspired by Miloslav container-libs change for this. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
| $SUDO sh -c "source .venv/docker-py/bin/activate && make run-docker-py-tests" |& logformatter | ||
| } | ||
|
|
||
| function run_unit() { |
There was a problem hiding this comment.
Are we skipping run_unit, and run_machine deliberately?
There was a problem hiding this comment.
the logformmater cannot handle the default unit test output and we never used it there so yes
run_machine as of now is completely unused here
| "$SCRIPT_DIR/logcollector.sh" ip | ||
| echo "::endgroup::" # Test Setup | ||
|
|
||
| mkdir -p "$SCRIPT_DIR/logs" |
There was a problem hiding this comment.
isn't this already created before?
| mkdir -p "$SCRIPT_DIR/logs" |
| echo "::group::Logging system info" | ||
| "$SCRIPT_DIR/logcollector.sh" packages | ||
| "$SCRIPT_DIR/logcollector.sh" ip | ||
| echo "::endgroup::" # Test Setup |
There was a problem hiding this comment.
| echo "::endgroup::" # Test Setup | |
| echo "::endgroup::" # Logging system info |
| $SUDO make localapiv2-bash |& logformatter | ||
| $SUDO sh -c "source .venv/requests/bin/activate && make localapiv2-python" |& logformatter |
There was a problem hiding this comment.
I could be wrong but looking at logformatter's definition, wouldn't formatted logs from make localapiv2-python replace the logs (on disk file by the same name) generated by make localapiv2-bash?
There was a problem hiding this comment.
ah good point I have to check how it was with cirrus, I guess we need to pipe both output into one logformatter run.
|
oh and just to be clear this is blocked on #29186 (which itself is blocked on external things) as I need new images with the proper gnu awk in debian, so until that all is sorted out I will not make progress here |
Adapt the logformatter script to run again to produce nicely formatted
html logs. Because github cannot upload and show raw html files we can
only add it to the log archive which must be downloaded and viewed
locally.
To improve the online experience however github does have the
GITHUB_STEP_SUMMARY logic which allows us to produce markdown which will
be shown on the summary page for a given test run.
The problem is even though github markdown supports some html is does
not support CSS and out custom style of the logformatter, in addition
the output size is limited so I wrote another script parsing the html
output again and turning it into plain test for only the failed tests
and then show this as plain text inside codeblocks in the markdown.
With this we have a short failure summary which should display all
failures at once in the run page so maintainers can see if the failed
log was just some flake or an actual problem with the PR.
Does this PR introduce a user-facing change?