Commit 179f97db authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat: normalize reports

parent 191bb552
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -31,9 +31,11 @@ It uses the following variable:
| `PUPPETEER_TEST_EXTRA_ARGS`  | Testing framework extra options based on [Jest](https://jestjs.io/docs/en/cli) | _none_ |
| `REVIEW_ENABLED`      | Set to `true` to enable Puppeteer tests on review environments (dynamic environments instantiated on development branches) | _none_ (disabled) |

### Unit tests report integration
In addition to a textual report in the console, this job produces the following reports, kept for one day:

 Puppeteer test reports are [integrated to Gitlab by generating JUnit reports](https://docs.gitlab.com/ee/ci/junit_test_reports.html).
| Report         | Format                                                                       | Usage             |
| -------------- | ---------------------------------------------------------------------------- | ----------------- |
| `$PUPPETEER_PROJECT_DIR/reports/puppeteer.xunit.xml` | [xUnit](https://en.wikipedia.org/wiki/XUnit) test report(s) | [GitLab integration](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportsjunit) |

### Jest

+5 −5
Original line number Diff line number Diff line
@@ -241,10 +241,10 @@ puppeteer:
    - maybe_install_deps
    # create directories
    - mkdir -p puppeteer/screenshots
    - mkdir -p puppeteer/reports
    - mkdir -p -m 777 reports
    # set junit report dir and fileName
    - export JEST_JUNIT_OUTPUT_DIR="puppeteer/reports"
    - export JEST_JUNIT_OUTPUT_NAME="TEST_REPORT.xml"
    - export JEST_JUNIT_OUTPUT_DIR="reports"
    - export JEST_JUNIT_OUTPUT_NAME="puppeteer.xunit.xml"
  script:
    # maybe activate DEBUG traces
    - 'if [[ "$TRACE" ]]; then export DEBUG=puppeteer:*; fi'
@@ -254,11 +254,11 @@ puppeteer:
    name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
    when: always
    paths:
      - $PUPPETEER_PROJECT_DIR/puppeteer/reports/
      - $PUPPETEER_PROJECT_DIR/reports/puppeteer.*
      - $PUPPETEER_PROJECT_DIR/puppeteer/screenshots/
    reports:
      junit:
        - $PUPPETEER_PROJECT_DIR/puppeteer/reports/TEST_REPORT.xml
        - $PUPPETEER_PROJECT_DIR/reports/puppeteer.xunit.xml
    expire_in: 1 day
  rules:
    - !reference [.acceptance-policy, rules]