]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
tests: fix missing modules under TEST_RUN_MODE=0
authorEric Wong <e@80x24.org>
Fri, 15 Nov 2024 02:59:27 +0000 (02:59 +0000)
committerEric Wong <e@80x24.org>
Fri, 15 Nov 2024 20:27:41 +0000 (20:27 +0000)
By default, we rely heavily on preload to speed up tests and
missing modules were always present by the time we hit some
tests.  However, the more realistic (and significantly slower)
TEST_RUN_MODE=0 doesn't preload so we must explicitly load
missing modules.

t/extsearch.t
t/www_static.t

index 28c43763ca313782e93028225ac9c12cda39b5e2..1a212bc8db07c8038f4ea31d38d0eeaa733ebb15 100644 (file)
@@ -609,6 +609,7 @@ if ('indexheader support') {
        $es = PublicInbox::Config->new($cfg_path)->ALL;
        my $mset = $es->mset('xarchiveshash:deadbeefcafe');
        is $mset->size, 1, 'extindex.*.indexheader works';
+       require PublicInbox::XapClient;
        local $PublicInbox::Search::XHC =
                        PublicInbox::XapClient::start_helper('-j0') or
                        xbail "no XHC: $@";
index 8fb86a82e815730810332913005c43029816e466..e258be1cf892272d62f657d0070d7feffb544f15 100644 (file)
@@ -16,6 +16,7 @@ my $psgi_env = sub { # @_ is passed to WwwStatic->new
        write_file '>', $ret, <<EOM;
 use v5.12;
 use Plack::Builder;
+use PublicInbox::WwwStatic;
 my \$ws = PublicInbox::WwwStatic->new(docroot => "$tmpdir" @_);
 builder { sub { \$ws->call(shift) } }
 EOM