[go: up one dir, main page]

Populate the "tests" tab in pipeline page

Currently the "tests" tab in pipeline page is empty (example) as it requires the results of the tests to be exported in JUnit format. See: https://docs.gitlab.com/ee/ci/junit_test_reports.html

That's an easy change for us, as it only requires adding the following flag to tox.ini when calling py.test: --junitxml=pytest-report.xml.

pytest-report.xml is the name of the junit report containing unittests results.

Then this file should be provided to gitlab via artifacts, adding this to each job:

  artifacts:
    reports:
      junit: pytest-report.xml
    expire_in: 1 week

We can use a yaml anchor to attach these instructions to the jobs producing the artifact, which are the jobs which name starts with test:py*. We should set the expiration for this artifact as we do for the package jobs to 1 week.

Finally, we should add pytest-report.xml to .gitignore as the tests results are variable and should not be committed to the report.

This new section will be displayed in a merge request: image

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information