Skip to content

Render errors if test report artifacts are expired

Ref: #296963 (closed)

What does this MR do and why?

This MR renders an error when test report artifacts have expired.

This change is behind the ci_test_report_artifacts_expired feature flag.

This will be used by the frontend to display an empty state as you can see on this design in a follow up MR.

Screenshots or screen recordings

artifact expired endpoint JSON response
projects/-/:id/pipelines/:pipeline_id/tests/suite-name.json?build_ids=1,2 image
projects/-/:id/pipelines/:pipeline_id/tests/suite-name.json?build_ids=1,2 image

How to set up and validate locally

  1. Create a job which generate a junit artifact
  2. Sets expire_in keyword for your job
  3. Here a snippet of the artifact I've created in my .gitlatb-ci.yml (I've uploaded output.xml directly)
test:
  script:
    - echo "testing junit report"
  artifacts:
    reports:
      junit:
        - output.xml
    expire_in: 42 seconds
  1. Verify expired_artifacts is exposed in the test_suite payload
$ curl http://127.0.0.1:3000/root/test-junit/-/pipelines/241/tests/suite-name.json?build_ids=777

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Max Orefice

Merge request reports