Disable Migrate D7 block_class Kernel tests for D11

Created on 25 July 2024, 9 months ago
Updated 8 August 2024, 8 months ago

Problem/Motivation

Following the recent integration of the code from 📌 Migrate D7 block_class to D8/D9 Fixed to module's code base, it appeared the phpunit tests for the next major D11 are failing, see:
https://git.drupalcode.org/project/block_class/-/pipelines/211388

Failed phpunit (next major):
https://git.drupalcode.org/project/block_class/-/jobs/1989212

This issue seems to be caused by the fact the added Kernel tests currently require themes Bartik and Seven, which have been removed in D10 and moved to contrib, but these themes don't currently seem to have D11 compatible versions, see:

 
See the corresponding piece of code:
https://git.drupalcode.org/project/block_class/-/blob/8.x-1.x/tests/src/...

Steps to reproduce

Build > Pipeline > Run pipeline :
https://git.drupalcode.org/project/block_class/-/pipelines
Select branch: 8.x-1.x

Proposed resolution

We could potentially consider adding special test cases compatible with Claro, just for D11...

But for the time being, let's wait and see if D11 compatible releases will be created for bartik and seven and maybe just disable this particular Kernel test for D11 so all other tests pass and automated testing can continue running for all other tests.

If the migration scripts from D7 are not fully tested with D11, it isn't necessarily a big issue, since they are tested with D10, which would provide an upgrade path from D7.

📌 Task
Status

Fixed

Version

1.0

Component

SimpleTests

Created by

🇫🇷France dydave

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

Merge Requests

Comments & Activities

  • Issue created by @dydave
  • Pipeline finished with Failed
    9 months ago
    Total: 150s
    #234203
  • Pipeline finished with Success
    9 months ago
    Total: 153s
    #234210
    • DYdave committed ddaebc49 on 8.x-1.x
      Issue #3463832 by DYdave: Disabled Migrate D7 block_class Kernel tests...
  • Status changed to Fixed 9 months ago
  • 🇫🇷France dydave

    Quick follow-up on this issue:

    Found this interesting approach on How to skip tests in PHPunit?: https://stackoverflow.com/a/35288598

    With a piece of code in the setUp() method to allow skipping tests with a condition, in this case, next major version D11.

    Note that this could probably have been implemented differently, for example with parameters and variables provided to the PHPUnit CI job, see:
    https://drupal.stackexchange.com/questions/263329/how-to-exclude-phpunit...
    such as _PHPUNIT_TESTGROUPS or _PHPUNIT_EXTRA, to try to filter or exclude specific tests for certain jobs in GitLab CI.

    However, this method would probably require more code and maintenance setting up in the GitLab CI config file:
    We would need to setup/config almost all the jobs ourselves, see for example:
    https://git.drupalcode.org/project/reroute_email/-/blob/2.3.x/.gitlab-ci...

    That's why in this simple case, it was chosen to disable/skip the tests for D11 in code and not at the CI level.

    Eventually, the Bartik and Seven contrib themes could become D11 compatible, which would allow reverting these changes and allowing the current Kernel tests to run straight on D11.

    However, in case there is no further maintenance and compatibility planned for these legacy themes in contrib, we could either consider:
    Adapting Migrate D7 tests to work with D11, see:
    https://git.drupalcode.org/project/block_class/-/blob/8.x-1.x/tests/src/...
    We could try looking for other modules that could have had the same types of issues, for example, migrating from Bartik/Seven D7 to Olivero/Claro D10/11 and adjust fixtures and expected result classes.

    Otherwise, it could also make sense to create a new development branch that drops this feature and support for D8 to focus support efforts on D9/10/11.
    The Migrate D7 block_class code would still be available in the 8.x-1.x branch which would provide an upgrade path for all core versions supported (8.8 to 11).
    It should then be possible to upgrade to another release from the new development branch.
     

    Tests seem to be back to passing in MR!46 🟢:
    https://git.drupalcode.org/project/block_class/-/pipelines/234214

    Thus, the changes were merged in the 8.x-1.x branch at #4 and the tests went back green 🟢:
    https://git.drupalcode.org/project/block_class/-/pipelines/234219
     

    Following the last successful build of the development branch, the new stable release 8.x-1.4 was created and marked as supported/recommended.

    Since there seems to be almost as many users of the 8.x-1.x branch as for 2.0.x , it could make sense to try supporting this branch as much as possible, in particular, if it doesn't require "too much" work, as opposed to 2.0.x which seems to generate much more overall maintenance work, with a much larger code base.
     

    We would greatly appreciate to have your feedback on the new stable release 8.x-1.4 , any of the recent code changes or aspects of this particular comment.

    Feel free to let us know if you have any questions or concerns on this ticket or the latest changes in general, we would surely be glad to help.
    Thanks in advance!

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

Production build 0.71.5 2024