Problem/Motivation
\Drupal\Tests\Core\Test\PhpUnitCliTest executes a functional test, so requires a webserver and database.
So it is not a unit test
Steps to reproduce
See https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/j... from when we were setting up gitlab ci.
This commit https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/c... was required to get unit tests to pass, IE we needed a DB and webserver
Proposed resolution
Move the test
Revert the 'with webserver' requirement for unit tests
Comments
Comment #2
mondrakeThere are two tests in that class; I think
testPhpUnitListTestsshould remain a Unit test, because it is meant to identify if there are class duplications by running PHPUnit's test discovery. That serves the purpose of ensuring if you run a test group in PHPUnit CLI and not through run-tests.sh, you do not incure in fatal errors.testFunctionalTestDebugHtmlOutputon the other hand yes, it could be split into a FunctionalTest.Comment #3
mondrakeThis is outdated now,
testFunctionalTestDebugHtmlOutputwas moved in another issue.However, there are other tests currently requiring a db, and the 'with webserver' requirement for unit tests cannot be reverted.
Not closing the issue as it’s referenced in pipeline.yml; however a new issue is needed.
Comment #4
mondrakeReplacement issue: #3477529: [CI] Remove the 'with-database' requirement for unit tests
Comment #5
mondrakeThis was fixed in the related issue.