Smart HTTP tests
Hi Shawn,
This is on top of 1e0eb0f0 (Smart HTTP fetch: gzip requests) in pu.
I had to use the SetHandler syntax as suggested by Mark. My apache setup (debian 2.2.9-10+lenny) does not resolve the suffix to git-http-backend relative to document root automatically. Instead it will look for repos in ${GIT_EXEC_PATH}/git-http-backend/git/...
Clemens
PATCH 1/3 update http tests according to remote-curl capabilities
o Pushing packed refs is now fixed.
o The transport helper fails if refs are already up-to-date. Add a test for that.
o The transport helper will notice if refs are already up-to-date. We therefore need to update server info in the unpacked-refs test.
o The transport helper will purge deleted branches automatically.
--- t/t5540-http-push.sh | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
t/t5540-http-push.sh +9 -5
@@ -36,6 +36,7 @@ test_expect_success 'setup remote repository' ' cd test_repo.git && git --bare update-server-info && mv hooks/post-update.sample hooks/post-update && + ORIG_HEAD=$(git rev-parse --verify HEAD) && cd - && mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH" '
@@ -45,7 +46,7 @@ test_expect_success 'clone remote repository' ' git clone $HTTPD_URL/test_repo.git test_repo_clone ' -test_expect_failure 'push to remote repository with packed refs' ' +test_expect_success 'push to remote repository with packed refs' ' cd "$ROOT_PATH"/test_repo_clone && : >path2 && git add path2 &&
@@ -57,11 +58,15 @@ test_expect_failure 'push to remote repository with packed refs' ' test $HEAD = $(git rev-parse --verify HEAD)) ' -test_expect_success ' push to remote repository with unpacked refs' ' +test_expect_failure 'push already up-to-date' ' + git push +' + +test_expect_success 'push to remote repository with unpacked refs' ' (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && rm packed-refs && - git update-ref refs/heads/master \ - 0c973ae9bd51902a28466f3850b543fa66a6aaf4) && + git update-ref refs/heads/master $ORIG_HEAD && + git --bare update-server-info) && git push && (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && test $HEAD = $(git rev-parse --verify HEAD))
@@ -113,7 +118,6 @@ test_expect_success 'create and delete remote branch' ' git push origin dev && git fetch && git push origin :dev && - git branch -d -r origin/dev && git fetch && test_must_fail git show-ref --verify refs/remotes/origin/dev '
Signature · 1 line
1.6.5.35.ge41a3
PATCH 2/3 remote-helpers: return successfully if everything up-to-date
--- t/t5540-http-push.sh | 2 +- transport-helper.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-)
t/t5540-http-push.sh +1 -1
@@ -58,7 +58,7 @@ test_expect_success 'push to remote repository with packed refs' ' test $HEAD = $(git rev-parse --verify HEAD)) ' -test_expect_failure 'push already up-to-date' ' +test_expect_success 'push already up-to-date' ' git push '
transport-helper.c +2 -0
@@ -263,6 +263,8 @@ static int push_refs(struct transport *transport,strbuf_addstr (&buf, ref->name);strbuf_addch (&buf,'\n' ); } +if (buf.len ==0 ) +return 0 ; transport->verbose = flags &TRANSPORT_PUSH_VERBOSE ?1 :0 ;standard_options (transport);
Signature · 1 line
1.6.5.35.ge41a3
PATCH 3/3 add smart HTTP tests
Set LIB_HTTPD_GIT to enable smart HTTP tests.
--- t/lib-httpd.sh | 9 +++++++++ t/lib-httpd/apache.conf | 36 +++++++++++++++++++++++++++--------- t/t5540-http-push.sh | 46 ++++++++++++++++++++++++++++------------------ 3 files changed, 64 insertions(+), 27 deletions(-)
t/lib-httpd.sh +9 -0
@@ -88,6 +88,15 @@ prepare_httpd() { svnrepo="http://127.0.0.1:$LIB_HTTPD_PORT/svn" fi fi + + if test -n "$LIB_HTTPD_GIT" + then + HTTPD_PARA="$HTTPD_PARA -DGIT" + fi + + HTTPD_GIT_PATH=$HTTPD_DOCUMENT_ROOT_PATH/git + mkdir -p "$HTTPD_GIT_PATH" + HTTPD_GIT_URL="$HTTPD_URL/git" } start_httpd() {
t/lib-httpd/apache.conf +27 -9
@@ -10,15 +10,15 @@ ErrorLog error.log </IfModule> <IfDefine SSL> -LoadModule ssl_module modules/mod_ssl.so - -SSLCertificateFile httpd.pem -SSLCertificateKeyFile httpd.pem -SSLRandomSeed startup file:/dev/urandom 512 -SSLRandomSeed connect file:/dev/urandom 512 -SSLSessionCache none -SSLMutex file:ssl_mutex -SSLEngine On + LoadModule ssl_module modules/mod_ssl.so + + SSLCertificateFile httpd.pem + SSLCertificateKeyFile httpd.pem + SSLRandomSeed startup file:/dev/urandom 512 + SSLRandomSeed connect file:/dev/urandom 512 + SSLSessionCache none + SSLMutex file:ssl_mutex + SSLEngine On </IfDefine> <IfDefine DAV>
@@ -39,3 +39,21 @@ SSLEngine On SVNPath svnrepo </Location> </IfDefine> + +<IfDefine GIT> + LoadModule cgi_module modules/mod_cgi.so + LoadModule alias_module modules/mod_alias.so + LoadModule actions_module modules/mod_actions.so + ScriptAlias /git-http-backend ${GIT_EXEC_PATH}/git-http-backend + + <Location /git> + SetHandler git-http-backend + Action git-http-backend /git-http-backend virtual + </Location> + <Directory ${GIT_EXEC_PATH}> + Options None + </Directory> + <Files ${GIT_EXEC_PATH}/git-http-backend> + Options ExecCGI + </Files> +</IfDefine>
t/t5540-http-push.sh +28 -18
114 lines not on this page · raw message
Signature · 1 line
1.6.5.35.ge41a3
Re: [PATCH 3/3] add smart HTTP tests
Quoted 1 line · Clemens Buchacher
Set
LIB_HTTPD_GITto enable smart HTTP tests.
My concern here is we have to run the test suite twice in order to test HTTP support. We should only run it once, with GIT_TEST_HTTPD=1 set and have it all run at once.
Signature · 1 line
Shawn.
PATCH 1/1 t5540: test both smart and dumb protocols
---
Quoted 6 lines · Shawn O. Pearce
Quoted 1 line · Clemens Buchacher
Set
LIB_HTTPD_GITto enable smart HTTP tests.My concern here is we have to run the test suite twice in order to test HTTP support. We should only run it once, with GIT_TEST_HTTPD=1 set and have it all run at once.
How about this? The original code is not touched except for the test description.
Clemens
t/lib-httpd.sh | 2 + t/t5540-http-push.sh | 160 ++----------------------------------------------- t/test-http-push.sh | 159 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 153 deletions(-) create mode 100755 t/test-http-push.sh
t/lib-httpd.sh +2 -0
@@ -121,4 +121,6 @@ stop_httpd() { "$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \ -f "$TEST_PATH/apache.conf" $HTTPD_PARA -k stop + + rm -f "$HTTPD_ROOT_PATH/modules" }
t/t5540-http-push.sh +7 -153
162 lines not on this page · raw message
t/test-http-push.sh new file +159 -0
159 lines not on this page · raw message
Signature · 1 line
1.6.5.1.208.gd7b37
Re: [PATCH 2/3] remote-helpers: return successfully if everything up-to-date
In reply to Clemens BuchacherQuoted 2 lines · Clemens Buchacher
Signed-off-by Clemens Buchacher <[email protected]>
Quoted 3 lines
t/t5540-http-push.sh | 2 +- transport-helper.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-)
Signature · 1 line
Shawn.
Re: [PATCH 2/3] remote-helpers: return successfully if everything up-to-date
Thanks.
Re: [PATCH 1/3] update http tests according to remote-curl capabilities
In reply to Clemens BuchacherQuoted 11 lines · Clemens Buchacher
o Pushing packed refs is now fixed.
o The transport helper fails if refs are already up-to-date. Add a test for that.
o The transport helper will notice if refs are already up-to-date. We therefore need to update server info in the unpacked-refs test.
o The transport helper will purge deleted branches automatically.
Signed-off-by Clemens Buchacher <[email protected]>
Quoted 2 lines
t/t5540-http-push.sh | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
Shawn.