Skip Menu |
 

This queue is for tickets about the Time-Format CPAN distribution.

Report information
The Basics
Id: 85001
Status: resolved
Priority: 0/
Queue: Time-Format

People
Owner: Nobody in particular
Requestors: sendu [...] sendu.me.uk
Cc: PLICEASE [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.13



Subject: Test failures due to Date::Manip alteration
Date: Thu, 2 May 2013 16:01:02 +0100
To: bug-Time-Format [...] rt.cpan.org
From: Sendu Bala <sendu [...] sendu.me.uk>
Download (untitled) / with headers
text/plain 3.5k
Running perl 5.12.2 on an Ubuntu precise system, Date::Manip 6.39 installed, trying to install Time::Format 1.12 I get the failures you see at the end of this email. If I alter the 3 failing tests (t/doc.t, t/funcs.t and t/manip.t) to remove this line: %Date::Manip:: = (); Then all tests pass fine. I can't work out why that line is there in the test scripts. It isn't used in the Time::Format module itself, so presumably the test failures don't indicate a real problem? Perhaps you could remove those lines so people can install Time::Format easily in the future. $ perl Build test t/0-signature.t .. ok t/1-load.t ....... ok t/DateManip.t .... ok t/DateTime.t ..... ok t/die.t .......... ok t/doc.t .......... 1/26 Can't locate package Date::Manip::Obj for @Date::Manip::TZ::ISA at /software/vertres/lib/perl/lib/perl5/Date/Manip/TZ.pm line 1367, <DATA> line 1. Can't locate package Date::Manip::TZ_Base for @Date::Manip::TZ::ISA at /software/vertres/lib/perl/lib/perl5/Date/Manip/TZ.pm line 1367, <DATA> line 1. Can't locate object method "_now" via package "Date::Manip::TZ" at /software/vertres/lib/perl/lib/perl5/Date/Manip/TZ.pm line 1367, <DATA> line 1. # Looks like you planned 26 tests but ran 23. # Looks like your test exited with 255 just after 23. t/doc.t .......... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 3/26 subtests t/epoch.t ........ ok t/export1.t ...... ok t/export2.t ...... ok t/export3.t ...... ok t/funcs.t ........ 1/18 Can't locate package Date::Manip::Obj for @Date::Manip::TZ::ISA at /software/vertres/lib/perl/lib/perl5/Date/Manip/Date.pm line 1861, <DATA> line 1. Can't locate package Date::Manip::TZ_Base for @Date::Manip::TZ::ISA at /software/vertres/lib/perl/lib/perl5/Date/Manip/Date.pm line 1861, <DATA> line 1. Can't locate object method "_fix_year" via package "Date::Manip::TZ" at /software/vertres/lib/perl/lib/perl5/Date/Manip/Date.pm line 1861, <DATA> line 1. # Looks like you planned 18 tests but ran 12. # Looks like your test exited with 255 just after 12. t/funcs.t ........ Dubious, test returned 255 (wstat 65280, 0xff00) Failed 6/18 subtests t/locale.t ....... ok t/manip.t ........ 1/6 Can't locate package Date::Manip::Obj for @Date::Manip::TZ::ISA at /software/vertres/lib/perl/lib/perl5/Date/Manip/Date.pm line 1861. Can't locate package Date::Manip::TZ_Base for @Date::Manip::TZ::ISA at /software/vertres/lib/perl/lib/perl5/Date/Manip/Date.pm line 1861. Can't locate object method "_fix_year" via package "Date::Manip::TZ" at /software/vertres/lib/perl/lib/perl5/Date/Manip/Date.pm line 1861. # Looks like you planned 6 tests but ran 1. # Looks like your test exited with 255 just after 1. t/manip.t ........ Dubious, test returned 255 (wstat 65280, 0xff00) Failed 5/6 subtests t/msec.t ......... ok t/past.t ......... ok t/quot.t ......... ok t/strftime.t ..... ok t/string.t ....... ok t/time.t ......... ok t/xs_DateTime.t .. ok t/xs_doc.t ....... ok t/xs_funcs.t ..... ok t/xs_locale.t .... ok t/xs_quot.t ...... ok t/xs_time.t ...... ok Test Summary Report ------------------- t/doc.t (Wstat: 65280 Tests: 23 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 26 tests but ran 23. t/funcs.t (Wstat: 65280 Tests: 12 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 18 tests but ran 12. t/manip.t (Wstat: 65280 Tests: 1 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 6 tests but ran 1. Files=25, Tests=459, 6 wallclock secs ( 0.14 usr 0.04 sys + 1.07 cusr 0.30 csys = 1.55 CPU) Result: FAIL Failed 3/25 test programs. 0/459 subtests failed.
Download (untitled) / with headers
text/plain 1.2k
I can confirm this with perl 5.22 and Date::Manip 6.53. Here's the suggested change as a patch: diff -ru Time-Format-1.12-orig/t/doc.t Time-Format-1.12/t/doc.t --- Time-Format-1.12-orig/t/doc.t 2012-09-27 17:32:39.000000000 +0100 +++ Time-Format-1.12/t/doc.t 2016-05-24 15:12:47.598894130 +0100 @@ -20,7 +20,6 @@ $dm_notz = eval('Date::Manip::Date_TimeZone (); 1')? 0 : 1; } delete $INC{'Date/Manip.pm'}; - %Date::Manip:: = (); } # Were all variables imported? (3) diff -ru Time-Format-1.12-orig/t/funcs.t Time-Format-1.12/t/funcs.t --- Time-Format-1.12-orig/t/funcs.t 2012-09-27 17:32:39.000000000 +0100 +++ Time-Format-1.12/t/funcs.t 2016-05-24 15:12:47.598894130 +0100 @@ -23,7 +23,6 @@ $manip_notz = eval ('Date::Manip::Date_TimeZone (); 1')? 0 : 1; } delete $INC{'Date/Manip.pm'}; - %Date::Manip:: = (); } # Get day/month names in current locale diff -ru Time-Format-1.12-orig/t/manip.t Time-Format-1.12/t/manip.t --- Time-Format-1.12-orig/t/manip.t 2012-09-27 17:32:39.000000000 +0100 +++ Time-Format-1.12/t/manip.t 2016-05-24 15:12:47.598894130 +0100 @@ -19,7 +19,6 @@ unless eval 'Date::Manip::Date_TimeZone(); 1'; } delete $INC{'Date/Manip.pm'}; - %Date::Manip:: = (); } my $t = 'first thursday in june 2003';
Download (untitled) / with headers
text/plain 941b
On Thu May 02 11:01:18 2013, sendu@sendu.me.uk wrote: [...] Show quoted text
> > If I alter the 3 failing tests (t/doc.t, t/funcs.t and t/manip.t) to > remove this line: > %Date::Manip:: = (); > Then all tests pass fine. > > I can't work out why that line is there in the test scripts. It isn't > used in the Time::Format module itself, so presumably the test > failures don't indicate a real problem? > > Perhaps you could remove those lines so people can install > Time::Format easily in the future.
You are correct that removing those lines appears to resolve the problem, but they are not actually the problem. Those lines are a sort of hacky way I unloaded the Date::Manip module. Part of the test is to ensure that Time::Format correctly loads Date::Manip if it needs; that is, if the user references %manip. I do not know what changed in Date::Manip that resulted in my crude module-unloading failing. I am trying to come up with a workaround.
Download (untitled) / with headers
text/plain 1.3k
On Tue May 24 14:55:48 2016, ROODE wrote: Show quoted text
> On Thu May 02 11:01:18 2013, sendu@sendu.me.uk wrote: > [...]
> > > > If I alter the 3 failing tests (t/doc.t, t/funcs.t and t/manip.t) to > > remove this line: > > %Date::Manip:: = (); > > Then all tests pass fine. > > > > I can't work out why that line is there in the test scripts. It isn't > > used in the Time::Format module itself, so presumably the test > > failures don't indicate a real problem? > > > > Perhaps you could remove those lines so people can install > > Time::Format easily in the future.
> > You are correct that removing those lines appears to resolve the > problem, but they are not actually the problem. > > Those lines are a sort of hacky way I unloaded the Date::Manip module. > Part of the test is to ensure that Time::Format correctly loads > Date::Manip if it needs; that is, if the user references %manip. > > I do not know what changed in Date::Manip that resulted in my crude > module-unloading failing. I am trying to come up with a workaround.
Has there been any progress on this since your last post? I ask because Time-Format is fairly "high up on the CPAN river", so other CPAN distributions which depend upon it no longer can be tested. Today I tested Time-Format against perl-5.27.9 and got the same failures as reported two years ago. Thank you very much. Jim Keenan
Looking at what you're trying to achieve, it might be better to execute this block in a seperate perl process somehow, and pass the result back:

---
BEGIN
{
    $dm_notok = eval('use Date::Manip (); 1')? 0 : 1;
    unless ($dm_notok)
    {
        # If Date::Manip can't determine the time zone, it'll bomb out of the tests.
        $dm_notz = eval('Date::Manip::Date_TimeZone (); 1')? 0 : 1;
    }
}

---

That'd be more future-proof against both perl design changes and Date::Manip internal detail changes, I'd imagine.


-- 
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )
Download (untitled) / with headers
text/plain 1.5k
On Mon Feb 26 20:57:48 2018, JKEENAN wrote: Show quoted text
> On Tue May 24 14:55:48 2016, ROODE wrote:
> > On Thu May 02 11:01:18 2013, sendu@sendu.me.uk wrote: > > [...]
> > > > > > If I alter the 3 failing tests (t/doc.t, t/funcs.t and t/manip.t) > > > to > > > remove this line: > > > %Date::Manip:: = (); > > > Then all tests pass fine. > > > > > > I can't work out why that line is there in the test scripts. It > > > isn't > > > used in the Time::Format module itself, so presumably the test > > > failures don't indicate a real problem? > > > > > > Perhaps you could remove those lines so people can install > > > Time::Format easily in the future.
> > > > You are correct that removing those lines appears to resolve the > > problem, but they are not actually the problem. > > > > Those lines are a sort of hacky way I unloaded the Date::Manip > > module. > > Part of the test is to ensure that Time::Format correctly loads > > Date::Manip if it needs; that is, if the user references %manip. > > > > I do not know what changed in Date::Manip that resulted in my crude > > module-unloading failing. I am trying to come up with a workaround.
> > Has there been any progress on this since your last post? > > I ask because Time-Format is fairly "high up on the CPAN river", so > other CPAN distributions which depend upon it no longer can be tested. > Today I tested Time-Format against perl-5.27.9 and got the same > failures as reported two years ago. > > Thank you very much. > Jim Keenan
Still a problem when tested against perl-5.31.0 on FreeBSD-12 today. Can you investigate? Thank you very much. Jim Keenan
Subject: Re: [rt.cpan.org #85001] Test failures due to Date::Manip alteration
Date: Fri, 12 Jul 2019 09:06:13 -0400
To: bug-Time-Format [...] rt.cpan.org
From: Eric Roode <eric.roode.cpan [...] gmail.com>
Download (untitled) / with headers
text/plain 1.9k
Hello James, Yes, I will see if I can fix this. -- Eric On Thu, Jul 11, 2019 at 7:50 PM James E Keenan via RT < bug-Time-Format@rt.cpan.org> wrote: Show quoted text
> Queue: Time-Format > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=85001 > > > On Mon Feb 26 20:57:48 2018, JKEENAN wrote:
> > On Tue May 24 14:55:48 2016, ROODE wrote:
> > > On Thu May 02 11:01:18 2013, sendu@sendu.me.uk wrote: > > > [...]
> > > > > > > > If I alter the 3 failing tests (t/doc.t, t/funcs.t and t/manip.t) > > > > to > > > > remove this line: > > > > %Date::Manip:: = (); > > > > Then all tests pass fine. > > > > > > > > I can't work out why that line is there in the test scripts. It > > > > isn't > > > > used in the Time::Format module itself, so presumably the test > > > > failures don't indicate a real problem? > > > > > > > > Perhaps you could remove those lines so people can install > > > > Time::Format easily in the future.
> > > > > > You are correct that removing those lines appears to resolve the > > > problem, but they are not actually the problem. > > > > > > Those lines are a sort of hacky way I unloaded the Date::Manip > > > module. > > > Part of the test is to ensure that Time::Format correctly loads > > > Date::Manip if it needs; that is, if the user references %manip. > > > > > > I do not know what changed in Date::Manip that resulted in my crude > > > module-unloading failing. I am trying to come up with a workaround.
> > > > Has there been any progress on this since your last post? > > > > I ask because Time-Format is fairly "high up on the CPAN river", so > > other CPAN distributions which depend upon it no longer can be tested. > > Today I tested Time-Format against perl-5.27.9 and got the same > > failures as reported two years ago. > > > > Thank you very much. > > Jim Keenan
> > Still a problem when tested against perl-5.31.0 on FreeBSD-12 today. > > Can you investigate? > > Thank you very much. > Jim Keenan > >
RT-Send-CC: jkeenan [...] cpan.org
Download (untitled) / with headers
text/plain 119b
I reworked the test suite to test for optional modules differently. No code changes were needed in the library itself.
Download (untitled) / with headers
text/plain 1.5k
On Fri Jul 19 08:41:35 2019, ROODE wrote: Show quoted text
> I reworked the test suite to test for optional modules differently. > No code changes were needed in the library itself.
LGTM. When Date::Manip is already installed, Time::Format passes its tests and installs. ##### [blead] $ ./bin/cpanm Date::Manip --> Working on Date::Manip Fetching http://www.cpan.org/authors/id/S/SB/SBECK/Date-Manip-6.77.tar.gz ... OK Configuring Date-Manip-6.77 ... OK ==> Found dependencies: Test::Inter --> Working on Test::Inter Fetching http://www.cpan.org/authors/id/S/SB/SBECK/Test-Inter-1.09.tar.gz ... OK Configuring Test-Inter-1.09 ... OK Building and testing Test-Inter-1.09 ... OK Successfully installed Test-Inter-1.09 Building and testing Date-Manip-6.77 ... OK Successfully installed Date-Manip-6.77 2 distributions installed [blead] $ ./bin/perl -MTime::Format -E 'say q|hello world|' Can't locate Time/Format.pm in @INC (you may need to install the Time::Format module) (@INC contains: /home/jkeenan/testing/blead/lib/perl5/site_perl/5.31.2/amd64-freebsd-thread-multi /home/jkeenan/testing/blead/lib/perl5/site_perl/5.31.2 /home/jkeenan/testing/blead/lib/perl5/5.31.2/amd64-freebsd-thread-multi /home/jkeenan/testing/blead/lib/perl5/5.31.2). BEGIN failed--compilation aborted. [blead] $ ./bin/cpanm Time::Format --> Working on Time::Format Fetching http://www.cpan.org/authors/id/R/RO/ROODE/Time-Format-1.13.tar.gz ... OK Configuring Time-Format-1.13 ... OK Building and testing Time-Format-1.13 ... OK Successfully installed Time-Format-1.13 1 distribution installed ##### Thank you very much. Jim Keenan


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.