-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace CLI testdox printer with rpkamp/fancy-testdox-printer #2920
Replace CLI testdox printer with rpkamp/fancy-testdox-printer #2920
Conversation
.travis.yml
Outdated
@@ -32,7 +32,7 @@ before_script: | |||
- echo 'assert.exception=On' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | |||
|
|||
script: | |||
- ./phpunit --coverage-clover=coverage.xml | |||
- ./phpunit --coverage-clover=coverage.xml --testdox --color=auto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to demonstrate the output, can be removed later of course
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not change .travis.yml
.
I think it's not only fine but correct to print two lines instead of one. For consistency, though, the other TestDox outputs should be changed, too. Can you take care of that? |
Makes sense. However, even though your printer is based on |
✔ Does something else with data set "one" [%f ms] | ||
✔ Does something else with data set "two" [%f ms] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance we can get rid of this extra blank line?
Finally, the most important comment: thank you for taking the time to work on this! |
/** | ||
* @test | ||
*/ | ||
public function it_should_print_the_class_name_of_test_class() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_print_the_class_name_of_test_class" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_print_testdox_version_of_test_method() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_print_testdox_version_of_test_method" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_print_check_mark_on_passed_test() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_print_check_mark_on_passed_test" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_not_print_additional_information_on_test_passed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_not_print_additional_information_on_test_passed" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_print_cross_on_test_with_error() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_print_cross_on_test_with_error" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_not_print_additional_information_on_risky_test_when_not_verbose() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_not_print_additional_information_on_risky_test_when_not_verbose" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_print_additional_information_on_risky_test_when_verbose() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_print_additional_information_on_risky_test_when_verbose" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_print_arrow_on_skipped_test() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_print_arrow_on_skipped_test" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_not_print_additional_information_on_skipped_test_when_not_verbose() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_not_print_additional_information_on_skipped_test_when_not_verbose" is not in camel caps format
/** | ||
* @test | ||
*/ | ||
public function it_should_print_additional_information_on_skipped_test_when_verbose() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "CliTestDoxPrinterTest::it_should_print_additional_information_on_skipped_test_when_verbose" is not in camel caps format
Codecov Report
@@ Coverage Diff @@
## master #2920 +/- ##
============================================
+ Coverage 79.8% 79.87% +0.06%
- Complexity 2775 2822 +47
============================================
Files 105 107 +2
Lines 7313 7442 +129
============================================
+ Hits 5836 5944 +108
- Misses 1477 1498 +21
Continue to review full report at Codecov.
|
Thank you, @rpkamp! I'll clean up the CS/WS issues. |
Cool, thanks! Any indication when this will be released? I'm guessing PHPUnit 7.0? |
Yes, this will be in PHPUnit 7.0. |
Here is my initial implementation of replacing the current testdox printer with mine (rpkamp/fancy-testdox-printer).
A few remarks:
PHPUnit\TextUI\ResultPrinter
printer, and getting it to work with thePHPUnit\Util\TestDox\TextResultPrinter
would be near impossible without a big overhaul of how printers are currently set up. So I put mine in thePHPUnit\TextUI
namespace and load it as default when--testdox
is provided on the command line. This does mean that:PHPUnit\Util\TestDox\TextResultPrinter
set as their printer class will not see the new testdox printer after upgrading, but that may be fine.Balance cannot become negative
andBalance cannot become negative 2
which should print only one line. I've tried several different solutions, but somehow I can't seem to get it to fit in the current design. Is this behaviour something you want to keep, or is it fine if it prints as two lines instead of one?I do like the
\PHPUnit\TextUI\TestDoxPrinterTest
class, which is a class that tests a printer, with itself as input, to test that PHPUnit does it's work correctly, using PHPUnit. Very meta 😃