Skip to content

Provide API to retrieve test case durations from a pipeline

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

As projects grow it can be hard to identify long running tests that slow down build times. (see for example https://gitlab.com/gitlab-org/gitlab-ce/issues/44174, https://gitlab.com/gitlab-org/gitlab-ce/issues/60710). Developers need a way to get data about test runs over time so that they can find and optimize long running tests to keep pipelines running quickly.

Intended users

Further details

Many testing tools support generating a report with the duration of each test case.

For example running

bin/rspec --format RspecJunitFormatter --out rspec.xml spec/controllers/users_controller_spec.rb

outputs rspec.xml which has a time attribute for every <testcase> element.

Proposal

Extend the JUnit test reports feature to extract test case duration from pipeline artifacts and provide the results via the Pipelines API.

As a next iteration, we can build a UI to display the raw values and then on top of that build charts of how tests have developed over time. This gives better insight on how individual changes have influenced the test suite as a whole.

Permissions and Security

Everybody who can access pipeline artifacts should also be able to use this feature.

Documentation

Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Links / references

Edited by 🤖 GitLab Bot 🤖