Skip to contentSkip to conversation

t5540: skip under NO_CURL=NoThanks

PATCH In review Junio C Hamano 3 participants 6 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t5540: skip under NO_CURL=NoThanks

All the other tests in t5xxx series that require http support check NO_CURL and skip the test, but this one forgot to do so.

---
 t/t5540-http-push-webdav.sh | 6 ++++++
 1 file changed, 6 insertions(+)
t/t5540-http-push-webdav.sh +6 -0
index 8d7b3c5..e6aec36 100755
@@ -9,6 +9,12 @@ This test runs various sanity checks on http-push.'
 
 . ./test-lib.sh
 
+if test -n "$NO_CURL"
+then
+	skip_all='skipping test, git built without http support'
+	test_done
+fi
+
 if git http-push > /dev/null 2>&1 || [ $? -eq 128 ]
 then
 	skip_all="skipping test, USE_CURL_MULTI is not defined"
Signature · 1 line
2.4.0-312-gc04835c
#1 lore raw
Quoted 2 lines · Junio C Hamano

All the other tests in t5xxx series that require http support check NO_CURL and skip the test, but this one forgot to do so.

Makes sense, though I wonder if this check should just get pushed into lib-httpd.sh. Surely we can't do anything useful with a web server we started if we have no curl support? And this seems to support the case:

  $ comm -23 <(git grep -l lib-httpd.sh) <(git grep -l NO_CURL)
  lib-httpd.sh
  t5540-http-push-webdav.sh

After your patch, there is literally no script which includes lib-httpd.sh but does not respect NO_CURL.

-Peff

#2 lore raw
Quoted 9 lines · Jeff King
Quoted 2 lines · Junio C Hamano

All the other tests in t5xxx series that require http support check NO_CURL and skip the test, but this one forgot to do so.

Makes sense, though I wonder if this check should just get pushed into lib-httpd.sh. Surely we can't do anything useful with a web server we started if we have no curl support? And this seems to support the case:

Quoted 6 lines
  $ comm -23 <(git grep -l lib-httpd.sh) <(git grep -l NO_CURL)
  lib-httpd.sh
  t5540-http-push-webdav.sh

After your patch, there is literally no script which includes lib-httpd.sh but does not respect NO_CURL.

Here's a patch if you want to go that route.

-- >8 --
Subject: t/lib-httpd.sh: skip tests if NO_CURL is defined

If we built git without curl, we can't actually test against an http server. In fact, all of the test scripts which include lib-httpd.sh already perform this check, with one
exception: t5540. For those scripts, this is a noop, and for t5540, this is a bugfix (it used to fail when built with NO_CURL, though it could go unnoticed if you had a stale git-remote-https in your build directory).

---
 t/lib-httpd.sh                | 5 +++++
 t/t5539-fetch-http-shallow.sh | 6 ------
 t/t5541-http-push-smart.sh    | 5 -----
 t/t5542-push-http-shallow.sh  | 6 ------
 t/t5550-http-fetch-dumb.sh    | 6 ------
 t/t5551-http-fetch-smart.sh   | 6 ------
 t/t5561-http-backend.sh       | 6 ------
 7 files changed, 5 insertions(+), 35 deletions(-)
t/lib-httpd.sh +5 -0
index e6adf2f..c3b5250 100644
@@ -30,6 +30,11 @@
 # Copyright (c) 2008 Clemens Buchacher <[email protected]>
 #
 
+if test -n "$NO_CURL"; then
+	skip_all='skipping test, git built without http support'
+	test_done
+fi
+
 test_tristate GIT_TEST_HTTPD
 if test "$GIT_TEST_HTTPD" = false
 then
t/t5539-fetch-http-shallow.sh +0 -6
index b461188..37a4335 100755
@@ -3,12 +3,6 @@
 test_description='fetch/clone from a shallow clone over http'
 
 . ./test-lib.sh
-
-if test -n "$NO_CURL"; then
-	skip_all='skipping test, git built without http support'
-	test_done
-fi
-
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
t/t5541-http-push-smart.sh +0 -5
index 9cf27e8..fd7d06b 100755
@@ -6,11 +6,6 @@
 test_description='test smart pushing over http via http-backend'
 . ./test-lib.sh
 
-if test -n "$NO_CURL"; then
-	skip_all='skipping test, git built without http support'
-	test_done
-fi
-
 ROOT_PATH="$PWD"
 . "$TEST_DIRECTORY"/lib-gpg.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
t/t5542-push-http-shallow.sh +0 -6
index 2a691e0..5165833 100755
@@ -3,12 +3,6 @@
 test_description='push from/to a shallow clone over http'
 
 . ./test-lib.sh
-
-if test -n "$NO_CURL"; then
-	say 'skipping test, git built without http support'
-	test_done
-fi
-
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
t/t5550-http-fetch-dumb.sh +0 -6
index 3d11b7a..87a7aa0 100755
@@ -2,12 +2,6 @@
 
 test_description='test dumb fetching over http via static file'
 . ./test-lib.sh
-
-if test -n "$NO_CURL"; then
-	skip_all='skipping test, git built without http support'
-	test_done
-fi
-
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
t/t5551-http-fetch-smart.sh +0 -6
index 66439e5..2b29311 100755
@@ -2,12 +2,6 @@
 
 test_description='test smart fetching over http via http-backend'
 . ./test-lib.sh
-
-if test -n "$NO_CURL"; then
-	skip_all='skipping test, git built without http support'
-	test_done
-fi
-
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
t/t5561-http-backend.sh +0 -6
index d23fb02..19afe96 100755
@@ -2,12 +2,6 @@
 
 test_description='test git-http-backend'
 . ./test-lib.sh
-
-if test -n "$NO_CURL"; then
-	skip_all='skipping test, git built without http support'
-	test_done
-fi
-
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
Signature · 1 line
2.4.0.488.gf55b16a
#3 lore raw
In reply to Jeff King
Quoted 9 lines · Jeff King
Quoted 2 lines · Junio C Hamano

All the other tests in t5xxx series that require http support check NO_CURL and skip the test, but this one forgot to do so.

Makes sense, though I wonder if this check should just get pushed into lib-httpd.sh. Surely we can't do anything useful with a web server we started if we have no curl support? And this seems to support the case:

Quoted 6 lines
  $ comm -23 <(git grep -l lib-httpd.sh) <(git grep -l NO_CURL)
  lib-httpd.sh
  t5540-http-push-webdav.sh

After your patch, there is literally no script which includes lib-httpd.sh but does not respect NO_CURL.

Makes perfect sense. Thanks.

#4 lore raw

Re: [PATCH] tests: skip dav http-push tests under NO_EXPAT=NoThanks

When built with NO_EXPAT=NoThanks, we will not have a working http-push over webdav.

---

 Makefile       | 1 +
 t/lib-httpd.sh | 6 ++++++
 2 files changed, 7 insertions(+)
Makefile +1 -0
index e0caec3..b9ebbf6 100644
@@ -2188,6 +2188,7 @@ GIT-BUILD-OPTIONS: FORCE
 	@echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@
 	@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
 	@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
+	@echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@
 	@echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@
 	@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
 	@echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@
t/lib-httpd.sh +6 -0
index 872a252..d823664 100644
@@ -36,6 +36,12 @@ then
 	test_done
 fi
 
+if test -n "$NO_EXPAT" && test -n "$LIB_HTTPD_DAV"
+then
+	skip_all='skipping test, git built without expat support'
+	test_done
+fi
+
 test_tristate GIT_TEST_HTTPD
 if test "$GIT_TEST_HTTPD" = false
 then
#5 lore raw

Re: [PATCH] tests: skip dav http-push tests under NO_EXPAT=NoThanks

Quoted 2 lines · Junio C Hamano

When built with NO_EXPAT=NoThanks, we will not have a working http-push over webdav.

Hmph, I used to build with NO_EXPAT long ago and don't remember running into this, but it is clearly broken now. I wonder what bizarre combination of leftover build products made it work. ;)

t/lib-httpd.sh then · line 43

Quoted 13 lines
t/lib-httpd.sh +5 -0
index 872a252..d823664 100644
@@ -36,6 +36,12 @@ then
 	test_done
 fi
 
+if test -n "$NO_EXPAT" && test -n "$LIB_HTTPD_DAV"
+then
+	skip_all='skipping test, git built without expat support'
+	test_done
+fi

I was confused at first why this is in lib-httpd.sh and not 5540, but I see LIB_HTTPD_DAV is provided by t5540 as a feature flag to lib-httpd.sh. I learn something new every day about our test infrastructure.

-Peff