]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/perf-*.t: use $ENV{GIANT_INBOX_DIR} consistently
authorEric Wong <e@80x24.org>
Sun, 24 Nov 2019 00:22:36 +0000 (00:22 +0000)
committerEric Wong <e@80x24.org>
Sun, 24 Nov 2019 21:47:21 +0000 (21:47 +0000)
It's more consistent with our current terminology and
"PI_DIR" is already used to override ~/.public-inbox/
(which holds "config" and possibly other files which affect
all inboxes for a particular user, but is not an inbox itself);
so stop advertising GIANT_PI_DIR in skip messages.

t/perf-msgview.t
t/perf-nntpd.t
t/perf-threading.t

index 492ed4877a90d517b3ca2ae354121eee0f669eff..22d8ce209fd01de79792fb0d89c86e478fd3117b 100644 (file)
@@ -8,8 +8,8 @@ use PublicInbox::Inbox;
 use PublicInbox::View;
 require './t/common.perl';
 
-my $pi_dir = $ENV{GIANT_PI_DIR};
-plan skip_all => "GIANT_PI_DIR not defined for $0" unless $pi_dir;
+my $inboxdir = $ENV{GIANT_INBOX_DIR} // $ENV{GIANT_PI_DIR};
+plan skip_all => "GIANT_INBOX_DIR not defined for $0" unless $inboxdir;
 
 my @cat = qw(cat-file --buffer --batch-check --batch-all-objects);
 if (require_git(2.19, 1)) {
@@ -20,7 +20,7 @@ if (require_git(2.19, 1)) {
 }
 
 use_ok 'Plack::Util';
-my $ibx = PublicInbox::Inbox->new({ inboxdir => $pi_dir, name => 'name' });
+my $ibx = PublicInbox::Inbox->new({ inboxdir => $inboxdir, name => 'name' });
 my $git = $ibx->git;
 my $fh = $git->popen(@cat);
 my $vec = '';
index 6f891ddb0a7383ef8b7a005c97d6743936948d06..5a176e08eeb01960b4fbfeba74900e8a6da69137 100644 (file)
@@ -6,8 +6,8 @@ use Test::More;
 use Benchmark qw(:all :hireswallclock);
 use PublicInbox::Inbox;
 use Net::NNTP;
-my $pi_dir = $ENV{GIANT_PI_DIR};
-plan skip_all => "GIANT_PI_DIR not defined for $0" unless $pi_dir;
+my $inboxdir = $ENV{GIANT_INBOX_DIR} // $ENV{GIANT_PI_DIR};
+plan skip_all => "GIANT_INBOX_DIR not defined for $0" unless defined($inboxdir);
 eval { require PublicInbox::Search };
 my ($host_port, $group, %opts, $s, $td, $tmp_obj);
 require './t/common.perl';
@@ -17,7 +17,7 @@ if (($ENV{NNTP_TEST_URL} || '') =~ m!\Anntp://([^/]+)/([^/]+)\z!) {
        $host_port .= ":119" unless index($host_port, ':') > 0;
 } else {
        $group = 'inbox.test.perf.nntpd';
-       my $ibx = { inboxdir => $pi_dir, newsgroup => $group };
+       my $ibx = { inboxdir => $inboxdir, newsgroup => $group };
        $ibx = PublicInbox::Inbox->new($ibx);
        my $tmpdir;
        ($tmpdir, $tmp_obj) = tmpdir();
@@ -28,7 +28,7 @@ if (($ENV{NNTP_TEST_URL} || '') =~ m!\Anntp://([^/]+)/([^/]+)\z!) {
                print $fh <<"" or die "print $pi_config: $!";
 [publicinbox "test"]
        newsgroup = $group
-       inboxdir = $pi_dir
+       inboxdir = $inboxdir
        address = test\@example.com
 
                close $fh or die "close($pi_config): $!";
index 8d28b3a0fb8394d18707e187ba9bc32991f23fd7..1038bda520d9f29773a10e56dad725cb99357a62 100644 (file)
@@ -7,12 +7,12 @@ use warnings;
 use Test::More;
 use Benchmark qw(:all);
 use PublicInbox::Inbox;
-my $pi_dir = $ENV{GIANT_PI_DIR};
-plan skip_all => "GIANT_PI_DIR not defined for $0" unless $pi_dir;
-my $ibx = PublicInbox::Inbox->new({ inboxdir => $pi_dir });
+my $inboxdir = $ENV{GIANT_INBOX_DIR} // $ENV{GIANT_PI_DIR};
+plan skip_all => "GIANT_INBOX_DIR not defined for $0" unless $inboxdir;
+my $ibx = PublicInbox::Inbox->new({ inboxdir => $inboxdir });
 eval { require PublicInbox::Search };
 my $srch = $ibx->search;
-plan skip_all => "$pi_dir not configured for search $0 $@" unless $srch;
+plan skip_all => "$inboxdir not configured for search $0 $@" unless $srch;
 
 require PublicInbox::View;