Skip Menu |

This queue is for tickets about the HTML-Template CPAN distribution.

Report information
The Basics
Id: 26103
Status: resolved
Priority: 0/
Queue: HTML-Template

People
Owner: Nobody in particular
Requestors: JDB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 2.9
Fixed in: (no value)



Subject: 05-blind-cache.t fails on read-only distribution
I upgraded HTML-Template in our Perforce repository to 2.9, and the 05-blind-cache.t test fails when I build and test the module without opening templates/simple.tmpl for editing first. My simple fix is to just make the file writable before trying to overwrite it: ==== //depot/main/Camel/src/cpan/H/HTML/HTML-Template/main/t/05-blind-cache.t#1 - d:\p4view\Camel\src\cpan\H\HTML\HTML-Template\main\t\05-blind-cache.t ==== @@ -24,6 +24,7 @@ ok( copy('templates/simple.tmpl', 'templates/notsosimple.tmpl'), "stored simple.tmpl for later restoration"); +chmod(0666, 'templates/simple.tmpl'); ok( copy('templates/simplemod.tmpl', 'templates/simple.tmpl'), "poured new content into simple.tmpl to test blind_cache"); @@ -36,6 +37,7 @@ ); ok($output =~ /v1e2r3y/, "output unchanged as expected"); +chmod(0666, 'templates/simple.tmpl'); ok( copy('templates/notsosimple.tmpl', 'templates/simple.tmpl'), "able to restore original content of simple.tmpl"); ok( unlink('templates/notsosimple.tmpl'), But a better solution would probably to not modify any files part of the original distribution during the test phase. If the test script fails completely before restoring the original file, you would end up with a broken local copy.
From: SAMTREGAR [...] cpan.org
On Wed Apr 04 14:46:58 2007, JDB wrote: Show quoted text
> I upgraded HTML-Template in our Perforce repository to 2.9, and the > 05-blind-cache.t test fails when I build and test the module without > opening templates/simple.tmpl for editing first.
Why would that file be read-only until you edit it first? It's not read-only in the tar file, is it? Is this some kind of weird Perforce behavior? -sam
Subject: RE: [rt.cpan.org #26103] 05-blind-cache.t fails on read-only distribution
Date: Wed, 4 Apr 2007 12:00:47 -0700
To: <bug-HTML-Template [...] rt.cpan.org>, <JDB [...] cpan.org>
From: "Jan Dubois" <jand [...] activestate.com>
On Wed, 04 Apr 2007, via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=26103 > > > On Wed Apr 04 14:46:58 2007, JDB wrote:
> > I upgraded HTML-Template in our Perforce repository to 2.9, and the > > 05-blind-cache.t test fails when I build and test the module without > > opening templates/simple.tmpl for editing first.
> > Why would that file be read-only until you edit it first? It's not > read-only in the tar file, is it? Is this some kind of weird Perforce > behavior?
Yes, it is weird P4 behavior: You "sync" files to your local client view, and they are all read-only. When you "open" them, they get added to a a changelist and become writable, so you can edit them. You can use a filetype modifier to specify that a file should always be writable on the client, so it is not a big deal. Note that I did set the severity to *unimportant*. :) But I think it is generally a good idea to not modify parts of the original distribution during the testing phase. Cheers, -Jan
This should now be resolved in the upcoming 2.10 release. It was fixed by using File::Temp to make changes to a temp file instead of one in the distribution.