git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t5150: skip request-pull test if Perl is disabled
@ 2019-11-26  0:02 Ruud van Asseldonk
  2019-11-26  0:43 ` Jonathan Nieder
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ruud van Asseldonk @ 2019-11-26  0:02 UTC (permalink / raw)
  To: git; +Cc: Paolo Bonzini, Jonathan Nieder

The git-request-pull.sh script invokes Perl, so it requires Perl to be
available, but the associated test t5150 does not skip itself when Perl
has been disabled, which then makes subtest 4 through 10 fail. Subtest 3
still passes, but for the wrong reasons (it expects git-request-pull to
fail, and it does fail when Perl is not available). The initial two
subtests that do pass are only doing setup.

To prevent t5150 from failing the build when NO_PERL=1, add a check that
sets skip_all when "! test_have_prereq PERL", just like how for example
t3701-add-interactive skips itself when Perl has been disabled.

Signed-off-by: Ruud van Asseldonk <dev@veniogames.com>
---
I discovered this issue in the Git package in Nixpkgs. The Nix package
manager tries to make it hard to accidentally introduce undeclared
dependencies, and it has a sandbox that hides things in /usr/bin. So
when it builds with NO_PERL=1, it really makes no Perl available, so you
cannot accidentally depend on the Perl in /usr/bin/perl. For the tests
it does set PERL_PATH, but it does not point to a binary in /usr/bin.

 t/t5150-request-pull.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
index 852dcd913f..1ad4ecc29a 100755
--- a/t/t5150-request-pull.sh
+++ b/t/t5150-request-pull.sh
@@ -4,6 +4,12 @@ test_description='Test workflows involving pull request.'
 
 . ./test-lib.sh
 
+if ! test_have_prereq PERL
+then
+	skip_all='skipping request-pull tests, perl not available'
+	test_done
+fi
+
 test_expect_success 'setup' '
 
 	git init --bare upstream.git &&
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-12-16 18:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26  0:02 [PATCH] t5150: skip request-pull test if Perl is disabled Ruud van Asseldonk
2019-11-26  0:43 ` Jonathan Nieder
2019-11-26  0:46 ` Jonathan Nieder
2019-11-27 22:42   ` Ruud van Asseldonk
2019-11-27 11:21 ` Jeff King
2019-11-27 23:45   ` Ruud van Asseldonk
2019-11-28  1:35     ` Jonathan Nieder
2019-11-28  1:31   ` Jonathan Nieder
2019-12-02  6:19     ` Junio C Hamano
2019-12-13  7:46       ` Jeff King
2019-12-16 18:32         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).