preaction / Mercury

A message broker for WebSockets
Other
10 stars 8 forks source link

Tests fail (with recent Mojolicious versions?) #37

Closed eserte closed 7 years ago

eserte commented 7 years ago

The t/allow_origin.t test started to fail on my smokers:

Configuration file "/home/cpansand/.cpan/build/2017011206/Mercury-0.011-0/blib/t/share/allow_origin.conf" missing, maybe you need to create it?
t/allow_origin.t ....... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 

Statistical analysis suggests that this happens with newer Mojolicious versions:

****************************************************************
Regression 'mod:Mojolicious'
****************************************************************
Name                   Theta          StdErr     T-stat
[0='const']           1.0000          0.0000    68259441348862224.00
[1='eq_7.10']         0.0000          0.0000       4.92
[2='eq_7.11']         0.0000          0.0000       6.99
[3='eq_7.12']         0.0000          0.0000       3.79
[4='eq_7.14']         0.0000          0.0000       4.79
[5='eq_7.18']        -1.0000          0.0000    -57109946010140240.00

R^2= 1.000, N= 39, K= 6
****************************************************************
preaction commented 7 years ago

This does seem to be tangentially-related to the Mojolicious change in 7.18 which adds the new Mojo::File API, but it seems more to be one of those things where it accidentally worked in the Mercury test, and it should indeed never have worked correctly: Mojolicious::Plugin::Config has always looked for config files "relative to the application home directory" (unless they were absolute paths). That somehow the test worked before this is surprising (and incorrect), though why I was unable to reproduce it using my standard dev environment was obvious (given an app module path of lib/Mercury.pm, the "home" directory gets set to lib/.., which meant that t/share/allow_origin.conf was correct).

So, this is an easy fix, and I'll have a new release out shortly. Thanks for the report and the analysis!