Tests not running or failing when using run-tests.sh in 11.2.0-dev

Migrated issue

Reported by: jonathan1055

Problem/Motivation

Running phpunit tests on 11.2.0-dev using run-tests.sh with a final argument giving the test group to run, produces the following error:

Drupal\Core\Test\Exception\MissingGroupException: Missing group metadata in test class Drupal\Tests\Composer\Generator\BuilderTest in /builds/issue/scheduler-3445052/web/core/lib/Drupal/Core/Test/PhpUnitTestDiscovery.php:304
Stack trace:
#0 web/core/lib/Drupal/Core/Test/PhpUnitTestDiscovery.php(187): Drupal\Core\Test\PhpUnitTestDiscovery->getTestClassInfo(Object(PHPUnit\Framework\TestSuite), 'PHPUnit-Unit')
#1 web/core/lib/Drupal/Core/Test/PhpUnitTestDiscovery.php(120): Drupal\Core\Test\PhpUnitTestDiscovery->getTestList(Object(PHPUnit\Framework\TestSuite), NULL)
#2 web/core/scripts/run-tests.sh(1044): Drupal\Core\Test\PhpUnitTestDiscovery->getTestClasses(NULL, Array)
#3 web/core/scripts/run-tests.sh(189): simpletest_script_get_test_list()

The variables are _PHPUNIT_CONCURRENT=1, _PHPUNIT_TESTGROUPS=, _PHPUNIT_EXTRA= scheduler_kernel, WHAT_TO_RUN=.
The command is

executing: sudo -u www-data -H -E php web/core/scripts/run-tests.sh --php '/usr/local/bin/php' --color --keep-results --concurrency 32 --repeat '1' --sqlite 'sites/default/files/.sqlite' --dburl mysql://drupaltestbot:drupaltestbotpw@database/drupal_database --url http://localhost/web --xml /builds/issue/scheduler-3445052/web/sites/default/files/simpletest --verbose --non-html   scheduler_kernel

. The final parameter scheduler_kernel is the test group to run.
Here is a failed job

Running "current" 11.1.7 in the same pipeline works correctly, like it always has done in gitlab templates.

It is possible that a change in run-tests.sh between 11.1 and 11.2 has caused this, or it could be something else.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Related issue: Issue #3497431

Edited by drupalbot