-# Copyright (C) 2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# manifest.js.gz generation and grok-pull integration test
use strict;
use Test::More;
use PublicInbox::Spawn qw(which);
use PublicInbox::TestCommon;
-my @mods = qw(URI::Escape Plack::Builder Digest::SHA
- IO::Compress::Gzip IO::Uncompress::Gunzip HTTP::Tiny);
-foreach my $mod (@mods) {
- eval("require $mod") or plan skip_all => "$mod missing for $0";
-}
-
+require_mods(qw(URI::Escape Plack::Builder Digest::SHA
+ IO::Compress::Gzip IO::Uncompress::Gunzip HTTP::Tiny));
require PublicInbox::WwwListing;
my $json = eval { PublicInbox::WwwListing::_json() };
plan skip_all => "JSON module missing: $@" if $@;
sub tiny_test {
my ($json, $host, $port) = @_;
my $http = HTTP::Tiny->new;
- my $res = $http->get("http://$host:$port/manifest.js.gz");
+ my $res = $http->get("http://$host:$port/");
+ is($res->{status}, 200, 'got HTML listing');
+ like($res->{content}, qr!</html>!si, 'listing looks like HTML');
+ $res = $http->get("http://$host:$port/manifest.js.gz");
is($res->{status}, 200, 'got manifest');
my $tmp;
IO::Uncompress::Gunzip::gunzip(\(delete $res->{content}) => \$tmp);
my @clone = qw(git clone -q -s --bare);
is(system(@clone, $bare->{git_dir}, $alt), 0, 'clone shared repo');
+ system(qw(git init --bare -q), "$v2/all.git") == 0 or die;
for my $i (0..2) {
is(system(@clone, $alt, "$v2/git/$i.git"), 0, "clone epoch $i");
}
ok(unlink("$bare->{git_dir}/description"), 'removed bare/description');
open $fh, '>', $cfgfile or die;
print $fh <<"" or die;
+[publicinbox]
+ wwwlisting = all
[publicinbox "bare"]
inboxdir = $bare->{git_dir}
url = http://$host/bare