Skip to content

Draft: Append JUnit test case System Out and System Err to the system_output displayed in tests results report

What does this MR do and why?

This merge request appends the contents of the "system-out" and "system-err" nodes from a junit XML file to the "System Output" field of failed test case in the Gitlab test report.

Related to #287664

Closes #375358

This is a small merge request to address the most pressing part of the mentioned issue, namely to display the System Out and System Err of failing tests.

I did not add it to successful tests as mentioned in #287664, but it could be done relatively easily. My main reason for not adding it is that it seems like a less useful use case and it may add a lot of data to the parsed reports.

This is a very minimalist implementation which reuses the existing UI and simply adds both outputs into the "System Output" field in the failed test case details popup.

There are no additional size checks or truncation of data for the added fields even though they may add a lot of data in the report. It should be noted that the current implementation displays "failure" or "system_err" without any such checks and these fields can get arbitrarily large. Actually there seems to be a limit based on the parsing which is mentioned in this issue: #268035 (closed). The current merge request does not fix or make this issue worse. If the data can be parsed successfully, it will be displayed in the test case details page.

Screenshots or screen recordings

Here is the screenshot from #375358 showing the behavior before this merge request

Some_pytest_report

After this merge request, the System Output part would look like this with the example given in that issue:

 This text will be displayed. 

System Out:

 This text will be ignored. 

System Err:

 This text will also be ignored. 

How to set up and validate locally

  1. Create a Gitlab project that has 1 CI job
  2. In the CI job use this file as an artifact:TEST-TestSuite.xml
  3. Run the CI pipeline for the project
  4. Open the pipeline page for that pipeline and go to the "Tests" tab
  5. Click on the test suite for the job
  6. Click "Details" on the single failed test
  7. The popup with the test case details should show in the "System Output" field the contents of the system-out and system-err nodes in the provided XML file.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #287664

Merge request reports