* [PATCH 2/2] tests: require git 2.6+ in more places
2020-06-20 0:13 6% [PATCH 0/2] test fixes for older systems Eric Wong
@ 2020-06-20 0:13 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-06-20 0:13 UTC (permalink / raw)
To: meta
We also need to check for git 2.6 earlier in each test case,
before any other TAP output is emitted to avoid confusing the
TAP consumers.
---
t/git.t | 3 ++-
t/imap.t | 2 +-
t/imapd.t | 2 +-
t/inbox_idle.t | 2 +-
t/psgi_bad_mids.t | 1 +
t/psgi_multipart_not.t | 1 +
t/psgi_scan_all.t | 1 +
7 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/t/git.t b/t/git.t
index 228df90f..dfd7173a 100644
--- a/t/git.t
+++ b/t/git.t
@@ -84,7 +84,8 @@ if (1) {
ok($gcf->packed_bytes > 0, 'packed size is positive');
}
-if ('alternates reloaded') {
+SKIP: {
+ require_git(2.6, 7) or skip('need git 2.6+ for --batch-all-objects', 7);
my ($alt, $alt_obj) = tmpdir();
my $hash_obj = [ 'git', "--git-dir=$alt", qw(hash-object -w --stdin) ];
PublicInbox::Import::init_bare($alt);
diff --git a/t/imap.t b/t/imap.t
index 95bda4fa..5a251c6b 100644
--- a/t/imap.t
+++ b/t/imap.t
@@ -5,11 +5,11 @@
use strict;
use Test::More;
use PublicInbox::TestCommon;
+require_git 2.6;
require_mods(qw(DBD::SQLite Email::Address::XS||Mail::Address
Parse::RecDescent));
require_ok 'PublicInbox::IMAP';
require_ok 'PublicInbox::IMAPD';
-require_git 2.6;
my ($tmpdir, $for_destroy) = tmpdir();
my $cfgfile = "$tmpdir/config";
diff --git a/t/imapd.t b/t/imapd.t
index f9d93448..ffa195d5 100644
--- a/t/imapd.t
+++ b/t/imapd.t
@@ -105,7 +105,7 @@ my @orig_list = @raw = $mic->list;
like($raw[0], qr/^\* LIST \(.*?\) "\." INBOX/,
'got an inbox');
like($raw[-1], qr/^\S+ OK /, 'response ended with OK');
-is(scalar(@raw), scalar(@V) + 4, 'default LIST response');
+is(scalar(@raw), scalar(@V) * 2 + 2, 'default LIST response');
@raw = $mic->list('', 'inbox.i1');
is(scalar(@raw), 2, 'limited LIST response');
like($raw[0], qr/^\* LIST \(.*?\) "\." INBOX/,
diff --git a/t/inbox_idle.t b/t/inbox_idle.t
index 6bd56113..f754e0fc 100644
--- a/t/inbox_idle.t
+++ b/t/inbox_idle.t
@@ -4,10 +4,10 @@
use Test::More;
use PublicInbox::TestCommon;
use PublicInbox::Config;
+require_git 2.6;
require_mods(qw(DBD::SQLite));
require PublicInbox::SearchIdx;
use_ok 'PublicInbox::InboxIdle';
-require_git('2.6');
use PublicInbox::InboxWritable;
my ($tmpdir, $for_destroy) = tmpdir();
diff --git a/t/psgi_bad_mids.t b/t/psgi_bad_mids.t
index 81bd9356..70393573 100644
--- a/t/psgi_bad_mids.t
+++ b/t/psgi_bad_mids.t
@@ -8,6 +8,7 @@ use PublicInbox::Config;
use PublicInbox::TestCommon;
my @mods = qw(DBD::SQLite HTTP::Request::Common Plack::Test
URI::Escape Plack::Builder PublicInbox::WWW);
+require_git 2.6;
require_mods(@mods);
use_ok($_) for @mods;
use_ok 'PublicInbox::WWW';
diff --git a/t/psgi_multipart_not.t b/t/psgi_multipart_not.t
index e36820f4..9b7fb4d0 100644
--- a/t/psgi_multipart_not.t
+++ b/t/psgi_multipart_not.t
@@ -6,6 +6,7 @@ use Test::More;
use PublicInbox::Eml;
use PublicInbox::Config;
use PublicInbox::TestCommon;
+require_git 2.6;
my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common
Plack::Test URI::Escape Plack::Builder Plack::Test);
require_mods(@mods);
diff --git a/t/psgi_scan_all.t b/t/psgi_scan_all.t
index 46eb489f..c8cb2409 100644
--- a/t/psgi_scan_all.t
+++ b/t/psgi_scan_all.t
@@ -7,6 +7,7 @@ use PublicInbox::Eml;
use PublicInbox::Config;
use PublicInbox::TestCommon;
my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape DBD::SQLite);
+require_git 2.6;
require_mods(@mods);
use_ok 'PublicInbox::V2Writable';
foreach my $mod (@mods) { use_ok $mod; }
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] test fixes for older systems
@ 2020-06-20 0:13 6% Eric Wong
2020-06-20 0:13 7% ` [PATCH 2/2] tests: require git 2.6+ in more places Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-06-20 0:13 UTC (permalink / raw)
To: meta
I've been relying git2u (IUS, git 2.16) package for CentOS 7.x,
so I failed to notice the git 1.8.3 package was not skipping
several v2-only tests. So properly account for older versions
of git and skip those tests.
We'll also match IO::Socket::SSL support to what libnet
(Net::NNTP) supports, since it doesn't seem worth the
effort to support < 2.007 and skip tests if IO::Socket::SSL
is too old
Eric Wong (2):
testcommon: require IO::Socket::SSL >= 2.007
tests: require git 2.6+ in more places
lib/PublicInbox/TestCommon.pm | 10 +++++++++-
t/git.t | 3 ++-
t/imap.t | 2 +-
t/imapd.t | 2 +-
t/inbox_idle.t | 2 +-
t/nntpd-tls.t | 2 --
t/nntpd.t | 5 -----
t/psgi_bad_mids.t | 1 +
t/psgi_multipart_not.t | 1 +
t/psgi_scan_all.t | 1 +
10 files changed, 17 insertions(+), 12 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-06-20 0:13 6% [PATCH 0/2] test fixes for older systems Eric Wong
2020-06-20 0:13 7% ` [PATCH 2/2] tests: require git 2.6+ in more places Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).