+ if ($v == 2 && $level eq 'basic') {
+ is_deeply([glob("$ibx->{inboxdir}/xap*/?/")], [],
+ 'no Xapian shard directories for v2 basic');
+ }
+ if ($level ne 'basic') {
+ $msgs = $ro_mirror->search->reopen->query('m:m@2');
+ is(scalar(@$msgs), 0,
+ "v$v m\@2 gone from Xapian in mirror on $level");
+ }
+
+ # add another message to master and have the mirror
+ # sync and reindex it
+ my @expect = map { $_->{num} } @{$ibx->over->query_ts(0, 0)};
+ foreach my $i (3..5) {
+ $mime->header_set('Message-ID', "<m\@$i>");
+ ok($im->add($mime), "#$i message added");
+ push @expect, $i;
+ }
+ $im->done;
+ is(xsys('git', "--git-dir=$fetch_dir", qw(fetch -q)), 0, 'fetch OK');
+ ok(run_script([qw(-index -j0 --reindex), $mirror]),
+ "v$v index --reindex mirror OK");
+ @ro_nums = map { $_->{num} } @{$ro_mirror->over->query_ts(0, 0)};
+ @rw_nums = map { $_->{num} } @{$ibx->over->query_ts(0, 0)};
+ is_deeply(\@rw_nums, \@expect, "v$v master has expected NNTP articles");
+ is_deeply(\@ro_nums, \@expect, "v$v mirror matches master articles");
+
+ is(PublicInbox::Admin::detect_indexlevel($ro_mirror), $level,
+ 'indexlevel detectable by Admin '.$v.$level);
+
+ SKIP: {
+ skip 'xapian-compact missing', 1 if !$have_xapian_compact;
+ my $cmd = [ qw(-compact), $mirror ];
+ ok(run_script($cmd, undef, { 2 => \$err}), "compact $level");
+ }
+};
+
+# we can probably cull some other tests
+$import_index_incremental->($PI_TEST_VERSION, 'basic', $mime);
+
+SKIP: {
+ require PublicInbox::Search;
+ PublicInbox::Search::load_xapian() or
+ skip('Xapian perl binding missing', 2);
+ foreach my $l (qw(medium full)) {
+ $import_index_incremental->($PI_TEST_VERSION, $l, $mime);