Phpunit: testdox does not work with filters

Created on 12 Mar 2019  ยท  12Comments  ยท  Source: sebastianbergmann/phpunit

| Q | A
| --------------------| ---------------
| PHPUnit version | master
| PHP version | 7.2.14
| Installation Method | git

reproduction:

git glone [email protected]:sebastianbergmann/phpunit.git
cd phpunit
composer install
./phpunit --testdox ## works
./phpunit --testdox --filter CliTestDoxPrinter

when adding a filter, a spinner is shown, testdox format is not printed.

typbug

Most helpful comment

Ah I see, and that's a shame.
I use testdox to get quick feedback about which tests are running and how long they are taking to run.
Think of a functional test which takes 1+ minute to run with many tests.

I now get no feed back at all (until the end), so all the benefits i personally was getting from testdox are now gone.

thanks

All 12 comments

@bendavies Thanks for the bug report, I have reproduced it here and will implement a fix.

If the spinner gets in your way, you can disable the spinner for now with either the --no-interaction CLI or noInteraction='true' configuration option.

thanks!

@bendavies The fix has been released ๐Ÿšš

./phpunit --testdox --filter CliTestDoxPrinter                                                                                                  ๎‚ฒ โœ” ๎‚ฒ 15:13:07 
PHPUnit 8.1-g1ce7a827f by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.14 with Xdebug 2.6.0
Configuration: /Users/ewout/proj/phpunit/phpunit.xml

PHPUnit\Util\TestDox\CliTestDoxPrinterColor
 โœ” Colorizes diff in failure message  11 ms

PHPUnit\Util\TestDox\CliTestDoxPrinter
 โœ” Prints the class name of the test class  11 ms
 โœ” Prints the prettified method name  10 ms
 โœ” Prints check mark for successful test  9 ms
 โœ” Does not print additional information for successful test  11 ms
 โœ” Prints cross for test with error  12 ms
 โœ” Prints additional information for test with error  10 ms
 โœ” Prints warning triangle for test with warning  10 ms
 โœ” Prints additional information for test with warning  10 ms
 โœ” Prints cross for test with failure  11 ms
 โœ” Prints additional information for test with failure  11 ms
 โœ” Prints empty set symbol for test with failure  11 ms
 โœ” Does not print additional information for incomplete test by default  10 ms
 โœ” Prints additional information for incomplete test in verbose mode  11 ms
 โœ” Prints radioactive symbol for risky test  10 ms
 โœ” Does not print additional information for risky test by default  10 ms
 โœ” Prints additional information for risky test in verbose mode  11 ms
 โœ” Prints arrow for skipped test  10 ms
 โœ” Does not print additional information for skipped test by default  10 ms
 โœ” Prints additional information for skipped test in verbose mode  10 ms

thanks!

@epdenouden have just tried this on my project and doesn't seem fixed to me

vendor/bin/phpunit --filter PaymentToReceiptProfileTest --testdox
PHPUnit 8.0.5 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.14
Configuration: /Users/ben/Code/scotam/abacus-webapp/phpunit.xml.dist

 โ—’ running tests

anything i can do to help you debug?

@bendavies Oh no, so annoying! I am sorry it has not been fixed for you. I will double check the fix has made it in 8.0.5 and works as expected.

  • what terminal and environment do you try this on? We know the testdox-spinner can be a problem in the Gitlab terminal, for example, but you should see the filtered output
  • is the project a public one and easy to install/container/test?

We'll get this bug fixed.

@epdenouden ok, it seems the test results will be printed after ALL the tests have finished. until that time, the spinner will show. is that expected? that's completely different from phpunit 7 AFAIK?

this is reproducible in the phpunit testsuite, just add a few sleeps to make the tests slow. if the tests are fast it's hard to notice.

@bendavies Quick reply: yes, this is completely normal and indicates everything is working as expected. Also: yes! this is different from PHPUnit v7 and is a result of implementing a buffer in the TestDox printer to re-sequence the Testdox results for human readers.

Ah I see, and that's a shame.
I use testdox to get quick feedback about which tests are running and how long they are taking to run.
Think of a functional test which takes 1+ minute to run with many tests.

I now get no feed back at all (until the end), so all the benefits i personally was getting from testdox are now gone.

thanks

@bendavies I was afraid you where going to mention this use case. This way of working is not supported by the upgraded TestDox printer. Removing things that are still useful to people is not a great feeling.

I'll propose a solution soon; let me know if you have any specific wishes or other bugs you noticed.

ah yes, #3567

Just to say, we have the same issue, I commented the group that we exclude as a workaround but it would be great if it can be fixed. Thanks for your efforts !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

klesun picture klesun  ยท  4Comments

TiMESPLiNTER picture TiMESPLiNTER  ยท  3Comments

sebastianbergmann picture sebastianbergmann  ยท  4Comments

joubertredrat picture joubertredrat  ยท  4Comments

keradus picture keradus  ยท  4Comments