X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fextsearch.t;h=03bcad95ee5b162bcddb922bb640d6565a49f46c;hb=d9b0f6432682e4ad0a49f7befccde208e4565f1d;hp=dfc190e2d69e8a3d2628361a62db45d1102c86f2;hpb=2a3c8d7a2c40ad9424db10d68470d8bb120bddf9;p=public-inbox.git
diff --git a/t/extsearch.t b/t/extsearch.t
index dfc190e2..03bcad95 100644
--- a/t/extsearch.t
+++ b/t/extsearch.t
@@ -1,5 +1,5 @@
#!perl -w
-# Copyright (C) 2020-2021 all contributors
+# Copyright (C) all contributors
# License: AGPL-3.0+
use strict;
use Test::More;
@@ -13,8 +13,6 @@ require PublicInbox::Search;
use_ok 'PublicInbox::ExtSearch';
use_ok 'PublicInbox::ExtSearchIdx';
use_ok 'PublicInbox::OverIdx';
-my $sock = tcp_server();
-my $host_port = tcp_host_port($sock);
my ($home, $for_destroy) = tmpdir();
local $ENV{HOME} = $home;
mkdir "$home/.public-inbox" or BAIL_OUT $!;
@@ -54,7 +52,8 @@ run_script(['-mda', '--no-precheck'], $env, { 0 => $fh }) or BAIL_OUT '-mda';
run_script([qw(-index -Lbasic), "$home/v1test"]) or BAIL_OUT "index $?";
-ok(run_script([qw(-extindex --all), "$home/extindex"]), 'extindex init');
+ok(run_script([qw(-extindex --dangerous --all), "$home/extindex"]),
+ 'extindex init');
{
my $es = PublicInbox::ExtSearch->new("$home/extindex");
ok($es->has_threadid, '->has_threadid');
@@ -124,6 +123,8 @@ EOF
SKIP: {
require_mods(qw(Net::NNTP), 1);
+ my $sock = tcp_server();
+ my $host_port = tcp_host_port($sock);
my ($out, $err) = ("$home/nntpd.out.log", "$home/nntpd.err.log");
my $cmd = [ '-nntpd', '-W0', "--stdout=$out", "--stderr=$err" ];
my $td = start_script($cmd, undef, { 3 => $sock });
@@ -308,12 +309,17 @@ if ('reindex catches missed messages') {
is($oidx->eidx_meta($lc_key), $cmt_b, 'lc-v2 stays unchanged');
my @err = split(/^/, $err);
is(scalar(@err), 1, 'only one warning') or diag "err=$err";
- like($err[0], qr/I: reindex_unseen/, 'got reindex_unseen message');
+ like($err[0], qr/# reindex_unseen/, 'got reindex_unseen message');
my $new = $oidx->get_art($max + 1);
is($new->{subject}, $eml->header('Subject'), 'new message added');
$es->{xdb}->reopen;
- my $mset = $es->mset("mid:$new->{mid}");
+ # git patch-id --stable search->mset("patchid:$patchid");
+ is($mset->size, 1, 'patchid search works');
+
+ $mset = $es->mset("mid:$new->{mid}");
is($mset->size, 1, 'previously unseen, now indexed in Xapian');
ok($im->remove($eml), 'remove new message from v2 inbox');
@@ -409,8 +415,8 @@ if ('remove v1test and test gc') {
my $opt = { 2 => \(my $err = '') };
ok(run_script([qw(-extindex --gc), "$home/extindex"], undef, $opt),
'extindex --gc');
- like($err, qr/^I: remove #1 v1\.example /ms, 'removed v1 message');
- is(scalar(grep(!/^I:/, split(/^/m, $err))), 0,
+ like($err, qr/^# remove #1 v1\.example /ms, 'removed v1 message');
+ is(scalar(grep(!/^#/, split(/^/m, $err))), 0,
'no non-informational messages');
$misc->{xdb}->reopen;
@it = $misc->mset('')->items;