{"thread":{"id":"14327","subject":"[PATCH] Fix http-push test","startedAt":"2008-07-07T19:02:37Z","lastAt":"2008-07-07T21:06:46Z","messageCount":5,"participants":["Mike Hommey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"82480","messageId":"1215457357-24279-1-git-send-email-mh@glandium.org","threadId":"14327","inReplyTo":null,"subject":"[PATCH] Fix http-push test","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-07-07T19:02:37Z","receivedAt":"2008-07-07T19:02:37Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"http-push test has been broken by 4a7aaccd adding a space character\nin the place where the test is being run.\n---\n\n Note that the 4th test doesn't pass because of the new git clone, that\n creates the clone with packed-refs instead of refs/heads/master that\n push is requiring. But this also means push was already broken with\n repositories with packed-refs.\n\n t/lib-httpd.sh       |   18 ++++++++++--------\n t/t5540-http-push.sh |    2 +-\n 2 files changed, 11 insertions(+), 9 deletions(-)\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex a5c4436..dc473df 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -45,22 +45,22 @@ else\n \terror \"Could not identify web server at '$LIB_HTTPD_PATH'\"\n fi\n \n-HTTPD_PARA=\"-d $HTTPD_ROOT_PATH -f $TEST_PATH/apache.conf\"\n+HTTPD_PARA=\"\"\n \n prepare_httpd() {\n-\tmkdir -p $HTTPD_DOCUMENT_ROOT_PATH\n+\tmkdir -p \"$HTTPD_DOCUMENT_ROOT_PATH\"\n \n-\tln -s $LIB_HTTPD_MODULE_PATH $HTTPD_ROOT_PATH/modules\n+\tln -s \"$LIB_HTTPD_MODULE_PATH\" \"$HTTPD_ROOT_PATH/modules\"\n \n \tif test -n \"$LIB_HTTPD_SSL\"\n \tthen\n \t\tHTTPD_URL=https://127.0.0.1:$LIB_HTTPD_PORT\n \n \t\tRANDFILE_PATH=\"$HTTPD_ROOT_PATH\"/.rnd openssl req \\\n-\t\t\t-config $TEST_PATH/ssl.cnf \\\n+\t\t\t-config \"$TEST_PATH/ssl.cnf\" \\\n \t\t\t-new -x509 -nodes \\\n-\t\t\t-out $HTTPD_ROOT_PATH/httpd.pem \\\n-\t\t\t-keyout $HTTPD_ROOT_PATH/httpd.pem\n+\t\t\t-out \"$HTTPD_ROOT_PATH/httpd.pem\" \\\n+\t\t\t-keyout \"$HTTPD_ROOT_PATH/httpd.pem\"\n \t\tGIT_SSL_NO_VERIFY=t\n \t\texport GIT_SSL_NO_VERIFY\n \t\tHTTPD_PARA=\"$HTTPD_PARA -DSSL\"\n@@ -86,12 +86,14 @@ start_httpd() {\n \n \ttrap 'stop_httpd; die' exit\n \n-\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA \\\n+\t\"$LIB_HTTPD_PATH\" -d \"$HTTPD_ROOT_PATH\" \\\n+\t\t-f \"$TEST_PATH/apache.conf\" $HTTPD_PARA \\\n \t\t-c \"Listen 127.0.0.1:$LIB_HTTPD_PORT\" -k start\n }\n \n stop_httpd() {\n \ttrap 'die' exit\n \n-\t\"$LIB_HTTPD_PATH\" $HTTPD_PARA -k stop\n+\t\"$LIB_HTTPD_PATH\" -d \"$HTTPD_ROOT_PATH\" \\\n+\t\t-f \"$TEST_PATH/apache.conf\" -k stop\n }\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nindex f15dd03..6cd8b45 100755\n--- a/t/t5540-http-push.sh\n+++ b/t/t5540-http-push.sh\n@@ -36,7 +36,7 @@ test_expect_success 'setup remote repository' '\n \tgit --bare update-server-info &&\n \tchmod +x hooks/post-update &&\n \tcd - &&\n-\tmv test_repo.git $HTTPD_DOCUMENT_ROOT_PATH\n+\tmv test_repo.git \"$HTTPD_DOCUMENT_ROOT_PATH\"\n '\n \n test_expect_success 'clone remote repository' '\n-- \n1.5.6.2.220.g44701\n"},{"id":"82482","messageId":"20080707190847.GA24489@glandium.org","threadId":"14327","inReplyTo":"1215457357-24279-1-git-send-email-mh@glandium.org","subject":"Re: [PATCH] Fix http-push test","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-07-07T19:08:47Z","receivedAt":"2008-07-07T19:08:47Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Mon, Jul 07, 2008 at 09:02:37PM +0200, Mike Hommey wrote:\n> http-push test has been broken by 4a7aaccd adding a space character\n> in the place where the test is being run.\n> ---\n> \n>  Note that the 4th test doesn't pass because of the new git clone, that\n>  creates the clone with packed-refs instead of refs/heads/master that\n>  push is requiring. But this also means push was already broken with\n>  repositories with packed-refs.\n\nActually, the 3rd is failing too, but fails to report an error because\ngit push returns no error code in cases where it says:\n  No refs in common and none specified; doing nothing.\n\nMike\n"},{"id":"82484","messageId":"7vej6531xa.fsf@gitster.siamese.dyndns.org","threadId":"14327","inReplyTo":"20080707190847.GA24489@glandium.org","subject":"Re: [PATCH] Fix http-push test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-07T19:54:41Z","receivedAt":"2008-07-07T19:54:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Hommey <mh@glandium.org> writes:\n\n> On Mon, Jul 07, 2008 at 09:02:37PM +0200, Mike Hommey wrote:\n>> http-push test has been broken by 4a7aaccd adding a space character\n>> in the place where the test is being run.\n>> ---\n>> \n>>  Note that the 4th test doesn't pass because of the new git clone, that\n>>  creates the clone with packed-refs instead of refs/heads/master that\n>>  push is requiring. But this also means push was already broken with\n>>  repositories with packed-refs.\n>\n> Actually, the 3rd is failing too, but fails to report an error because\n> git push returns no error code in cases where it says:\n>   No refs in common and none specified; doing nothing.\n\nOk, when you are done checking, care to send in a replacement patch with\nfailing one marked with test_expect_failure?\n\nYou do not have to hurry, I am currently at day job and already deep in\ntoday's integration cycle during the lunchtime, and won't be able to queue\nnew fixes for several hours from now, so your patch will be part of\ntomorrow's or tonight's cycle anyway.\n"},{"id":"82486","messageId":"20080707201720.GA1356@glandium.org","threadId":"14327","inReplyTo":"7vej6531xa.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Fix http-push test","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-07-07T20:17:20Z","receivedAt":"2008-07-07T20:17:20Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Mon, Jul 07, 2008 at 12:54:41PM -0700, Junio C Hamano wrote:\n> Mike Hommey <mh@glandium.org> writes:\n> \n> > On Mon, Jul 07, 2008 at 09:02:37PM +0200, Mike Hommey wrote:\n> >> http-push test has been broken by 4a7aaccd adding a space character\n> >> in the place where the test is being run.\n> >> ---\n> >> \n> >>  Note that the 4th test doesn't pass because of the new git clone, that\n> >>  creates the clone with packed-refs instead of refs/heads/master that\n> >>  push is requiring. But this also means push was already broken with\n> >>  repositories with packed-refs.\n> >\n> > Actually, the 3rd is failing too, but fails to report an error because\n> > git push returns no error code in cases where it says:\n> >   No refs in common and none specified; doing nothing.\n> \n> Ok, when you are done checking, care to send in a replacement patch with\n> failing one marked with test_expect_failure?\n\nShouldn't that be two different patches ? One to fix the spaces problem\nand one to handle the fact that builtin-clone broke the tests ?\n\nMike\n"},{"id":"82494","messageId":"1215464806-5412-1-git-send-email-mh@glandium.org","threadId":"14327","inReplyTo":"7vej6531xa.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] Catch failures from t5540-http-push","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-07-07T21:06:46Z","receivedAt":"2008-07-07T21:06:46Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"git http-push doesn't handle packed-refs, and now the new builtin-clone\ncreated packed refs, the http-push test fails.\n\nMark the current failure as such, and also catch third test's failure\nthat went unreported because git push doesn't return an error code when\nit says:\n No refs in common and none specified; doing nothing.\nWhich it does when http-push can't get a list of refs recursively from\n$URL/refs/.\n\nSigned-off-by: Mike Hommey <mh@glandium.org>\n---\n\n Feel free to squash this in the previous one, if you feel it's better.\n\n t/t5540-http-push.sh |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nindex 147ff98..21dbb55 100755\n--- a/t/t5540-http-push.sh\n+++ b/t/t5540-http-push.sh\n@@ -51,16 +51,17 @@ test_expect_success 'clone remote repository' '\n \tgit clone $HTTPD_URL/test_repo.git test_repo_clone\n '\n \n-test_expect_success 'push to remote repository' '\n+test_expect_failure 'push to remote repository' '\n \tcd \"$ROOT_PATH\"/test_repo_clone &&\n \t: >path2 &&\n \tgit add path2 &&\n \ttest_tick &&\n \tgit commit -m path2 &&\n-\tgit push\n+\tgit push &&\n+\t[ -f \"$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master\" ]\n '\n \n-test_expect_success 'create and delete remote branch' '\n+test_expect_failure 'create and delete remote branch' '\n \tcd \"$ROOT_PATH\"/test_repo_clone &&\n \tgit checkout -b dev &&\n \t: >path3 &&\n-- \n1.5.6.GIT\n"}]}