Skip Menu |

This queue is for tickets about the Catalyst-Plugin-Static-Simple CPAN distribution.

Report information
The Basics
Id: 124211
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-Static-Simple

People
Owner: Nobody in particular
Requestors: rasmus [...] gal.dk
SREZIC [...] cpan.org
Cc: CHORNY [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.34
  • 0.35
Fixed in: 0.36



Subject: Tests fail (with latest MIME::Types?)
On some of my smokers two tests fail: # Failed test 'unknown extension as text/plain ok' # at t/04static.t line 34. # got: 'audio/atrac-advanced-lossless' # expected: 'text/plain' # Looks like you failed 1 test of 9. t/04static.t ............. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/9 subtests # Failed test 'qr regex path ok' # at t/05dirs.t line 34. # got: 'image/vnd.mozilla.apng' # expected: 'image/png' # Looks like you failed 1 test of 13. t/05dirs.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/13 subtests This seems to happen with the newest MIME::Types. Statistical analysis: **************************************************************** Regression 'mod:MIME::Types' **************************************************************** Name Theta StdErr T-stat [0='const'] 1.0000 0.0000 16969925824857838.00 [1='eq_2.11'] -0.0000 0.0000 -3.33 [2='eq_2.13'] -0.0000 0.0000 -4.68 [3='eq_2.14'] -0.0000 0.0000 -5.58 [4='eq_2.16'] -1.0000 0.0000 -16463246267008416.00 R^2= 1.000, N= 150, K= 5 ****************************************************************
On Wed Jan 24 14:16:39 2018, SREZIC wrote: Show quoted text
> On some of my smokers two tests fail: > > # Failed test 'unknown extension as text/plain ok' > # at t/04static.t line 34. > # got: 'audio/atrac-advanced-lossless' > # expected: 'text/plain'
The extension used in this test as now a valid use, hence does not return the default anymore. You need to find a different extension to try this with... for instance 'kcdj289hih289d' which will probably never get assigned. Show quoted text
> # Failed test 'qr regex path ok' > # at t/05dirs.t line 34. > # got: 'image/vnd.mozilla.apng' > # expected: 'image/png' > # Looks like you failed 1 test of 13. > t/05dirs.t ............... > Dubious, test returned 1 (wstat 256, 0x100)
And this one was an issue with MIME::Types. Although image/vnd.mozilla.apng also uses the 'png' extension, it should be used as the preferred mime-type for 'png'. Fixes with release 2.17
On Sat Jan 27 05:04:52 2018, MARKOV wrote: Show quoted text
> On Wed Jan 24 14:16:39 2018, SREZIC wrote:
> > On some of my smokers two tests fail: > > > > # Failed test 'unknown extension as text/plain ok' > > # at t/04static.t line 34. > > # got: 'audio/atrac-advanced-lossless' > > # expected: 'text/plain'
> > The extension used in this test as now a valid use, hence does not > return the > default anymore. You need to find a different extension to try this > with... for > instance 'kcdj289hih289d' which will probably never get assigned. >
I just started to try and make this change, however, it seems that after moving to a still unused extension, MIME::Types (2.17) is now returning empty string instead of text/plain. See GitHub Issue: https://github.com/markov2/perl5-MIME-Types/issues/2 Show quoted text
> > # Failed test 'qr regex path ok' > > # at t/05dirs.t line 34. > > # got: 'image/vnd.mozilla.apng' > > # expected: 'image/png' > > # Looks like you failed 1 test of 13. > > t/05dirs.t ............... > > Dubious, test returned 1 (wstat 256, 0x100)
> > And this one was an issue with MIME::Types. Although > image/vnd.mozilla.apng also > uses the 'png' extension, it should be used as the preferred mime-type > for 'png'. > Fixes with release 2.17
On Sat Jan 27 13:58:08 2018, VANSTYN wrote: Show quoted text
> I just started to try and make this change, however, it seems that after > moving to a still unused extension, MIME::Types (2.17) is now returning > empty string instead of text/plain. > > See GitHub Issue: https://github.com/markov2/perl5-MIME-Types/issues/2
As I see Catalyst::Plugin::Static::Simple already handles that: if ( $type ) { #line 257 .... } else { ... return 'text/plain'; } After renaming 'err.omg' to different extensions and modifying 04static.t and 07mime_types.t tests pass. -- Alexandr Ciornii, http://chorny.net
On Wed Jan 24 14:16:39 2018, SREZIC wrote: Show quoted text
> On some of my smokers two tests fail: > > # Failed test 'unknown extension as text/plain ok' > # at t/04static.t line 34. > # got: 'audio/atrac-advanced-lossless' > # expected: 'text/plain' > # Looks like you failed 1 test of 9. > t/04static.t ............. > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/9 subtests >
And I just ran into this testing this distro with perl-5.27.9 on Linux.
Subject: [rt.cpan.org #124211 ] Tests fail (with latest MIME::Types?)
Date: Sun, 25 Feb 2018 18:57:32 +0100
To: bug-Catalyst-Plugin-Static-Simple [...] rt.cpan.org
From: Emmanuel Seyman <emmanuel [...] seyman.fr>
I'm using this patch to make the tests pass. Emmanuel

Message body is not shown because sender requested not to inline it.

RT-Send-CC: emmanuel [...] seyman.fr
On 2018-02-25 13:05:43, emmanuel@seyman.fr wrote: Show quoted text
> > I'm using this patch to make the tests pass.
CPAN.pm users may use the following distroprefs file to automatically apply the patch: https://github.com/eserte/srezic-cpan-distroprefs/blob/master/Catalyst-Plugin-Static-Simple.yml
Subject: Test fails
Date: Thu, 1 Mar 2018 20:27:08 +0100
To: bug-Catalyst-Plugin-Static-Simple [...] rt.cpan.org
From: Rasmus Skaarup <rasmus [...] gal.dk>
[Catalyst-Plugin-Static-Simple-0.34]$ make test PERL_DL_NONLAZY=1 "/home/user/perl5/perlbrew/perls/perl-5.26.1/bin/perl5.26.1" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/01use.t t/04static.t t/05dirs.t t/06include_path.t t/07mime_types.t t/08subreq.t t/09ignore_ext.t t/10ignore_dirs.t t/11serve_static.t t/12check_error_scope.t t/13no_include_path.t t/14deprecated.t t/20debug.t t/01use.t ................ ok t/04static.t ............. 1/9 # Failed test 'unknown extension as text/plain ok' # at t/04static.t line 35. # got: 'audio/atrac-advanced-lossless' # expected: 'text/plain' # Looks like you failed 1 test of 9. t/04static.t ............. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/9 subtests t/05dirs.t ............... ok t/06include_path.t ....... ok t/07mime_types.t ......... ok t/08subreq.t ............. ok t/09ignore_ext.t ......... ok t/10ignore_dirs.t ........ ok t/11serve_static.t ....... ok t/12check_error_scope.t .. ^C How to reproduce: FreeBSD 11.1 perlbrew install perl-5.26.1 cpan —interactive -v Task::Catalyst <wait a bit> How to fix: Change line 35 of t/04static.t from: is( $res->content_type, 'text/plain', 'unknown extension as text/plain ok' ); to is( $res->content_type, 'audio/atrac-advanced-lossless'', 'unknown extension as audio/atrac-advanced-lossless' ok' ); Or even better, change “unknown” file extension to something other than OMG! :-) Br Rasmus Skaarup
On 2018-01-24 14:16:39, SREZIC wrote: Show quoted text
> On some of my smokers two tests fail: > > # Failed test 'unknown extension as text/plain ok' > # at t/04static.t line 34. > # got: 'audio/atrac-advanced-lossless' > # expected: 'text/plain' > # Looks like you failed 1 test of 9. > t/04static.t ............. > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/9 subtests > > # Failed test 'qr regex path ok' > # at t/05dirs.t line 34. > # got: 'image/vnd.mozilla.apng' > # expected: 'image/png' > # Looks like you failed 1 test of 13. > t/05dirs.t ............... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/13 subtests > > > This seems to happen with the newest MIME::Types. Statistical analysis: > > **************************************************************** > Regression 'mod:MIME::Types' > **************************************************************** > Name Theta StdErr T-stat > [0='const'] 1.0000 0.0000 16969925824857838.00 > [1='eq_2.11'] -0.0000 0.0000 -3.33 > [2='eq_2.13'] -0.0000 0.0000 -4.68 > [3='eq_2.14'] -0.0000 0.0000 -5.58 > [4='eq_2.16'] -1.0000 0.0000 -16463246267008416.00 > > R^2= 1.000, N= 150, K= 5 > ****************************************************************
If the problematic MIME::Types 2.16 is installed, then the test suite still fails: # Failed test 'qr regex path ok' # at t/05dirs.t line 34. # got: 'image/vnd.mozilla.apng' # expected: 'image/png' # Looks like you failed 1 test of 13. t/05dirs.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/13 subtests Happens on some of my smokers which did not get the update to 2.17. Maybe it would be good if the prereq version in Makefile.PL would be dynamically increased if MIME::Types 2.16 is installed.
Subject: Re: [rt.cpan.org #124211] Tests fail (with latest MIME::Types?)
Date: Thu, 15 Mar 2018 10:59:29 +0000
To: bug-Catalyst-Plugin-Static-Simple [...] rt.cpan.org
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
"Slaven_Rezic via RT" <bug-Catalyst-Plugin-Static-Simple@rt.cpan.org> writes: Show quoted text
> If the problematic MIME::Types 2.16 is installed, then the test suite still fails: > > # Failed test 'qr regex path ok' > # at t/05dirs.t line 34. > # got: 'image/vnd.mozilla.apng' > # expected: 'image/png' > # Looks like you failed 1 test of 13. > t/05dirs.t ............... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/13 subtests > > Happens on some of my smokers which did not get the update to 2.17. > Maybe it would be good if the prereq version in Makefile.PL would be > dynamically increased if MIME::Types 2.16 is installed.
I have instead relaxed the test to allow image/.*png, will do a new release shortly. - ilmari -- - Twitter seems more influential [than blogs] in the 'gets reported in the mainstream press' sense at least. - Matt McLeod - That'd be because the content of a tweet is easier to condense down to a mainstream media article. - Calle Dybedahl
This has been fixed in 0.36, now on CPAN.