]> Sergey Matveev's repositories - public-inbox.git/commitdiff
tests: skip properly with git <2.6
authorEric Wong <e@80x24.org>
Wed, 10 Feb 2021 21:50:48 +0000 (21:50 +0000)
committerEric Wong <e@80x24.org>
Wed, 10 Feb 2021 21:51:08 +0000 (21:51 +0000)
Tested with git 1.8.3.1 on CentOS 7.x

`plan skip_all => ...' doesn't work after some tests have run,
we have to call skip() instead.

lib/PublicInbox/TestCommon.pm
t/nntpd.t

index f5b3fae43e8219bcb5a758dd0ed8ea5d8b3bfa12..d6b7d20e385b1b7e68d98444ea570ac46cc671cb 100644 (file)
@@ -476,7 +476,7 @@ sub test_lei {
 SKIP: {
        my ($cb) = pop @_;
        my $test_opt = shift // {};
-       require_git(2.6) or skip('git 2.6+ required for lei test', 2);
+       require_git(2.6, 1) or skip('git 2.6+ required for lei test', 2);
        require_mods(qw(json DBD::SQLite Search::Xapian), 2);
        require PublicInbox::Config;
        delete local $ENV{XDG_DATA_HOME};
index 6c100138b262918298c5ced9d872695c197b43d4..18aaccbea50f6c0a7a5c853c9ee75df5b5abb007 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -13,11 +13,11 @@ use Net::NNTP;
 use Sys::Hostname;
 use POSIX qw(_exit);
 use Digest::SHA;
-use_ok 'PublicInbox::Msgmap';
 
 # t/nntpd-v2.t wraps this for v2
 my $version = $ENV{PI_TEST_VERSION} || 1;
 require_git('2.6') if $version == 2;
+use_ok 'PublicInbox::Msgmap';
 my $lsof = which('lsof');
 my $fast_idle = eval { require Linux::Inotify2; 1 } //
                eval { require IO::KQueue; 1 };