Problem/Motivation

./vendor/phpunit/phpunit/phpunit -c ./core **/OgMembershipReferenceItemTest.php
PHPUnit 4.8.11 by Sebastian Bergmann and contributors.

S

Time: 343 ms, Memory: 6.00Mb

OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 0, Skipped: 1.

After some digging I found $this->markTestSkipped('There is no database connection so no tests can be run. You must provide a SIMPLETEST_DB environment variable to run PHPUnit based functional tests outside of run-tests.sh. See https://www.drupal.org/node/2116263#skipped-tests for more information.'); in core/tests/Drupal/KernelTests/KernelTestBase.php but this is not displayed.

Proposed resolution

No idea but the current message makes kernel tests impossible to run. phpunit sucks enough we do not need more frustration.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx created an issue. See original summary.

dawehner’s picture

Status: Active » Needs review
FileSize
554 bytes

All you need to make it visible is -v

Maybe we could put that into our phpunit.xml.dist file by default.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Well, that works. I can't comment on whether this makes things _too_ verbose in general but certainly it works.

alexpott’s picture

I'm not sure this is the right solution - it seems strange to turn on verbose for all tests just to show this message.

dawehner’s picture

Well, the alternative might be to throw an exception?

alexpott’s picture

Or just fail no?

chx’s picture

Status: Reviewed & tested by the community » Needs work

Throwing an exception allows to show a message... which is what we need here. Badly.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1.66 KB
ash-3.2$ ./vendor/bin/phpunit -c core core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php
PHPUnit 4.8.11 by Sebastian Bergmann and contributors.

EE

Time: 535 ms, Memory: 6.25Mb

There were 2 errors:

1) Drupal\KernelTests\Core\Entity\RouteProviderTest::testHtmlRoutes
Exception: There is no database connection so no tests can be run. You must provide a SIMPLETEST_DB environment variable to run PHPUnit based functional tests outside of run-tests.sh. See https://www.drupal.org/node/2116263#skipped-tests for more information.

/Users/dawehner/www/d8/core/tests/Drupal/KernelTests/KernelTestBase.php:409
/Users/dawehner/www/d8/core/tests/Drupal/KernelTests/KernelTestBase.php:286
/Users/dawehner/www/d8/core/tests/Drupal/KernelTests/KernelTestBase.php:221
/Users/dawehner/www/d8/core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php:34

2) Drupal\KernelTests\Core\Entity\RouteProviderTest::testAdminHtmlRoutes
Exception: There is no database connection so no tests can be run. You must provide a SIMPLETEST_DB environment variable to run PHPUnit based functional tests outside of run-tests.sh. See https://www.drupal.org/node/2116263#skipped-tests for more information.

/Users/dawehner/www/d8/core/tests/Drupal/KernelTests/KernelTestBase.php:409
/Users/dawehner/www/d8/core/tests/Drupal/KernelTests/KernelTestBase.php:286
/Users/dawehner/www/d8/core/tests/Drupal/KernelTests/KernelTestBase.php:221
/Users/dawehner/www/d8/core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php:34

FAILURES!
Tests: 2, Assertions: 0, Errors: 2.
bash-3.2$
chx’s picture

Status: Needs review » Reviewed & tested by the community

Even better!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1b7a50d and pushed to 8.0.x and 8.1.x. Thanks!

  • alexpott committed d003c72 on 8.1.x
    Issue #2635324 by dawehner: kernel tests are unrunnabble because...

  • alexpott committed 1b7a50d on
    Issue #2635324 by dawehner: kernel tests are unrunnabble because...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

neclimdul’s picture

Status: Closed (fixed) » Active

This was a regression. This was previously fixed and is expected functionality. --verbose provides information on why tests are skipped.

alexpott’s picture

@neclimdul well it is tricky - perhaps we need to set the verbose level in phpunit.xml.dist... because it is completely no obvious as to why the tests are skipped.

alexpott’s picture

Status: Active » Closed (fixed)

Also can we have a new issue rather than re-opening issues - re-opening issues messes up stats, issue credits etc.

neclimdul’s picture