\Drupal\Tests\Core\Test\PhpUnitCliTest requires a database and webserver - move to a functional test

Created on 8 September 2023, about 1 year ago

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

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component
PHPUnitย  โ†’

Last updated about 12 hours ago

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia larowlan ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @larowlan
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    There are two tests in that class; I think testPhpUnitListTests should 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.

    testFunctionalTestDebugHtmlOutput on the other hand yes, it could be split into a FunctionalTest.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

    This is outdated now, testFunctionalTestDebugHtmlOutput was 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.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น
Production build 0.71.5 2024