Start running tests against Drupal 11

Created on 14 November 2023, 8 months ago
Updated 19 January 2024, 5 months ago

Problem/Motivation

Adding OPT_IN_TEST_NEXT_MAJOR: 1 to the .gitlab-ci.yml file will run tests against Drupal 11.

This will give us warning of anything in D11 that breaks tests, and will hopefully allow us to be D11 ready when it goes live.

Remaining tasks

📌 GitLab CI "Unable to create pipeline" Needs review needs to be merged first.

We'll need to update .info.yml files (including in tests) to support D11, and update .gitlab-ci.yml

📌 Task
Status

Fixed

Version

2.1

Component

Code

Created by

🇮🇪Ireland lostcarpark

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

Merge Requests

Comments & Activities

  • Issue created by @lostcarpark
  • Merge request !77Enable tests for Drupal 11. → (Merged) created by lostcarpark
  • 🇮🇪Ireland lostcarpark

    The D11 composer build is failing, and it seems to be because of the following:

    drupal/token_filter[2.0.0-rc1, ..., 2.x-dev] require drupal/core ^9.4 || ^10 -> satisfiable by drupal/core[9.4.0-alpha1, ..., 9.5.x-dev, 10.0.0-alpha1, ..., 10.2.x-dev].

    It seems that token_filter is requiring specific versions of Drupal. However, I can't see anything in composer.json for the token_filter module causing that. In fact it's composer.json seems to contain the bare minimum.

  • Status changed to Needs work 6 months ago
  • 🇺🇸United States markie Albuquerque, NM

    I am wondering that since token_filter doesn't have a d11 release, it is getting rejected... Everything else in this MR looks good

  • 🇮🇪Ireland lostcarpark

    I think that's it. But token_filter doesn't have anything requiring D9/D10 in composer.json, so I think it's getting added by d.o automatically.

    I've been trying to see if I can get past it with composer-drupal-lenient, but it's not behaving for me.

  • Status changed to Needs review 6 months ago
  • 🇮🇪Ireland lostcarpark

    After a lot of trial and error (mostly error), I have found the right combination to make the "next major" tests work!

    The dependent modules won't install from Composer, so to get around that, I needed to use mglaman/composer-drupal-lenient. However, just installing that won't work because Composer will try to install the modules at the same time, and that won't work because lenient isn't installed yet. So to get around that, I used composer global require, which installs a global version of the requirement, so doesn't check anything in the local installation.

    I then needed a config statement to specify the modules to be lenient with, which are token and token_filter. However, I made the mistake of making that a global config, but that didn't work because it would only enable them to be installed globally, so eventually I realised the config needs to be local. That all got me past the build step.

    Of course the tests then failed because the modules don't support Drupal 11. Fortunately I could just copy what "next major" does for the target module and adapt it for the dependencies. That makes it update the info.yml files with Drupal 11.

    Note that we could have left ^10 in the info.yml file and let the CI patch it. However, I think adding ^11 makes a statement that we intend to be ready for D11 when it releases. Adding this to our CI should catch any deprecations that come up before then.

  • 🇮🇪Ireland lostcarpark

    I've made a small change to the before_script for phpunit. I didn't like having the path to the info.yml file 3 times, so I moved it into a variable.

  • First commit to issue fork.
  • Status changed to Fixed 6 months ago
  • 🇺🇸United States ultimike Florida, USA

    @lostcarpark - looks fantastic! Thanks for taking the time to figure this all out - it will likely be helpful to other module maintainers as well!

    -mike

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024