MANIFEST | 1 + t/ds-leak.t | 4 ++-- t/indexlevels-mirror-v1.t | 4 ++++ t/indexlevels-mirror.t | 29 ++++++++++------------------- t/nntpd.t | 2 +- diff --git a/MANIFEST b/MANIFEST index 8a3f2a4a3a229cc75b04092a5e0de1c31178d2dd..251f95f7e199c147b30a8c38a280870ed0840f01 100644 --- a/MANIFEST +++ b/MANIFEST @@ -204,6 +204,7 @@ t/httpd.t t/hval.t t/import.t t/inbox.t +t/indexlevels-mirror-v1.t t/indexlevels-mirror.t t/init.t t/linkify.t diff --git a/t/ds-leak.t b/t/ds-leak.t index 9e3243e92c6118a3d998560d832af4271c3634ed..dd8446dcd1f77e0f9a2d167ab0c057c917a443bb 100644 --- a/t/ds-leak.t +++ b/t/ds-leak.t @@ -8,7 +8,7 @@ use warnings; use Test::More; use_ok 'PublicInbox::DS'; -subtest('close-on-exec for epoll and kqueue' => sub { +if ('close-on-exec for epoll and kqueue') { use PublicInbox::Spawn qw(spawn); my $pid; my $evfd_re = qr/(?:kqueue|eventpoll)/i; @@ -29,7 +29,7 @@ kill(9, $pid); waitpid($pid, 0); } PublicInbox::DS->Reset; -}); +} SKIP: { # not bothering with BSD::Resource diff --git a/t/indexlevels-mirror-v1.t b/t/indexlevels-mirror-v1.t new file mode 100644 index 0000000000000000000000000000000000000000..9998a09a7fc593c44991cd0e96ef2ae5b2133835 --- /dev/null +++ b/t/indexlevels-mirror-v1.t @@ -0,0 +1,4 @@ +# Copyright (C) 2019 all contributors +# License: AGPL-3.0+ +$ENV{PI_TEST_VERSION} = 1; +require './t/indexlevels-mirror.t'; diff --git a/t/indexlevels-mirror.t b/t/indexlevels-mirror.t index bf0f801822adf4970dae3e1bccdc0f9794b8e254..359749471bbb319f3d6a5eee1729d4300ff15da0 100644 --- a/t/indexlevels-mirror.t +++ b/t/indexlevels-mirror.t @@ -9,12 +9,12 @@ use PublicInbox::InboxWritable; use File::Temp qw/tempdir/; require PublicInbox::Admin; require './t/common.perl'; -require_git(2.6); -my $this = (split('/', __FILE__))[-1]; +my $PI_TEST_VERSION = $ENV{PI_TEST_VERSION} || 2; +require_git('2.6') if $PI_TEST_VERSION == 2; foreach my $mod (qw(DBD::SQLite)) { eval "require $mod"; - plan skip_all => "$mod missing for $this" if $@; + plan skip_all => "$mod missing for $0" if $@; } my $path = 'blib/script'; @@ -33,10 +33,11 @@ ); sub import_index_incremental { my ($v, $level) = @_; - my $tmpdir = tempdir("pi-$this-tmp-XXXXXX", TMPDIR => 1, CLEANUP => 1); + my $this = "pi-$v-$level-indexlevels"; + my $tmpdir = tempdir("$this-tmp-XXXXXX", TMPDIR => 1, CLEANUP => 1); my $ibx = PublicInbox::Inbox->new({ mainrepo => "$tmpdir/testbox", - name => "$this-$v", + name => $this, version => $v, -primary_address => 'test@example.com', indexlevel => $level, @@ -165,24 +166,14 @@ is(PublicInbox::Admin::detect_indexlevel($ro_mirror), $level, 'indexlevel detectable by Admin '.$v.$level); } -# we can probably cull some other tests and put full/medium tests, here -for my $level (qw(basic)) { - for my $v (1..2) { - subtest("v$v indexlevel=$level" => sub { - import_index_incremental($v, $level); - }) - } -} +# we can probably cull some other tests +import_index_incremental($PI_TEST_VERSION, 'basic'); SKIP: { require PublicInbox::Search; PublicInbox::Search::load_xapian() or skip 'Search::Xapian missing', 2; - for my $v (1..2) { - foreach my $l (qw(medium full)) { - subtest("v$v indexlevel=$l" => sub { - import_index_incremental($v, $l); - }); - } + foreach my $l (qw(medium full)) { + import_index_incremental($PI_TEST_VERSION, $l); } } diff --git a/t/nntpd.t b/t/nntpd.t index aa62ff6036b86648ec9303f20d5cfee07b1fe784..c73cc122eaa009618fd6bab0df357fe5b23e6173 100644 --- a/t/nntpd.t +++ b/t/nntpd.t @@ -19,7 +19,7 @@ use Sys::Hostname; require './t/common.perl'; # FIXME: make easier to test both versions -my $version = $ENV{PI_VERSION} || 2; +my $version = $ENV{PI_TEST_VERSION} || 2; require_git('2.6') if $version == 2; my $tmpdir = tempdir('pi-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);