Unit tests


Unit Tests

GitLab is able to consume JUnit XML formatted reports

Reports must be defined as a special type of artifact

Reports will be displayed in the summary view of a pipeline

The following example was taken from the official one:

golang:
  stage: test
  script:
    - go install gotest.tools/gotestsum@latest
    - gotestsum --junitfile report.xml --format testname
  artifacts:
    when: always
    reports:
      junit: report.xml

Hands-On

See chapter Unit tests