]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/search: bail out on `git init --shared' failures
authorEric Wong <e@80x24.org>
Thu, 3 Oct 2019 07:57:29 +0000 (07:57 +0000)
committerEric Wong <e@80x24.org>
Sat, 5 Oct 2019 05:18:28 +0000 (05:18 +0000)
We can save future testers some time if we bail out early
on "git init --shared" failures, since things like seccomp
or non-POSIX FSes would trigger failures.

BAIL_OUT has been in Test::Simple since Perl v5.10.0, so it's
old-enough to call for our purposes.

Thanks-to: Alyssa Ross <hi@alyssa.is>
Reviewed-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Alyssa Ross <hi@alyssa.is>
Link: https://public-inbox.org/meta/878sq2hd08.fsf@alyssa.is/
t/search.t

index 830c668ed81cd442f836253d9a1dd5104973cb57..a728d79f77aa725355f9eaa8da4f1d9fc269adaa 100644 (file)
@@ -17,7 +17,8 @@ my $git_dir = "$tmpdir/a.git";
 my $ibx = PublicInbox::Inbox->new({ mainrepo => $git_dir });
 my ($root_id, $last_id);
 
-is(0, system(qw(git init --shared -q --bare), $git_dir), "git init (main)");
+is(0, system(qw(git init --shared -q --bare), $git_dir), "git init (main)")
+       or BAIL_OUT("`git init --shared' failed, weird FS or seccomp?");
 eval { PublicInbox::Search->new($ibx)->xdb };
 ok($@, "exception raised on non-existent DB");