[PP-1] Reduce test pipeline times to around 18 minutes and always report back unit tests

Created on 8 September 2023, about 1 year ago
Updated 11 September 2023, about 1 year ago

Problem/Motivation

Drupal CI test runs do something like this: lint -> unit -> kernel -> functional -> functional javascript -> nightwatch.

Each test group is executed with maximum concurrency, but the groups have to be executed one after the other.

gitlab has jobs rather than single script, this allows different test types to run in parallel.

📌 GitLab CI integration for core Needs work is structured so that CI pipelines run in two stages.

First, a lint step, with cspell, phpstan etc.

Second, all of the various test types are executed in their own jobs.

Unit tests are a dependency for the other test types, so if unit tests fail,the functional, functional javascript, nightwatch etc. don't run.

Since the lint step blocks the test step, this means you have in effect three steps, each of which must finish before the first starts:

lint -> unit -> other test types

With this configuration, a full pipeline run is around 32 minutes.

This issue is to try to improve on that 32 minute test time, as well as allowing unit tests to run independent of linting, so that they always return even if there's a typo.

This results in:

lint + phpunit -> other test types - takes a minute or two off the pipeline.

Additionally, functional tests even at 32 concurrency were taking over 20 minutes to complete. If we chunk those into eight groups (and also build tests into two groups for the same reason), we end up with various run times of between about 4 and 11 minutes. The maximum concurrency is ten, so when a 4 minute job finishes, it frees up a runner/pod to complete another short job while the 11 minute ones are still running.

We have tweaked the order of test execution to functional -> build -> javascript -> nightwatch to support starting the longest running tests first.

With these changes (all just changes to the YAML config plus a small supporting change to run-tests.sh), pipelines complete in around 18 minutes.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Closed: duplicate

Version

11.0 🔥

Component
PHPUnit 

Last updated about 3 hours ago

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024