Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Host multiple test reports with gitlab pages

We have a test suite in our gitlab pipeline which produces Allure test reports. To make these results available after the test, we currently publish the results to artifacts and have an allure serve running which makes them available over a subdomain, based on the branch name.

We would like to host the test results with gitlab pages for each branch. However we can only ever host one version of a page through gitlab pages at one time. This is a problem since we want to host the test results for each branch, not only for the last executed branch. It seems like this is currently not possible without hacks.

I also found this 3 year old gitlab issue about the topic which indicates this is coming in some version of gitlab in the future.

Is there a better way to do this? Or is our best bet currently to wait until this becomes available in gitlab?

like image 852
kolaente Avatar asked Nov 18 '25 10:11

kolaente


1 Answers

If you want to show a test report summary for each pipeline build, you can use GitLab's "Unit test reports" feature. It is slightly different to GitLab Pages, but it's easier to use, because you don't have to configure and host web pages yourself.

You only need to specify the paths to the XML files of the test results, something like this:

java:
  stage: test
  script:
    - gradle test
  artifacts:
    when: always
    reports:
      junit: build/test-results/test/**/TEST-*.xml

It will show the summary on GitLab's web page of the pipeline build results, like this:

GitLab Unit Test reports example screenshot 1

GitLab Unit Test reports example screenshot 2

Source and guidance:

  • https://docs.gitlab.com/ci/testing/unit_test_reports/
  • https://docs.gitlab.com/ci/testing/unit_test_report_examples/
like image 63
Mr-IDE Avatar answered Nov 21 '25 04:11

Mr-IDE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!