X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fconvert-compact.t;h=6d09103176c69cb31ad95f6f1f65e3e5e933fe2e;hb=dde1b083571ed893cbb1990f01f9e11ed804cba5;hp=ced45415e70c580227a5f58ec0b1b4e18669ec81;hpb=0961df2523044bf32270909f4983349eccad0153;p=public-inbox.git
diff --git a/t/convert-compact.t b/t/convert-compact.t
index ced45415..6d091031 100644
--- a/t/convert-compact.t
+++ b/t/convert-compact.t
@@ -1,15 +1,21 @@
-# Copyright (C) 2018 all contributors
+# Copyright (C) 2018-2019 all contributors
# License: AGPL-3.0+
use strict;
use warnings;
use Test::More;
use File::Temp qw/tempdir/;
use PublicInbox::MIME;
+use PublicInbox::Spawn qw(which);
+require './t/common.perl';
+require_git(2.6);
my @mods = qw(DBD::SQLite Search::Xapian);
foreach my $mod (@mods) {
eval "require $mod";
plan skip_all => "$mod missing for convert-compact.t" if $@;
}
+which('xapian-compact') or
+ plan skip_all => 'xapian-compact missing for '.__FILE__;
+
use_ok 'PublicInbox::V2Writable';
use PublicInbox::Import;
my $tmpdir = tempdir('convert-compact-XXXXXX', TMPDIR => 1, CLEANUP => 1);
@@ -40,7 +46,10 @@ ok($im->add($mime), 'added one message');
ok($im->remove($mime), 'remove message');
ok($im->add($mime), 'added message again');
$im->done;
-PublicInbox::SearchIdx->new($ibx, 1)->index_sync;
+for (1..2) {
+ eval { PublicInbox::SearchIdx->new($ibx, 1)->index_sync; };
+ is($@, '', 'no errors syncing');
+}
is(((stat("$ibx->{mainrepo}/public-inbox"))[2]) & 07777, 0755,
'sharedRepository respected for v1');
@@ -54,6 +63,7 @@ foreach (@xdir) {
}
local $ENV{PATH} = "blib/script:$ENV{PATH}";
+local $ENV{PI_CONFIG} = '/dev/null';
open my $err, '>>', "$tmpdir/err.log" or die "open: err.log $!\n";
open my $out, '>>', "$tmpdir/out.log" or die "open: out.log $!\n";
my $rdr = { 1 => fileno($out), 2 => fileno($err) };