From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8C8791F4BD; Thu, 3 Oct 2019 07:57:29 +0000 (UTC) Date: Thu, 3 Oct 2019 07:57:29 +0000 From: Eric Wong To: Alyssa Ross Cc: meta@public-inbox.org Subject: [PATCH] t/search: bail out on `git init --shared' failures Message-ID: <20191003075729.4z4vn7hzhdpdeev5@whir> References: <20190915134819.1406-1-hi@alyssa.is> <20190915185519.GA4891@dcvr> <87zhiu4hxl.fsf@alyssa.is> <20190924040123.6jbtvpadnk6negox@whir> <87r245tkbz.fsf@alyssa.is> <20190926084431.ukv53sfskk7qvere@dcvr> <87bluyhguc.fsf@alyssa.is> <878sq2hd08.fsf@alyssa.is> <20191003012807.GA52684@ailurophile> <8736gahad8.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8736gahad8.fsf@alyssa.is> List-Id: Alyssa Ross wrote: > > How do "git init --shared" tests work for the Nix git package? We could > > try to follow that as an example... > > They're disabled, hehe: > > Yeah, seems reasonable to disable here, too. Thanks for all your time debugging and documenting this! Using BAIL_OUT could save future testers a lot of time. And I also made another patch to make mode failures more obvious: https://public-inbox.org/meta/20191003073817.13259-1-e@80x24.org/ ----------8<----------- Subject: [PATCH] t/search: bail out on `git init --shared' failures 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 Link: https://public-inbox.org/meta/878sq2hd08.fsf@alyssa.is/ --- t/search.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/search.t b/t/search.t index 830c668e..a728d79f 100644 --- a/t/search.t +++ b/t/search.t @@ -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"); -- EW