B
B
BonBon Slick2018-12-02 22:41:42
PHPUnit
BonBon Slick, 2018-12-02 22:41:42

How to find out which test failed if the logs and console are empty?

Due to php limitations for testing objects with dependencies, Symfony UploadedFile had to be disabled processIsolation=falsein phpunit 7+, now during the tests some tests sometimes fail without logs in the console or var/logs.
How would you fix this? Are there any other settings for Phpunit?'
Example

[email protected]:/var/www/test$ phpunit
PHPUnit 7.3.3 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.12-1+0~20181112102304.11+stretch~1.gbp55f215
Configuration: /var/www/test/phpunit.xml

[email protected]:/var/www/test$

Of course, you can test each file in turn, but there are only 100+ of them.
In theory, the tests go from the top folder to the bottom recursively, you can roughly determine in which folder the test falls and test classes from that folder, this is also a long time.
Number of tests 500+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
         backupGlobals="false"
         colors="true"
         bootstrap="./vendor/autoload.php"
         backupStaticAttributes="false"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         beStrictAboutTestsThatDoNotTestAnything="true"
         beStrictAboutCoversAnnotation="true"
         beStrictAboutOutputDuringTests="true"
         verbose="true"
         beStrictAboutChangesToGlobalState="true"
         beStrictAboutTodoAnnotatedTests="true"
         stopOnError="false"
         stopOnIncomplete="false"
         stopOnSkipped="false"
         stopOnRisky="false"
         processIsolation="false"
         stopOnFailure="false">

And yet, processIsolation="false"tests can hang.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question