]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/perf-msgview.t
config: simplify lookup* methods
[public-inbox.git] / t / perf-msgview.t
index adeb7aac78caef3401324346d4e466272fa09937..0defafc4ad7d90a07791113af89584eb38949b15 100644 (file)
@@ -8,6 +8,9 @@ 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 @cat = qw(cat-file --buffer --batch-check --batch-all-objects);
 if (require_git(2.19, 1)) {
        push @cat, '--unordered';
@@ -16,9 +19,7 @@ if (require_git(2.19, 1)) {
 "git <2.19, cat-file lacks --unordered, locality suffers\n";
 }
 
-my $pi_dir = $ENV{GIANT_PI_DIR};
-plan skip_all => "GIANT_PI_DIR not defined for $0" unless $pi_dir;
-
+use_ok 'Plack::Util';
 my $ibx = PublicInbox::Inbox->new({ mainrepo => $pi_dir, name => 'name' });
 my $git = $ibx->git;
 my $fh = $git->popen(@cat);
@@ -29,6 +30,7 @@ select($vec, undef, undef, 60) or die "timed out waiting for --batch-check";
 my $ctx = {
        env => { HTTP_HOST => 'example.com', 'psgi.url_scheme' => 'https' },
        -inbox => $ibx,
+       www => Plack::Util::inline_object(style => sub {''}),
 };
 my ($str, $mime, $res, $cmt, $type);
 my $n = 0;