git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix http-push test
@ 2008-07-07 19:02 Mike Hommey
  2008-07-07 19:08 ` Mike Hommey
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Hommey @ 2008-07-07 19:02 UTC (permalink / raw)
  To: git, gitster

http-push test has been broken by 4a7aaccd adding a space character
in the place where the test is being run.
---

 Note that the 4th test doesn't pass because of the new git clone, that
 creates the clone with packed-refs instead of refs/heads/master that
 push is requiring. But this also means push was already broken with
 repositories with packed-refs.

 t/lib-httpd.sh       |   18 ++++++++++--------
 t/t5540-http-push.sh |    2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index a5c4436..dc473df 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -45,22 +45,22 @@ else
 	error "Could not identify web server at '$LIB_HTTPD_PATH'"
 fi
 
-HTTPD_PARA="-d $HTTPD_ROOT_PATH -f $TEST_PATH/apache.conf"
+HTTPD_PARA=""
 
 prepare_httpd() {
-	mkdir -p $HTTPD_DOCUMENT_ROOT_PATH
+	mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
 
-	ln -s $LIB_HTTPD_MODULE_PATH $HTTPD_ROOT_PATH/modules
+	ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"
 
 	if test -n "$LIB_HTTPD_SSL"
 	then
 		HTTPD_URL=https://127.0.0.1:$LIB_HTTPD_PORT
 
 		RANDFILE_PATH="$HTTPD_ROOT_PATH"/.rnd openssl req \
-			-config $TEST_PATH/ssl.cnf \
+			-config "$TEST_PATH/ssl.cnf" \
 			-new -x509 -nodes \
-			-out $HTTPD_ROOT_PATH/httpd.pem \
-			-keyout $HTTPD_ROOT_PATH/httpd.pem
+			-out "$HTTPD_ROOT_PATH/httpd.pem" \
+			-keyout "$HTTPD_ROOT_PATH/httpd.pem"
 		GIT_SSL_NO_VERIFY=t
 		export GIT_SSL_NO_VERIFY
 		HTTPD_PARA="$HTTPD_PARA -DSSL"
@@ -86,12 +86,14 @@ start_httpd() {
 
 	trap 'stop_httpd; die' exit
 
-	"$LIB_HTTPD_PATH" $HTTPD_PARA \
+	"$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
+		-f "$TEST_PATH/apache.conf" $HTTPD_PARA \
 		-c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start
 }
 
 stop_httpd() {
 	trap 'die' exit
 
-	"$LIB_HTTPD_PATH" $HTTPD_PARA -k stop
+	"$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
+		-f "$TEST_PATH/apache.conf" -k stop
 }
diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh
index f15dd03..6cd8b45 100755
--- a/t/t5540-http-push.sh
+++ b/t/t5540-http-push.sh
@@ -36,7 +36,7 @@ test_expect_success 'setup remote repository' '
 	git --bare update-server-info &&
 	chmod +x hooks/post-update &&
 	cd - &&
-	mv test_repo.git $HTTPD_DOCUMENT_ROOT_PATH
+	mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH"
 '
 
 test_expect_success 'clone remote repository' '
-- 
1.5.6.2.220.g44701

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

* Re: [PATCH] Fix http-push test
  2008-07-07 19:02 [PATCH] Fix http-push test Mike Hommey
@ 2008-07-07 19:08 ` Mike Hommey
  2008-07-07 19:54   ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Hommey @ 2008-07-07 19:08 UTC (permalink / raw)
  To: git, gitster

On Mon, Jul 07, 2008 at 09:02:37PM +0200, Mike Hommey wrote:
> http-push test has been broken by 4a7aaccd adding a space character
> in the place where the test is being run.
> ---
> 
>  Note that the 4th test doesn't pass because of the new git clone, that
>  creates the clone with packed-refs instead of refs/heads/master that
>  push is requiring. But this also means push was already broken with
>  repositories with packed-refs.

Actually, the 3rd is failing too, but fails to report an error because
git push returns no error code in cases where it says:
  No refs in common and none specified; doing nothing.

Mike

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

* Re: [PATCH] Fix http-push test
  2008-07-07 19:08 ` Mike Hommey
@ 2008-07-07 19:54   ` Junio C Hamano
  2008-07-07 20:17     ` Mike Hommey
  2008-07-07 21:06     ` [PATCH] Catch failures from t5540-http-push Mike Hommey
  0 siblings, 2 replies; 5+ messages in thread
From: Junio C Hamano @ 2008-07-07 19:54 UTC (permalink / raw)
  To: Mike Hommey; +Cc: git

Mike Hommey <mh@glandium.org> writes:

> On Mon, Jul 07, 2008 at 09:02:37PM +0200, Mike Hommey wrote:
>> http-push test has been broken by 4a7aaccd adding a space character
>> in the place where the test is being run.
>> ---
>> 
>>  Note that the 4th test doesn't pass because of the new git clone, that
>>  creates the clone with packed-refs instead of refs/heads/master that
>>  push is requiring. But this also means push was already broken with
>>  repositories with packed-refs.
>
> Actually, the 3rd is failing too, but fails to report an error because
> git push returns no error code in cases where it says:
>   No refs in common and none specified; doing nothing.

Ok, when you are done checking, care to send in a replacement patch with
failing one marked with test_expect_failure?

You do not have to hurry, I am currently at day job and already deep in
today's integration cycle during the lunchtime, and won't be able to queue
new fixes for several hours from now, so your patch will be part of
tomorrow's or tonight's cycle anyway.

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

* Re: [PATCH] Fix http-push test
  2008-07-07 19:54   ` Junio C Hamano
@ 2008-07-07 20:17     ` Mike Hommey
  2008-07-07 21:06     ` [PATCH] Catch failures from t5540-http-push Mike Hommey
  1 sibling, 0 replies; 5+ messages in thread
From: Mike Hommey @ 2008-07-07 20:17 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Mon, Jul 07, 2008 at 12:54:41PM -0700, Junio C Hamano wrote:
> Mike Hommey <mh@glandium.org> writes:
> 
> > On Mon, Jul 07, 2008 at 09:02:37PM +0200, Mike Hommey wrote:
> >> http-push test has been broken by 4a7aaccd adding a space character
> >> in the place where the test is being run.
> >> ---
> >> 
> >>  Note that the 4th test doesn't pass because of the new git clone, that
> >>  creates the clone with packed-refs instead of refs/heads/master that
> >>  push is requiring. But this also means push was already broken with
> >>  repositories with packed-refs.
> >
> > Actually, the 3rd is failing too, but fails to report an error because
> > git push returns no error code in cases where it says:
> >   No refs in common and none specified; doing nothing.
> 
> Ok, when you are done checking, care to send in a replacement patch with
> failing one marked with test_expect_failure?

Shouldn't that be two different patches ? One to fix the spaces problem
and one to handle the fact that builtin-clone broke the tests ?

Mike

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

* [PATCH] Catch failures from t5540-http-push
  2008-07-07 19:54   ` Junio C Hamano
  2008-07-07 20:17     ` Mike Hommey
@ 2008-07-07 21:06     ` Mike Hommey
  1 sibling, 0 replies; 5+ messages in thread
From: Mike Hommey @ 2008-07-07 21:06 UTC (permalink / raw)
  To: git, gitster

git http-push doesn't handle packed-refs, and now the new builtin-clone
created packed refs, the http-push test fails.

Mark the current failure as such, and also catch third test's failure
that went unreported because git push doesn't return an error code when
it says:
 No refs in common and none specified; doing nothing.
Which it does when http-push can't get a list of refs recursively from
$URL/refs/.

Signed-off-by: Mike Hommey <mh@glandium.org>
---

 Feel free to squash this in the previous one, if you feel it's better.

 t/t5540-http-push.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh
index 147ff98..21dbb55 100755
--- a/t/t5540-http-push.sh
+++ b/t/t5540-http-push.sh
@@ -51,16 +51,17 @@ test_expect_success 'clone remote repository' '
 	git clone $HTTPD_URL/test_repo.git test_repo_clone
 '
 
-test_expect_success 'push to remote repository' '
+test_expect_failure 'push to remote repository' '
 	cd "$ROOT_PATH"/test_repo_clone &&
 	: >path2 &&
 	git add path2 &&
 	test_tick &&
 	git commit -m path2 &&
-	git push
+	git push &&
+	[ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
 '
 
-test_expect_success 'create and delete remote branch' '
+test_expect_failure 'create and delete remote branch' '
 	cd "$ROOT_PATH"/test_repo_clone &&
 	git checkout -b dev &&
 	: >path3 &&
-- 
1.5.6.GIT

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

end of thread, other threads:[~2008-07-07 21:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-07 19:02 [PATCH] Fix http-push test Mike Hommey
2008-07-07 19:08 ` Mike Hommey
2008-07-07 19:54   ` Junio C Hamano
2008-07-07 20:17     ` Mike Hommey
2008-07-07 21:06     ` [PATCH] Catch failures from t5540-http-push Mike Hommey

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).