Bug 992734
Summary: | perl-Test-Class: FTBFS in rawhide | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dennis Gilmore <dennis> | ||||
Component: | perl-Test-Class | Assignee: | Petr Pisar <ppisar> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | rawhide | CC: | perl-devel, ppisar, rc040203, steve | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
URL: | https://github.com/schwern/test-more/issues/387 | ||||||
Whiteboard: | |||||||
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 08:40:28 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 991858, 992485, 992578, 992709 | ||||||
Attachments: |
|
Description
Dennis Gilmore
2013-08-05 06:15:14 UTC
Tests are not compatible with Test-Simple 0.98_05. (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. Test-Simple 0.98_05 fixes another bugs that appeared in the early rebuild stage, thus I upgraded to the this development version intentionally. 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. 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.
There are mysterious failure with Test-Simple 0.98_05. They are caused with this Test-Simple commit: commit 1d69410753cf233807ef9526b75d74afbddf92d8 Author: nnutter <iam> 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. Hm, no. It's caused by this Test-Simple commit: commit 497965306444982d4948e24811e44e72619885f8 Author: Michael G. Schwern <schwern> 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 ) = @_; Fixed perl-Test-Simple is being built now. I will push and build fixed perl-Test-Class in turn. |