-my $tmpdir = tempdir('convert-compact-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $ibx = {
- mainrepo => "$tmpdir/v1",
- name => 'test-v1',
- -primary_address => 'test@example.com',
-};
-
-ok(PublicInbox::Import::run_die([qw(git init --bare -q), $ibx->{mainrepo}]),
- 'initialized v1 repo');
-ok(umask(077), 'set restrictive umask');
-ok(PublicInbox::Import::run_die([qw(git) , "--git-dir=$ibx->{mainrepo}",
- qw(config core.sharedRepository 0644)]), 'set sharedRepository');
-$ibx = PublicInbox::Inbox->new($ibx);
-my $im = PublicInbox::Import->new($ibx->git, undef, undef, $ibx);
-my $mime = PublicInbox::MIME->create(
- header => [
- From => 'a@example.com',
- To => 'test@example.com',
- Subject => 'this is a subject',
- 'Message-ID' => '<a-mid@b>',
- Date => 'Fri, 02 Oct 1993 00:00:00 +0000',
- ],
- body => "hello world\n",
-);
-ok($im->add($mime), 'added one message');
-ok($im->remove($mime), 'remove message');
-ok($im->add($mime), 'added message again');
-$im->done;
-for (1..2) {
- eval { PublicInbox::SearchIdx->new($ibx, 1)->index_sync; };
- is($@, '', 'no errors syncing');
-}
+require_git(2.6);
+require_mods(qw(DBD::SQLite Search::Xapian));
+have_xapian_compact or
+ plan skip_all => 'xapian-compact missing for '.__FILE__;
+my ($tmpdir, $for_destroy) = tmpdir();
+my $ibx = create_inbox 'v1', indexlevel => 'medium', tmpdir => "$tmpdir/v1",
+ pre_cb => sub {
+ my ($inboxdir) = @_;
+ PublicInbox::Import::init_bare($inboxdir);
+ xsys_e(qw(git) , "--git-dir=$inboxdir",
+ qw(config core.sharedRepository 0644));
+ }, sub {
+ my ($im, $ibx) = @_;
+ $im->done;
+ umask(077) or BAIL_OUT "umask: $!";
+ $_[0] = $im = $ibx->importer(0);
+ my $eml = PublicInbox::Eml->new(<<'EOF');
+From: a@example.com
+To: b@example.com
+Subject: this is a subject
+Message-ID: <a-mid@b>
+Date: Fri, 02 Oct 1993 00:00:00 +0000