phpunit-speedtrap icon indicating copy to clipboard operation
phpunit-speedtrap copied to clipboard

Does not work when running phpunit via paratest

Open michaeljhopkins opened this issue 5 years ago • 3 comments

When running my testsuite with paratest ./vendor/bin/paratest the speed trap results are not printed to the console. It works great when running via ./vendor/bin/phpunit

Thoughts on how to resolve this?

michaeljhopkins avatar Apr 09 '19 15:04 michaeljhopkins

see https://github.com/paratestphp/paratest/issues/286

As speedtrap echos the output, it gets lost once the paratest process stops.

Would there be a way for the extension to keep their state, and output it at the end of the test run (e.g. on endTestSuite)?

rvanlaak avatar May 01 '19 11:05 rvanlaak

@rvanlaak Hmm, I have not personally used paratest to know its infrastructure, or how SpeedTrapListener output could be rerouted to paratest output. Any ideas here?

I see the code sample in paratestphp/paratest#286. Does paratest support collecting logs from a defined location?

Would it be valuable if SpeedTrapListener config supported redirecting report output to another location? I'm open to ideas and PRs on how this could work. For example, issue https://github.com/johnkary/phpunit-speedtrap/issues/15 requests improved output when PHPUnit testdox output is used. Customizable output handling could benefit some users.

johnkary avatar Jun 28 '19 23:06 johnkary

Yes, it would definitely be helpful if the speedtrap wrapper would be able to send the output elsewhere. Especially when it would be configurable to keep the output in-memory (so paratest can collect it later).

Spreading tests over multiple processes means the output gets lots, as the echoing speedtrap does in the pre-test stage and post-test stage can not get caught.

rvanlaak avatar Jul 01 '19 15:07 rvanlaak