Skip to content

GitLab.com does not display individual JUnit tests for pipelines when viewing the "Tests" tab.

Summary

Gitlab does not display individual JUnit tests for pipelines when viewing the "Tests" tab.

Steps to reproduce

  1. Create a project with a .gitlab-ci.yml file as well as a JUnit .xml results file (Example below).
  2. In the .gitlab-ci.yml file create a job that sets the junit artifact as the .xml file.
  3. Commit and allow job to run.
  4. When job is complete, view the pipeline results.
  5. Click on the Tests tab, then click on the job you created in step 2.
  6. No tests are displayed and a error is shown in the Chrome Devtools console.

Example Project

gitlab-ci.yml

unit-test:
  stage: test
  artifacts:
    reports:
      junit: example.xml
  script:
    - ls

example.xml

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="com.example.app.ExampleTest" tests="1" skipped="0" failures="0" errors="0" time="2.607">
  <testcase name="thisIsAnExampleTest" classname="com.example.app.ExampleTest" time="2.514"/>
</testsuite>

What is the current bug behavior?

No test results are displayed

What is the expected correct behavior?

Gitlab should display each JUnit test that was run.

Example in this Youtube video: (timestamp 6:54) https://www.youtube.com/watch?v=ik8nYYIGayI

Relevant logs and/or screenshots

TypeError: Cannot read property 'length' of null         vue.esm.js:1897 
    at string_utils.js:23
    at render (friendly_wrap.js:24)
    at vue.esm.js:3067
    at $e (vue.esm.js:3240)
    at vue.esm.js:3431
    at Ue (vue.esm.js:3362)
    at t._c (vue.esm.js:3500)
    at test_suite_table.vue?dc57:1
    at a.ye [as _l] (vue.esm.js:2639)
    at a.<anonymous> (test_suite_table.vue?dc57:1)

Capture

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

N/A

Results of GitLab application Check

N/A

Possible fixes