Skip to content

Run tests for new/modified files first: Use Mapping

Problem to solve

Following success of the fully built feature to run tests on new code first (#199293) Sasha has been forced to follow the convention of GitLab naming. This works for greenfield development but her legacy projects could leverage this functionality and are named/structured totally differently making this hard/impossible.

It would be nice if Sasha could create a mapping of source -> test directories or source -> test file naming that the feature could use to find the matches and run those tests too.

Intended users

Further details

Sasha and the team are maintaining a number of projects and are not very familiar with the code base. They are writing tests for new/modified code as they need to and would like to leverage the functionality in #199293 to speed up the feedback cycle of unit tests for those changes.

Proposal

Create a mapping similar in nature to the route map concept already utilized by review maps to spell out where source files are stored and where corresponding test files are stored if they do not map the convention of #199293.

TBD - how do we handle this for multi-language repos? (@erushton would appreciate some input / thoughts here from you).

Permissions and Security

Documentation

  • Create documentation for how to create the "map" (or the appropriate name for the thing).

Availability & Testing

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

A successful outcome will be an increase of pipelines using the verification stage by 50% among starter or above users.

What is the type of buyer?

The buyer for this is a team lead/director who wants their team to create tests for the code they are checking into source. This should be built for the starter tier.

Links / references