Problem/Motivation
PHPUnit tests are grouped in 'test suites'. The definition of the test suites is contained in the phpunit.xml.dist configuration file - for each test suite a set of directories are defined; the files identified as tests in those directories are associated to the defined suite.
For historical reasons, the naming of the test suites defined in Drupal's PHPUnit configuration file does not match the naming used by Drupal's test runner run-tests.sh in its --types command line argument.
The current mapping is
'PHPUnit-FunctionalJavascript' => 'functional-javascript',
'PHPUnit-Functional' => 'functional',
'PHPUnit-Kernel' => 'kernel',
'PHPUnit-Unit' => 'unit',
'PHPUnit-Unit-Component' => 'unit-component',
'PHPUnit-Build' => 'build',
run-tests.sh is using some mapping and reverse mapping methods to switch back and forth between pure PHPUnit and legacy naming when discovering tests.
This is confusing for anyone coming from outside Drupal as they will trust the naming in phpunit.xml.dist.
Proposed resolution
1) remove the mapping and only use PHPUnit's names
2) adjust core pipelines to use the PHPUnit names when running jobs for run-tests.sh.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3581399
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:
- 3581399-stop-using-legacy
changes, plain diff MR !15203
Comments
Comment #2
mondrakeComment #4
mondrakeComment #5
longwaveAdded some suggestions/nits.
Comment #6
mondrakeThanks, applied.
Comment #7
longwaveAre we only going to make this change in main/Drupal 12?
I think this needs a change record for anyone who might have custom CI jobs running test suites via run-tests.sh.
Comment #8
mondrakeTrying to backport may require to change deprecated code, which I'd rather not do at this point. But I have not looked in details.
Added draft CR.
Comment #9
longwaveLet's do it, I think this can go into main only, I don't see the need to backport and disrupt things there.
Comment #10
mondrakeComment #11
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #12
mondrakeRebased after #3536964: run-tests.sh - segregate command line parsing and use Symfony Console classes.
Comment #15
godotislateCommitted ed828b0 and pushed to main. Thanks!