Add logic to avoid running PHPUNIT if the project has no phpunit tests
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3419008. --> Reported by: [jonathan1055](https://www.drupal.org/user/92645) Related to !139 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>From <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/gitlab_templates/issues/3397270" title="Status: Closed (fixed)">#3397270: Nightwatch testing against all opted in versions</a></span></p> <blockquote><p>[the phpunit failure] is only happening because the phpunit job is assumed to always run unless one explicitly opts out by setting SKIP_PHPUNIT='1'. Arguably we should have similar <code>exists</code> logic for PHPUnit, then projects like Decoupled Pages or CKEditor 5 Paste Filter, which have only Nightwatch, would no longer have to set SKIP_PHPUNIT. </p></blockquote> <p>In addition to the normal opt-in and skip- rules, Nightwatch tests include</p> <pre>&nbsp;&nbsp;&nbsp; - exists:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - tests/src/Nightwatch/**/*.js<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - modules/*/tests/src/Nightwatch/**/*.js<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when: on_success</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add similar <code>exists</code> checks in phpunit, to only attempt to run if the project actually has phpunit tests.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3>
issue