From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Subject: [PATCH 6/7] tests: allow more tests to pass without xapian-compact
Date: Tue, 12 Sep 2023 11:21:52 +0000 [thread overview]
Message-ID: <20230912112153.2484197-6-e@80x24.org> (raw)
In-Reply-To: <20230912112153.2484197-1-e@80x24.org>
---
lib/PublicInbox/TestCommon.pm | 3 ++-
t/extsearch.t | 2 +-
t/nntpd.t | 4 ++--
t/xcpdb-reshard.t | 2 +-
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index b1a37ced..a8323e4d 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -105,7 +105,8 @@ sub require_cmd ($;$) {
my $bin = $CACHE{$cmd} //= PublicInbox::Spawn::which($cmd);
return $bin if $bin;
return plan(skip_all => "$cmd missing from PATH for $0") if !$nr;
- defined(wantarray) ? undef : skip("$cmd missing, skipping $nr tests")
+ defined(wantarray) ? undef :
+ skip("$cmd missing, skipping $nr tests", $nr);
}
sub have_xapian_compact (;$) {
diff --git a/t/extsearch.t b/t/extsearch.t
index 545330aa..8ded3382 100644
--- a/t/extsearch.t
+++ b/t/extsearch.t
@@ -480,7 +480,7 @@ SKIP: {
for my $i (2..3) {
is(grep(m!/ei[0-9]+/$i\z!, @dirs), 0, "no shard [$i]");
}
- skip 'xapian-compact missing', 4 unless have_xapian_compact;
+ have_xapian_compact 1;
ok(run_script([qw(-compact), $d], undef, $o), 'compact');
# n.b. stderr contains xapian-compact output
diff --git a/t/nntpd.t b/t/nntpd.t
index f98d638e..9a7efd86 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -341,8 +341,8 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
}
# -compact requires Xapian
SKIP: {
- require_mods('Xapian', 2);
- have_xapian_compact or skip 'xapian-compact missing', 2;
+ require_mods('Xapian', 1);
+ have_xapian_compact 1;
is(xsys(qw(git config), "--file=$home/.public-inbox/config",
"publicinbox.$group.indexlevel", 'medium'),
0, 'upgraded indexlevel');
diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t
index cde9f151..7797aaaf 100644
--- a/t/xcpdb-reshard.t
+++ b/t/xcpdb-reshard.t
@@ -43,7 +43,7 @@ my $XapianDatabase = do {
for my $R (qw(2 4 1 3 3)) {
delete $ibx->{search}; # release old handles
my $cmd = [@xcpdb, "-R$R", $ibx->{inboxdir}];
- push @$cmd, '--compact' if $R == 1 && have_xapian_compact;
+ push @$cmd, '--compact' if $R == 1 && have_xapian_compact(1);
ok(run_script($cmd, $env), "xcpdb -R$R");
my @new_shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
is(scalar(@new_shards), $R, 'resharded to two shards');
next prev parent reply other threads:[~2023-09-12 11:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 11:21 [PATCH 1/7] move deps.perl into new install/ directory Eric Wong
2023-09-12 11:21 ` [PATCH 2/7] INSTALL: update for 2023, NetBSD and OpenBSD Eric Wong
2023-09-12 11:21 ` [PATCH 3/7] tests: favor IO::Socket::IP for IPv6 listeners Eric Wong
2023-09-12 11:21 ` [PATCH 4/7] updates around RPM packages on CentOS 7.x Eric Wong
2023-09-12 11:21 ` [PATCH 5/7] install: note curl Eric Wong
2023-09-12 11:21 ` Eric Wong [this message]
2023-09-12 11:21 ` [PATCH 7/7] ok-pkg Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230912112153.2484197-6-e@80x24.org \
--to=e@80x24.org \
--cc=spew@80x24.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).