Skip Menu |
 

This queue is for tickets about the TAP-Harness-Archive CPAN distribution.

Report information
The Basics
Id: 76964
Status: resolved
Priority: 0/
Queue: TAP-Harness-Archive

People
Owner: schwigon [...] cpan.org
Requestors: juergen.schulz-bruessel [...] thinkproject.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.14
Fixed in: (no value)



Subject: absolute pathes to testfiles on same server
Download (untitled) / with headers
text/plain 2.4k
I created an archive with prove -v -r -j 4 /opt/path/dir/t/.../2_test.t --archive test.tar.gz and uploaded it to a smolder server (on the same server) smolder --server=server.name --username=username --password=password --file=test.tar.gz --basedir=DIR --project=project The server dies with: Can't locate object method "error" via package "Error executing run mode 'process_add_report': Could not open /opt/path/dir/t/.../2_test.t for reading: Permission denied at /usr/local/share/perl5/TAP/Harness/Archive.pm line 366. at /usr/local/share/perl5/TAP/Harness/Archive.pm line 366. Obviously TAP::Harness::Archive tried to read the 'original' file instead of the archived file and was not able to. After a little research I deleted the leading slashes in the meta.yml file (in description and the filelist). And oops: It worked! These problems were described earlier (at different place -- unfortunatly I have not found the best description again :-( ): https://rt.cpan.org/Public/Bug/Display.html?id=54419 As described in the metioned bug, TAP::Harness::Archive tries to handle absolute pathes for the file, but forgot (as far as I understood) to do this for the YAML files. My quick fix for this is: to introduce an array @filenames as an copy of @files. If there are any leading slashes in the pathes I just remove those and hand @filenames to the YAML::Tiny handler. I just copied the array, since I was not sure how my $aggregator = $self->SUPER::runtests(@files); uses @files. Just removing the leading slash is obviously not smart, but did the job for me. sub runtests { my ($self, @files) = @_; # tell TAP::Harness to put the raw tap someplace we can find it later my $dir = $self->{__archive_tempdir}; $ENV{PERL_TEST_HARNESS_DUMP_TAP} = $dir; my @filenames = @files; foreach (@filenames) { if (File::Spec->file_name_is_absolute($_)) { $_ =~ s|^/||; } } # get some meta information about this run my %meta = ( file_order => \@filenames, start_time => time(), ); my $aggregator = $self->SUPER::runtests(@files); $meta{stop_time} = time(); my @parsers = $aggregator->parsers; for ( my $i = 0; $i < @parsers; $i++ ) { $parsers[ $i ] = { start_time => $parsers[ $i ]->start_time, end_time => $parsers[ $i ]->end_time, description => $filenames[ $i ], }; } ... I discovered the bug with perl v5.10.1 and v5.14.2 as well running on CentOS release 6.2 (Final) Best Jürgen
Subject: absolute pathes to testfiles on same server (PATCH)
Download (untitled) / with headers
text/plain 762b
+++ /usr/share/perl5/TAP/Harness/Archive.pm 2013-02-11 11:54:42.874153995 -0500 @@ -363,7 +363,8 @@ # now create the aggregator my $aggregator = TAP::Parser::Aggregator->new(); foreach my $tap_file (@tap_files) { - open(my $fh, $tap_file) or die "Could not open $tap_file for reading: $!"; + # full path to file is File::Spec->catfile($dir, $tap_file), not $tap_file + open(my $fh, File::Spec->catfile($dir, $tap_file)) or die "Could not open $tap_file for reading: $!"; my $parser = TAP::Parser->new({source => $fh, callbacks => $args->{parser_callbacks}}); if($args->{made_parser_callback}) { $args->{made_parser_callback}->($parser, $tap_file, File::Spec->catfile($dir, $tap_file));
Download (untitled) / with headers
text/plain 183b
Is this resolved with just uploaded v0.16 which got a fix for relative path handling? Steffen -- Steffen Schwigon <ss5@renormalist.net> Dresden Perl Mongers <http://dresden-pm.org/>
Download (untitled) / with headers
text/plain 351b
On Wed Jan 14 17:50:46 2015, SCHWIGON wrote: Show quoted text
> Is this resolved with just uploaded v0.16 which got a fix for relative > path handling?
I think this is fixed and close that ticket hereby. Please feel free to re-open if it does not work for you. Thanks. Steffen -- Steffen Schwigon <ss5@renormalist.net> Dresden Perl Mongers <http://dresden-pm.org/>


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.