X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fwww_listing.t;h=eb77969b5039e0b222f029386051e02643bf560a;hb=702864ea3393f4c7a91336b277083bf9fd4b0860;hp=6b3b408fae413f498fba880b10321e493765e780;hpb=e3a7014b7594e918901d803d9d966af70e8900e0;p=public-inbox.git diff --git a/t/www_listing.t b/t/www_listing.t index 6b3b408f..eb77969b 100644 --- a/t/www_listing.t +++ b/t/www_listing.t @@ -2,11 +2,7 @@ # Copyright (C) 2019-2021 all contributors # License: AGPL-3.0+ # manifest.js.gz generation and grok-pull integration test -use strict; -use v5.10.1; -use Test::More; -use PublicInbox::Spawn qw(which); -use PublicInbox::TestCommon; +use strict; use v5.10.1; use PublicInbox::TestCommon; use PublicInbox::Import; use IO::Uncompress::Gunzip qw(gunzip); require_mods(qw(json URI::Escape Plack::Builder Digest::SHA HTTP::Tiny)); @@ -55,7 +51,7 @@ sub tiny_test { ok(my $clone = $manifest->{'/alt'}, '/alt in manifest'); is($clone->{owner}, "lorelei \x{100}", 'owner set'); is($clone->{reference}, '/bare', 'reference detected'); - is($clone->{description}, "we're all clones", 'description read'); + is($clone->{description}, "we're \x{100}ll clones", 'description read'); ok(my $bare = $manifest->{'/bare'}, '/bare in manifest'); is($bare->{description}, 'Unnamed repository', 'missing $GIT_DIR/description fallback'); @@ -72,6 +68,10 @@ sub tiny_test { ok(my $v2epoch1 = $manifest->{'/v2/git/1.git'}, 'v2 epoch 1 appeared'); like($v2epoch1->{description}, qr/ \[epoch 1\]\z/, 'epoch 1 in description'); + + $res = $http->get("http://$host:$port/alt/description"); + is($res->{content}, "we're \xc4\x80ll clones\n", 'UTF-8 description') + or diag explain($res); } my $td; @@ -91,13 +91,12 @@ SKIP: { is(xsys(@clone, $alt, "$v2/git/$i.git"), 0, "clone epoch $i") } ok(open(my $fh, '>', "$v2/inbox.lock"), 'mock a v2 inbox'); - open $fh, '>', "$alt/description" or die; - print $fh "we're all clones\n" or die; - close $fh or die; + open $fh, '>', "$alt/description" or xbail "open $alt/description $!"; + print $fh "we're \xc4\x80ll clones\n" or xbail "print $!"; + close $fh or xbail "write: $alt/description $!"; is(xsys('git', "--git-dir=$alt", qw(config gitweb.owner), "lorelei \xc4\x80"), 0, 'set gitweb user'); - ok(unlink("$bare->{git_dir}/description"), 'removed bare/description'); open $fh, '>', $cfgfile or xbail "open $cfgfile: $!"; $fh->autoflush(1); print $fh <<"" or xbail "print $!"; @@ -131,7 +130,7 @@ SKIP: { tiny_test($json, $host, $port, 1); undef $sock; - my $grok_pull = which('grok-pull') or + my $grok_pull = require_cmd('grok-pull', 1) or skip('grok-pull not available', 12); my ($grok_version) = (xqx([$grok_pull, "--version"]) =~ /(\d+)\.(?:\d+)(?:\.(\d+))?/); @@ -178,6 +177,13 @@ manifest = \${site}/v2/manifest.js.gz for (qw(v2/git/0.git v2/git/1.git v2/git/2.git)) { ok(-d "$tmpdir/per-inbox/$_", "grok-pull created $_"); } + $td->kill; + $td->join; + is($?, 0, 'no error in exited process'); + open $fh, '<', $err or BAIL_OUT("open $err failed: $!"); + my $eout = do { local $/; <$fh> }; + unlike($eout, qr/wide/i, 'no Wide character warnings'); + unlike($eout, qr/uninitialized/i, 'no uninitialized warnings'); } done_testing();