]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/perf-msgview.t: fix broken performance test
authorEric Wong <e@80x24.org>
Wed, 6 Feb 2019 23:22:56 +0000 (23:22 +0000)
committerEric Wong <e@80x24.org>
Thu, 7 Feb 2019 21:38:34 +0000 (21:38 +0000)
WwwStream started depending on the WWW::style method
for configurable CSS, so mock ::style so the benchmark
runs properly.

Fixes: f026dbdd392c9dd5 ('www: admin-configurable CSS via "publicinbox.css"')
t/perf-msgview.t

index 4975305ad16f36c510add459c1aeef543ff26cb9..0defafc4ad7d90a07791113af89584eb38949b15 100644 (file)
@@ -19,6 +19,7 @@ if (require_git(2.19, 1)) {
 "git <2.19, cat-file lacks --unordered, locality suffers\n";
 }
 
+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;