* [PATCH] t/xcpdb-reshard: skip --compact if xapian-compact(1) is missing
@ 2020-04-01 5:59 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2020-04-01 5:59 UTC (permalink / raw)
To: meta
Skip a small part of a test than fail entirely because
xapian-compact is not installed.
---
t/xcpdb-reshard.t | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t
index 58932fc2..d3cb36c5 100644
--- a/t/xcpdb-reshard.t
+++ b/t/xcpdb-reshard.t
@@ -8,6 +8,7 @@ require_mods(qw(DBD::SQLite Search::Xapian));
require_git('2.6');
use PublicInbox::MIME;
use PublicInbox::InboxWritable;
+use PublicInbox::Spawn qw(which);
require PublicInbox::Search;
my $mime = PublicInbox::MIME->create(
@@ -43,12 +44,14 @@ my @shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
is(scalar(@shards), $nproc - 1, 'got expected shards');
my $orig = $ibx->over->query_xover(1, $ndoc);
my %nums = map {; "$_->{num}" => 1 } @$orig;
+my $xapian_compact = which('xapian-compact') or
+ diag("`xapian-compact' missing, unable to test --compact");
# ensure we can go up or down in shards, or stay the same:
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;
+ push @$cmd, '--compact' if $R == 1 && $xapian_compact;
ok(run_script($cmd), "xcpdb -R$R");
my @new_shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
is(scalar(@new_shards), $R, 'resharded to two shards');
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-04-01 5:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 5:59 [PATCH] t/xcpdb-reshard: skip --compact if xapian-compact(1) is missing Eric Wong
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).