]> Sergey Matveev's repositories - public-inbox.git/commitdiff
tests: fix test failures when Xapian is missing
authorEric Wong <e@80x24.org>
Sun, 8 Aug 2021 01:14:16 +0000 (01:14 +0000)
committerEric Wong <e@80x24.org>
Sun, 8 Aug 2021 01:17:25 +0000 (01:17 +0000)
We still support usage without Xapian, so ensure our tests
work when Xapian bindings are missing

t/imapd.t
t/thread-index-gap.t

index 8cdb4e4aa12e85f04ff9268f6e8cee0eec0c00d5..906b69266e888d4387bcea74c96e2adb562bc97a 100644 (file)
--- a/t/imapd.t
+++ b/t/imapd.t
@@ -39,7 +39,8 @@ print $cfgfh <<EOM or BAIL_OUT;
 EOM
 my $eml;
 for my $V (@V) {
-       my $ibx = create_inbox("i$V", tmpdir => "$tmpdir/i$V", version => $V,
+       my $ibx = create_inbox("i$V-$level",
+                               tmpdir => "$tmpdir/i$V", version => $V,
                                indexlevel => $level, sub {
                my ($im) = @_;
                $im->add($eml //= eml_load('t/utf8.eml')) or BAIL_OUT;
@@ -52,6 +53,7 @@ for my $V (@V) {
        address = $ibx->{-primary_address};
        newsgroup = inbox.i$V
        url = http://example.com/i$V
+       indexlevel = $level
 EOF
 }
 close $cfgfh or BAIL_OUT;
@@ -444,7 +446,7 @@ SKIP: {
        mkdir "$home/.public-inbox" or BAIL_OUT $!;
        local $ENV{HOME} = $home;
        my $name = 'watchimap';
-       my $addr = "i1\@example.com";
+       my $addr = "i1-$level\@example.com";
        my $url = "http://example.com/i1";
        my $inboxdir = "$tmpdir/watchimap";
        my $cmd = ['-init', '-V2', '-Lbasic', $name, $inboxdir, $url, $addr];
@@ -472,7 +474,8 @@ SKIP: {
        open my $fh, '<', 't/iso-2202-jp.eml' or BAIL_OUT $!;
        $old_env->{ORIGINAL_RECIPIENT} = $addr;
        ok(run_script([qw(-mda --no-precheck)], $old_env, { 0 => $fh }),
-               'delivered a message for IDLE to kick -watch');
+               'delivered a message for IDLE to kick -watch') or
+               diag "mda error \$?=$?";
        diag 'waiting for IMAP IDLE wakeup';
        PublicInbox::DS->SetPostLoopCallback(undef);
        PublicInbox::DS->EventLoop;
index d3cb6204cbd84c5552251c39ffe3e3ed1f9f26b2..15c362f031be8b08b529874aa39cef744fe9c240 100644 (file)
@@ -31,9 +31,9 @@ EOF
 my ($home, $for_destroy) = tmpdir();
 for my $msgs (['orig', reverse @msgs], ['shuffle', shuffle(@msgs)]) {
        my $desc = shift @$msgs;
-       my $n = "index-cap-$desc";
+       my $n = "index-cap-$desc-basic";
        # yes, the shuffle case gets memoized by create_inbox, oh well
-       my $ibx = create_inbox $desc, version => 2, indexlevel => 'full',
+       my $ibx = create_inbox $desc, version => 2, indexlevel => 'basic',
                                tmpdir => "$home/$desc", sub {
                my ($im) = @_;
                for my $m (@$msgs) {