Skip to content

Make Junit reports accessible via the API

Problem to solve

JUnit reports are only accessible via the UI, which means reports in non-public pipelines can't be downloaded without authenticating via the UI.

Artifacts from individual jobs can be downloaded, but that is inefficient when a compiled report is required.

Intended users

Quality will start using it immediately.

Further details

Quality want to use the test report to automatically create/update issues in our testcases project to assist with test case management until we have a more complete solution.

Proposal

Add an API route to fetch test reports for a given pipeline.

I.e., GET /projects/:id/pipelines/:pipeline_id/test_report

Permissions and Security

Probably the same permissions used for access to pipelines themselves.

Documentation

Add the route to the Pipelines API page

Availability

The JUnit report feature is currently off by default due to performance issues, which will be fixed in #37725 (closed)

Until then the new API route should also be behind the same feature flag as the full feature.

Testing

It will require new tests in spec/requests/api/pipelines_spec.rb

Links / references

&1875 (closed)