Bug 992734 - perl-Test-Class: FTBFS in rawhide
perl-Test-Class: FTBFS in rawhide
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: perl-Test-Class (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Pisar
Fedora Extras Quality Assurance
https://github.com/schwern/test-more/...
:
Depends On:
Blocks: F20FTBFS 992485 992578 992709
  Show dependency treegraph
 
Reported: 2013-08-05 02:15 EDT by Dennis Gilmore
Modified: 2013-08-09 04:40 EDT (History)
4 users (show)

See Also:
Fixed In Version: perl-Test-Class-0.39-3.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-09 04:40:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix up to 0.98_04 (2.65 KB, patch)
2013-08-07 09:49 EDT, Petr Pisar
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
CPAN 85004 None None None Never

  None (edit)
Description Dennis Gilmore 2013-08-05 02:15:14 EDT
Your package perl-Test-Class failed to build from source in current rawhide.

http://koji.fedoraproject.org/koji/taskinfo?taskID=5742683

Build logs:
root.log: http://kojipkgs.fedoraproject.org/work/tasks/2683/5742683/root.log
build.log: http://kojipkgs.fedoraproject.org/work/tasks/2683/5742683/build.log
state.log: http://kojipkgs.fedoraproject.org/work/tasks/2683/5742683/state.log
NOTE: build logs are cleaned up after 1 week

For details on mass rebuild see https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
Comment 1 Petr Pisar 2013-08-06 09:31:37 EDT
Tests are not compatible with Test-Simple 0.98_05.
Comment 2 Ralf Corsepius 2013-08-07 01:40:40 EDT
(In reply to Petr Pisar from comment #1)
> Tests are not compatible with Test-Simple 0.98_05.

According to CPAN Test-Simple 0.98_05 is a developer release. Looking at the timestamps, I would not want to exclude it's a stalled development release.

Q: Any particular reason for using this version instead of the "official stable" version (0.98)? IMO, it's worth considering downgrading to 0.98, but I am sure about it.
Comment 3 Petr Pisar 2013-08-07 04:40:09 EDT
Test-Simple 0.98_05 fixes another bugs that appeared in the early rebuild stage, thus I upgraded to the this development version intentionally.
Comment 4 Petr Pisar 2013-08-07 04:45:25 EDT
This looks like a different wording introduced in 0.98_04. I have already adapted other packages due this change. I will try it here too.
Comment 5 Petr Pisar 2013-08-07 09:49:14 EDT
Created attachment 783932 [details]
Fix up to 0.98_04

This patch fixes Test-Class test failures due to changes in Test-Simple up to 0.98_04.
Comment 6 Petr Pisar 2013-08-07 09:52:33 EDT
There are mysterious failure with Test-Simple 0.98_05. They are caused with this Test-Simple commit:

commit 1d69410753cf233807ef9526b75d74afbddf92d8
Author: nnutter <iam@nnutter.com>
Date:   Thu Apr 4 22:27:28 2013 -0500

    fix bug when test_fail is called via a do statement

    test_fail used $0 as the filename instead of the filename reported by
    caller. Under normal execution these would be the same but if the test
    is executed by a do block then these would no longer be the same.

diff --git a/lib/Test/Builder/Tester.pm b/lib/Test/Builder/Tester.pm
index f84e630..d9ac9e7 100644
--- a/lib/Test/Builder/Tester.pm
+++ b/lib/Test/Builder/Tester.pm
@@ -222,7 +222,7 @@ sub test_fail {
     $line = $line + ( shift() || 0 );    # prevent warnings

     # expect that on stderr
-    $err->expect("#     Failed test ($0 at line $line)");
+    $err->expect("#     Failed test ($filename at line $line)");
 }

 =item test_diag

They happen when Test-Class test calls test_err(qr//):

[test@fedora-20 test-class]$ perl -I/tmp/Test-Simple-0.98_05/lib/ -T -Ilib t/runtests_return.t
1..2
ok 1 - early return handled (skip)
not ok 2 - early return handled (fail)
#   Failed test 'early return handled (fail)'
#   at t/runtests_return.t line 42.
# STDERR is:
# #   Failed test '(Bar::darwin_only returned before plan complete)'
# #   at lib/Test/Class.pm line 392.
# #   (in Bar->darwin_only)
# #   Failed test '(Bar::darwin_only returned before plan complete)'
# #   at lib/Test/Class.pm line 392.
# #   (in Bar->darwin_only)
# 
# not:
# (?^s:.*in Bar->darwin_only.*)
# 
# as expected

But I don't understand why that fails because it nowhere checks the file name.
Comment 7 Petr Pisar 2013-08-07 10:03:44 EDT
Hm, no. It's caused by this Test-Simple commit:



commit 497965306444982d4948e24811e44e72619885f8
Author: Michael G. Schwern <schwern@pobox.com>
Date:   Mon Apr 15 17:13:43 2013 +0100

    Fix Test::Builder::Tester so it works with subtests.
    
    They already work in TB1.5 and this wasn't hard to fix.
    
    For #350

diff --git a/lib/Test/Builder/Tester.pm b/lib/Test/Builder/Tester.pm
index 573c818..2c49cf4 100644
--- a/lib/Test/Builder/Tester.pm
+++ b/lib/Test/Builder/Tester.pm
@@ -98,15 +98,13 @@ my $err = tie *$error_handle,  "Test::Builder::Tester::Tie",
 # for remembering that we're testing and where we're testing at
 my $testing = 0;
 my $testing_num;
+my $original_is_passing;
 
 # remembering where the file handles were originally connected
 my $original_output_handle;
 my $original_failure_handle;
 my $original_todo_handle;
 
-my $original_test_number;
-my $original_harness_state;
-
 my $original_harness_env;
 
 # function that starts testing and redirects the filehandles for now
@@ -134,6 +132,8 @@ sub _start_testing {
     $testing     = 1;
     $testing_num = $t->current_test;
     $t->current_test(0);
+    $original_is_passing  = $t->is_passing;
+    $t->is_passing(1);
 
     # look, we shouldn't do the ending stuff
     $t->no_ending(1);
@@ -329,6 +329,7 @@ sub test_test {
     # restore the test no, etc, back to the original point
     $t->current_test($testing_num);
     $testing = 0;
+    $t->is_passing($original_is_passing);
 
     # re-enable the original setting of the harness
     $ENV{HARNESS_ACTIVE} = $original_harness_env;
@@ -469,11 +470,19 @@ sub expect {
 
     my @checks = @_;
     foreach my $check (@checks) {
+        $check = $self->_account_for_subtest($check);
         $check = $self->_translate_Failed_check($check);
         push @{ $self->{wanted} }, ref $check ? $check : "$check\n";
     }
 }
 
+sub _account_for_subtest {
+    my( $self, $check ) = @_;
+
+    # Since we ship with Test::Builder, calling a private method is safe...ish.
+    return $t->_indent . $check;
+}
+
 sub _translate_Failed_check {
     my( $self, $check ) = @_;
Comment 8 Petr Pisar 2013-08-09 03:47:13 EDT
Fixed perl-Test-Simple is being built now. I will push and build fixed perl-Test-Class in turn.

Note You need to log in before you can comment on or make changes to this bug.