git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	"Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH 2/6] t5538: fix default http port
Date: Mon, 10 Feb 2014 09:39:48 -0500	[thread overview]
Message-ID: <20140210143948.GA21242@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8CLR4qerWPWs+0TWxnTWidm_VLtYExjKqAOLOSNK0chaA@mail.gmail.com>

On Sat, Feb 08, 2014 at 02:36:11PM +0700, Duy Nguyen wrote:

> > Thinking on this more, I wonder if we should just do something like
> > this:
> [...]
> Yes!

Here it is as a Real Patch™. I just based it on master, so it can
replace your 5537/5538 fix in your series.

> Next stop, attempt to start httpd at start_httpd regardless of
> GIT_TEST_HTTPD. If successful, test_set_prereq HTTPD or something that
> the following tests can use. If GIT_TEST_HTTPD is set and start_httpd
> fails, error out, not set prereq.

I'd be fine with that, as I always run them anyway. The potential
downsides would be:

  1. Is there anybody who has apache installed who would _not_ want to
     bring it up for the test?

  2. Is there anybody for whom the failure mode of bringing up apache
     would be unpleasant (e.g., if it hangs the tests or something)?

For (1), we could perhaps have a GIT_NO_TEST_HTTPD to avoid it.

For (2), I suspect we may need to make our error handling more robust,
but getting people to run it is the first step to figuring out what the
problems are.

If we go this route, we should probably do the same for
GIT_TEST_GIT_DAEMON in t5570 (and for that matter, we should probably do
the same for the port numbers).

-- >8 --
Subject: [PATCH] tests: auto-set LIB_HTTPD_PORT from test name

We set the default apache port for each of the httpd tests
to the 4-digit test number of the test script. We want these
to remain unique so that the tests do not conflict with each
other when run in parallel.

Instead of doing it manually in each test script, let's just
set it from the test name at run time. This is simpler, and
is one less thing to be updated when test scripts are
renamed (e.g., when being re-rolled or when conflicting
after being merged with another topic).

Incidentally, this fixes a case where t5537 and t5538 used
the same port number (5537), and could conflict with each
other when run in parallel.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-httpd.sh           | 2 +-
 t/t5537-fetch-shallow.sh | 1 -
 t/t5538-push-shallow.sh  | 1 -
 t/t5540-http-push.sh     | 1 -
 t/t5541-http-push.sh     | 1 -
 t/t5550-http-fetch.sh    | 1 -
 t/t5551-http-fetch.sh    | 1 -
 t/t5561-http-backend.sh  | 1 -
 8 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index bfdff2a..b43162e 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -64,7 +64,7 @@ case $(uname) in
 esac
 
 LIB_HTTPD_PATH=${LIB_HTTPD_PATH-"$DEFAULT_HTTPD_PATH"}
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}
+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-${this_test#t}}
 
 TEST_PATH="$TEST_DIRECTORY"/lib-httpd
 HTTPD_ROOT_PATH="$PWD"/httpd
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index b0fa738..adf215a 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -178,7 +178,6 @@ if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
 	test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index 0a6e40f..8e54ac5 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -126,7 +126,6 @@ if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
 	test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh
index 5b0198c..8d7b3c5 100755
--- a/t/t5540-http-push.sh
+++ b/t/t5540-http-push.sh
@@ -16,7 +16,6 @@ then
 fi
 
 LIB_HTTPD_DAV=t
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5540'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 ROOT_PATH="$PWD"
 start_httpd
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index bfd241e..73af16f 100755
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
@@ -12,7 +12,6 @@ if test -n "$NO_CURL"; then
 fi
 
 ROOT_PATH="$PWD"
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 start_httpd
diff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh
index 8392624..1a3a2b6 100755
--- a/t/t5550-http-fetch.sh
+++ b/t/t5550-http-fetch.sh
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
 	test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index a124efe..e07eaf3 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
 	test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5551'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh
index b5d7fbc..d23fb02 100755
--- a/t/t5561-http-backend.sh
+++ b/t/t5561-http-backend.sh
@@ -8,7 +8,6 @@ if test -n "$NO_CURL"; then
 	test_done
 fi
 
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5561'}
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
-- 
1.8.5.2.500.g8060133

  reply	other threads:[~2014-02-10 14:39 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 15:10 [PATCH 0/6] Fix the shallow deepen bug with no-done Nguyễn Thái Ngọc Duy
2014-02-06 15:10 ` [PATCH 1/6] test: rename http fetch and push test files Nguyễn Thái Ngọc Duy
2014-02-06 19:33   ` Jeff King
2014-02-06 15:10 ` [PATCH 2/6] t5538: fix default http port Nguyễn Thái Ngọc Duy
2014-02-06 19:35   ` Jeff King
2014-02-07 23:47     ` Jeff King
2014-02-08  7:36       ` Duy Nguyen
2014-02-10 14:39         ` Jeff King [this message]
2014-02-10 18:23           ` Junio C Hamano
2014-02-10 19:15             ` Jeff King
2014-02-10 19:16               ` Jeff King
2014-02-10 21:29               ` [PATCH] tests: turn on network daemon tests by default Jeff King
2014-02-11 19:51                 ` Junio C Hamano
2014-02-11 20:04                   ` Jeff King
2014-02-11 23:58                     ` Junio C Hamano
2014-02-12 21:47                       ` Jeff King
2014-02-12 22:34                         ` Junio C Hamano
2014-02-13 19:35                           ` Junio C Hamano
2014-02-14  9:58                             ` Jeff King
2014-02-14 16:13                               ` Junio C Hamano
2014-02-12 19:06                     ` Junio C Hamano
2014-02-12 22:12                       ` Jeff King
2014-02-13  1:22                         ` Duy Nguyen
2014-02-13 13:21                           ` [PATCH] t5537: move http tests out to t5539 Nguyễn Thái Ngọc Duy
2014-02-13 20:14                             ` Junio C Hamano
2014-02-06 15:10 ` [PATCH 3/6] pack-protocol.txt: clarify 'obj-id' in the last ACK after 'done' Nguyễn Thái Ngọc Duy
2014-02-06 18:54   ` Junio C Hamano
2014-02-06 15:10 ` [PATCH 4/6] protocol-capabilities.txt: refer multi_ack_detailed back to pack-protocol.txt Nguyễn Thái Ngọc Duy
2014-02-06 15:10 ` [PATCH 5/6] protocol-capabilities.txt: document no-done Nguyễn Thái Ngọc Duy
2014-02-06 18:55   ` Junio C Hamano
2014-02-06 19:40   ` Jeff King
2014-02-06 15:10 ` [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap Nguyễn Thái Ngọc Duy
2014-02-06 19:16   ` Junio C Hamano
2014-02-07  0:52     ` Duy Nguyen
2014-02-06 19:35   ` Eric Sunshine
2014-02-06 19:42   ` Jeff King
2014-02-07 18:01   ` Junio C Hamano
2014-02-07 23:39     ` Duy Nguyen
2014-02-10 18:18       ` Junio C Hamano
2014-02-06 19:31 ` [PATCH 0/6] Fix the shallow deepen bug with no-done Junio C Hamano
2014-02-06 19:44   ` Jeff King
2014-02-07  0:47   ` Duy Nguyen
2014-02-07 19:20     ` Jonathan Nieder
2014-02-07 20:03       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140210143948.GA21242@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).