From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 1/2] tests: fix test failures when Xapian is missing
Date: Sun, 8 Aug 2021 01:14:16 +0000 [thread overview]
Message-ID: <20210808011417.26927-2-e@80x24.org> (raw)
In-Reply-To: <20210808011417.26927-1-e@80x24.org>
We still support usage without Xapian, so ensure our tests
work when Xapian bindings are missing
---
t/imapd.t | 9 ++++++---
t/thread-index-gap.t | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/t/imapd.t b/t/imapd.t
index 8cdb4e4a..906b6926 100644
--- 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;
diff --git a/t/thread-index-gap.t b/t/thread-index-gap.t
index d3cb6204..15c362f0 100644
--- a/t/thread-index-gap.t
+++ b/t/thread-index-gap.t
@@ -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) {
next prev parent reply other threads:[~2021-08-08 1:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-08 1:14 [PATCH 0/2] fix handling of missing Xapian Eric Wong
2021-08-08 1:14 ` Eric Wong [this message]
2021-08-08 1:14 ` [PATCH 2/2] searchidx: die on Xapian load errors 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
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210808011417.26927-2-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.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).