Problem/Motivation
The current configuration for the build pipelines of Gitlab CI use all the default variables from the template, which currently cover:
Current: 11.2.5, 8.3.27
OPT_IN_TEST_PREVIOUS_MAJOR: 1 (10.5.4, 8.1.33)
OPT_IN_TEST_PREVIOUS_MINOR: 1 (11.1.8, 8.3.27)
OPT_IN_TEST_NEXT_MINOR: 1 (11.3.x-dev, 8.3.27)
OPT_IN_TEST_NEXT_MAJOR: 1 (none)
OPT_IN_TEST_MAX_PHP: 1 (11.2.5, 8.4.14)
But none of these jobs allow covering DEPRECATED Drupal core versions still supported by the module, in particular, 9.5.x, see:
https://git.drupalcode.org/project/admin_toolbar/-/blob/3.6.2/admin_tool...
core_version_requirement: ^9.5 || ^10 || ^11
In other words: The module is not currently automatically tested for Drupal 9.5.x.
Steps to reproduce
Run a build pipeline at:
https://git.drupalcode.org/project/admin_toolbar/-/pipelines
With the following variables:
OPT_IN_TEST_PREVIOUS_MAJOR: 0
OPT_IN_TEST_PREVIOUS_MINOR: 0
OPT_IN_TEST_NEXT_MINOR: 0
OPT_IN_TEST_NEXT_MAJOR: 0
OPT_IN_TEST_MAX_PHP: 0
_PHPUNIT_CONCURRENT: 0
_TARGET_PHP: '8.3'
DRUPAL_CORE: '9.5.x'
These pipelines currently fail with PHPUNIT errors.
Proposed resolution
1 - Fix the compatibility issues with the PHPUNIT tests for Drupal 9.
2 - Then create a Build Schedule with variable overrides to be able to create a separate specific build pipeline for Drupal 9, so there is at least basic tests coverage, while it is still supported.
Issue fork admin_toolbar-3559521
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:
Comments
Comment #4
dydave commentedUpdated slightly two regular expressions (regex) so they could also match with the markup on Drupal 9.
Since the changes still seemed to pass all jobs and tests with current Gitlab CI configuration 🟢, they were merged above at #3. 🥳
Created a new build Pipeline Schedule at:
Deprecation build: D9.5.xhttps://git.drupalcode.org/project/admin_toolbar/-/pipeline_schedules
With variables overrides specifically for testing D9:
Configured to be executed once every month for the main 3.x development branch. 👌
But this also allows triggering the build manually immediately, see an example where the build came back green 🟢 on D9:
https://git.drupalcode.org/project/admin_toolbar/-/pipelines/669173
Therefore, although this configuration is not integrated with the regular build pipeline, for every merge requests and such, it could still provide regular testing of the compatibility of the module with older (deprecated) Drupal core versions.
Additionally, it could serve as a Gitlab configuration template example, when having a doubt on a change for D9, it is still possible to override the variables of a build to specifically test Drupal 9.
If a more robust or automated solution needs to be implemented in the future, we could still consider working on the Gitlab CI configuration file, but for now, this simple and quick solution available from the Gitlab CI back-end should probably be a good start. 😊
Marking issue as Fixed, for now.
Thanks in advance!