reneeb / Mojolicious-Plugin-Prove

Run single test files in Mojolicious.
0 stars 1 forks source link

Test suite fails if HARNESS_TIMER is set #1

Closed eserte closed 9 years ago

eserte commented 9 years ago

If HARNESS_TIMER is set, or the user has a ~/.proverc file with --timer in it, then the test suite fails. Sample report: http://www.cpantesters.org/cpan/report/afa437e8-a0d2-11e4-acbf-aef7e0bfc7aa 0.02 and 0.03 is affected.

eserte commented 9 years ago

It seems that the fix is incomplete, probably ${timer} has to be put also in the line before... See http://matrix.cpantesters.org/?dist=Mojolicious-Plugin-Prove%200.05

reneeb commented 9 years ago

That's not the problem. It seems that the additional timing information looks different on different machines... Some have

t/test.t ..... ok 17ms
[12:12:12]
....

others have

t/test.t ..... ok  24 ms ( 0.00 usr  0.00 sys +  0.01 cusr  0.01 csys =  0.02 CPU)
[12:12:12]
....

Do you know if there's a spec what HARNESS_TIMER does?

reneeb commented 9 years ago

Ok, prove --timer is no problem here, as we run a new instance of prove.

eserte commented 9 years ago

The different output is probably due to a change in Test::Harness 3.34: https://metacpan.org/changes/distribution/Test-Harness#L7

reneeb commented 9 years ago

Ok, the fix should be simple: local $ENV{HARNESS_TIMER} in the plugin. Then the time info is added to the testsuite of the plugin, but when the plugin runs tests, the timer is switched off.

reneeb commented 9 years ago

Should be fixed now with a7fd1cb

reneeb commented 9 years ago

And I had to pass '--norc' to prove... But now it seems to be fixed, finally