phpunit --debug still displays only dots

前端 未结 4 1302
忘掉有多难
忘掉有多难 2021-02-03 18:29

I want to see which test is currently executed during a phpunit run.

I use the --debug param but still only get dots:

$ phpunit --debug 
PHPUnit          


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-03 19:29

    (Answering the question of "how to see which test is currently running")

    As you've noticed --debug and --verbose are of little help. (I use --verbose most of the time, but because it tells me more information when things go wrong, and isn't really very verbose the rest of the time.)

    Here was my first try:

    phpunit --verbose --tap
    

    I tried it out on a test suite that has some slow tests. It worked beautifully until test 21, then nothing, then a few minutes later tests 22 to 598 appeared in one go. I suspect output buffering. Here is a variation that does not have this problem, but requires two terminal windows open:

    phpunit --verbose --log-tap tap.log
    

    Then in another window:

    tail -f tap.log
    

    Actually it doesn't tell you exactly what you want, because it only reports which function it was working on. So, when you get a delay you have to wait for the test to finish to discover which is the slow test.

    To get more control consider writing your own test listener.

提交回复
热议问题