run-tests.sh can fail during testDiscovery on 3rd-party modules
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3548261. --> Reported by: [jonathan1055](https://www.drupal.org/user/92645) Related to !410 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>With <code>_PHPUNIT_CONCURRENT=1</code> to use core <code>scripts/run-tests.sh</code>, the test discovery process can fail for errors in 3rd-party modules, such as "class not found" or "declaration ... must be compatible with ...". However, the tests in these modules which have errors are never intended to be run, so they are not actually relevant. But the job is halted, thus preventing the tests in the actual project from being run.</p> <p>The problem happens when setting a value for <code>_PHPUNIT_TESTGROUPS</code> to run a subset of the tests. The error does not happen when running <i>all</i> tests in a project. </p> <p>Also the error does not happen for Drupal Core 10 and 11.0 and 11.1, which use PHPUnit 10. The problems start with core version 11.2+ which use PHPUnit 11 and where run-tests.sh has been modified to use the new test discovery API.</p> <p>Example working OK at core 11.1.8 and PHPUnit 10.5.56<br> <a href="https://git.drupalcode.org/issue/webform-3547627/-/jobs/6632376#L389">https://git.drupalcode.org/issue/webform-3547627/-/jobs/6632376#L389</a></p> Example of fail at core 11.2.0 PHPUnit Version: 11.5.40<br> <a href="https://git.drupalcode.org/issue/webform-3547627/-/jobs/6632522#L389">https://git.drupalcode.org/issue/webform-3547627/-/jobs/6632522#L389</a> <h3 id="summary-proposed-resolution">Proposed resolution</h3> Add <code>--directory $DRUPAL_PROJECT_FOLDER</code> to the call to <code>run-tests.sh</code> > Related issue: [Issue #3549601](https://www.drupal.org/node/3549601)
issue