Problem/Motivation
When we moved lint jobs to the parent, unit tests became a blocking step between linting and the rest of the tests. This means a pipeline looks like the following:
composer + yarn -> lint -> composer + yarn -> unit tests -> other tests.
We use several runners for the 'lint' step and several runners for the 'other tests' step, but only two runners for composer + yarn and only one runner for phpunit.
According to @nnewton there is a 20 minute lease on runners, so if there aren't other jobs outside a pipeline for them to pick up, they'll be sitting idle for about 2-4 minutes while phpunit runs.
Since unit test failures isn't the common case (i.e. they usually pass), we should remove -with-unit-tests from the other tests, and just make everything depend on lint (which it defacto does due to the parent/child split). phpcs and phpstan increasingly catch the sort of silly mistakes that would also cause phpunit test failures.
This way there's a shorter gap between linting and other steps, meaning the runners don't sit there doing nothing inbetween.
If we want to block tests on unit tests again, we should consider duplicating them into the main job too, so that they run alongside linting and block there, and then again with the PHP version, however the amount of boilerplate YAML to get run-tests to work in that step is significant.
This should result in 2-4 minute quicker overall test runs.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Screenshot 2023-09-18 at 19.39.15.png | 33.17 KB | fjgarlin |
Issue fork drupal-3387706
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3387706-run-unit-tests
changes, plain diff MR !4803
Comments
Comment #3
catchComment #4
catchComment #5
fjgarlin commentedComments in MR.
Comment #6
fjgarlin commentedChanges look good, all feedback was addressed and pipelines running as expected: https://git.drupalcode.org/project/drupal/-/pipelines/21204
All tests running at the same time, so no waiting for phpunit:

RTBC.
Comment #7
larowlanThanks, committed to 11.x and backported to 10.1.x