API to retrieve test report from failed job?

Hi all,

I have a pipeline configuration where testing is split into a few jobs, and some of these jobs are retried on failure due to some flaky tests. I now want to automatically determine which tests are actually flaky (and how flaky they are) using some scripting via the Gitlab API. I know that you can retrieve the test report of a finished pipeline, but if a test job fails, then passes on retry, then only the passed test is included in the test report. So I really want to get test reports from failed jobs, and not just the final test report for the whole pipeline.

I know that there is an API to retrieve artifacts from jobs ( Job Artifacts API | GitLab), but as far as I can tell this only gives you artifacts by path and not e.g. junit report artifacts (which is what I am using). Is there an API to fetch test report artifacts from specific jobs (including failed jobs)?

Thanks!

This post was flagged by the community and is temporarily hidden.