]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t: localize the PI_CONFIG env
authorEric Wong <e@80x24.org>
Fri, 29 Nov 2019 10:14:08 +0000 (10:14 +0000)
committerEric Wong <e@80x24.org>
Wed, 11 Dec 2019 08:10:25 +0000 (08:10 +0000)
We don't want the user's ~/.public-inbox/config to be read from
during tests.  I only noticed this because I had a non-existent
pathname for one of my inboxes :x

I've also verified this change by running "inotifywait
~/.public-inbox/config -m" in another terminal while running
"make check"; (perhaps a portable solution could make it
into the test suite).

t/indexlevels-mirror.t
t/xcpdb-reshard.t

index f1c338e189fa5d648ff1532597e95677635fa440..3d4813bec9e814227b3dbc0c8f9480a066d50ce8 100644 (file)
@@ -32,6 +32,7 @@ sub import_index_incremental {
        my ($v, $level) = @_;
        my $this = "pi-$v-$level-indexlevels";
        my ($tmpdir, $for_destroy) = tmpdir();
+       local $ENV{PI_CONFIG} = "$tmpdir/config";
        my $ibx = PublicInbox::Inbox->new({
                inboxdir => "$tmpdir/testbox",
                name => $this,
index ebf156a31968a68829c134115f1e969b7e112ed4..a4ab35d6c7a10f386f36c1830564a93e6d55dca4 100644 (file)
@@ -25,6 +25,7 @@ my $mime = PublicInbox::MIME->create(
 
 my ($this) = (split('/', $0))[-1];
 my ($tmpdir, $for_destroy) = tmpdir();
+local $ENV{PI_CONFIG} = "$tmpdir/config";
 my $ibx = PublicInbox::Inbox->new({
        inboxdir => "$tmpdir/testbox",
        name => $this,