{"thread":{"id":"42910","subject":"[PATCH 0/2] fix git-svn HTTP tests under Apache 2.4","startedAt":"2016-07-23T04:26:23Z","lastAt":"2016-07-25T17:42:21Z","messageCount":4,"participants":["Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"292027","messageId":"20160723042608.27489-1-e@80x24.org","threadId":"42910","inReplyTo":null,"subject":"[PATCH 0/2] fix git-svn HTTP tests under Apache 2.4","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-07-23T04:26:06Z","receivedAt":"2016-07-23T04:26:23Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This resurrects the series started by Michael in April 2015 at:\n\n  https://public-inbox.org/git/cover.1428505184.git.git@drmicha.warpmail.net/T/\n\nBut only keeps only his first patch.  PATCH 2/2 reuses the\nwork Clemens introduced in t/lib-httpd.sh back in 2008 to\nenable mod_dav_svn.\n\nThe following changes since commit 08bb3500a2a718c3c78b0547c68601cafa7a8fd9:\n\n  Sixth batch of topics for 2.10 (2016-07-19 13:26:16 -0700)\n\nare available in the git repository at:\n\n  git://bogomips.org/git-svn.git svn-httpd\n\nfor you to fetch changes up to cbc1a1fbd2911b851467862b7163c303a14b17ab:\n\n  git svn: migrate tests to use lib-httpd (2016-07-23 03:31:21 +0000)\n\n----------------------------------------------------------------\nEric Wong (1):\n      git svn: migrate tests to use lib-httpd\n\nMichael J Gruber (1):\n      t/t91*: do not say how to avoid the tests\n\n t/lib-git-svn.sh                              | 91 +++++----------------------\n t/lib-httpd.sh                                |  8 ++-\n t/lib-httpd/apache.conf                       |  4 +-\n t/t9100-git-svn-basic.sh                      |  2 -\n t/t9115-git-svn-dcommit-funky-renames.sh      |  7 ++-\n t/t9118-git-svn-funky-branch-names.sh         |  2 +-\n t/t9120-git-svn-clone-with-percent-escapes.sh |  2 +-\n t/t9142-git-svn-shallow-clone.sh              |  2 +-\n t/t9158-git-svn-mergeinfo.sh                  |  2 -\n t/t9160-git-svn-preserve-empty-dirs.sh        |  1 -\n 10 files changed, 30 insertions(+), 91 deletions(-)\n\n"},{"id":"292028","messageId":"20160723042608.27489-2-e@80x24.org","threadId":"42910","inReplyTo":"20160723042608.27489-1-e@80x24.org","subject":"[PATCH 1/2] t/t91*: do not say how to avoid the tests","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-07-23T04:26:07Z","receivedAt":"2016-07-23T04:26:29Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"From: Michael J Gruber <git@drmicha.warpmail.net>\n\nSome of the tests \"say\" how to stop the svn tests from running, some do\nnot.\n\nThe test suite is directed at people reading t/README where we keep all\ninformation about running the test suite (partly, with options etc.).\n\nRemove said \"say\" occurences.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\nSigned-off-by: Eric Wong <e@80x24.org>\n---\n t/t9100-git-svn-basic.sh               | 2 --\n t/t9158-git-svn-mergeinfo.sh           | 2 --\n t/t9160-git-svn-preserve-empty-dirs.sh | 1 -\n 3 files changed, 5 deletions(-)\n\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 28082b1..c23b11f 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -8,8 +8,6 @@ GIT_SVN_LC_ALL=${LC_ALL:-$LANG}\n \n . ./lib-git-svn.sh\n \n-say 'define NO_SVN_TESTS to skip git svn tests'\n-\n case \"$GIT_SVN_LC_ALL\" in\n *.UTF-8)\n \ttest_set_prereq UTF8\ndiff --git a/t/t9158-git-svn-mergeinfo.sh b/t/t9158-git-svn-mergeinfo.sh\nindex 13f78f2..a875b45 100755\n--- a/t/t9158-git-svn-mergeinfo.sh\n+++ b/t/t9158-git-svn-mergeinfo.sh\n@@ -7,8 +7,6 @@ test_description='git svn mergeinfo propagation'\n \n . ./lib-git-svn.sh\n \n-say 'define NO_SVN_TESTS to skip git svn tests'\n-\n test_expect_success 'initialize source svn repo' '\n \tsvn_cmd mkdir -m x \"$svnrepo\"/trunk &&\n \tsvn_cmd co \"$svnrepo\"/trunk \"$SVN_TREE\" &&\ndiff --git a/t/t9160-git-svn-preserve-empty-dirs.sh b/t/t9160-git-svn-preserve-empty-dirs.sh\nindex b4a4434..0ede3cf 100755\n--- a/t/t9160-git-svn-preserve-empty-dirs.sh\n+++ b/t/t9160-git-svn-preserve-empty-dirs.sh\n@@ -11,7 +11,6 @@ local Git repository with placeholder files.'\n \n . ./lib-git-svn.sh\n \n-say 'define NO_SVN_TESTS to skip git svn tests'\n GIT_REPO=git-svn-repo\n \n test_expect_success 'initialize source svn repo containing empty dirs' '\n-- \nEW\n\n"},{"id":"292029","messageId":"20160723042608.27489-3-e@80x24.org","threadId":"42910","inReplyTo":"20160723042608.27489-1-e@80x24.org","subject":"[PATCH 2/2] git svn: migrate tests to use lib-httpd","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-07-23T04:26:08Z","receivedAt":"2016-07-23T04:26:32Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This allows us to use common test infrastructure and parallelize\nthe tests.  For now, GIT_SVN_TEST_HTTPD=true needs to be set to\nenable the SVN HTTP tests because we reuse the same test cases\nfor both file:// and http:// SVN repositories.  SVN_HTTPD_PORT\nis no longer honored.\n\nTested under Apache 2.2 and 2.4 on Debian 7.x (wheezy) and\n8.x (jessie), respectively.\n\nCc: Clemens Buchacher <drizzd@aon.at>\nCc: Michael J Gruber <git@drmicha.warpmail.net>\nSigned-off-by: Eric Wong <e@80x24.org>\n---\n t/lib-git-svn.sh                              | 91 +++++----------------------\n t/lib-httpd.sh                                |  8 ++-\n t/lib-httpd/apache.conf                       |  4 +-\n t/t9115-git-svn-dcommit-funky-renames.sh      |  7 ++-\n t/t9118-git-svn-funky-branch-names.sh         |  2 +-\n t/t9120-git-svn-clone-with-percent-escapes.sh |  2 +-\n t/t9142-git-svn-shallow-clone.sh              |  2 +-\n 7 files changed, 30 insertions(+), 86 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex fb88232..688313e 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -65,81 +65,22 @@ svn_cmd () {\n \tsvn \"$orig_svncmd\" --config-dir \"$svnconf\" \"$@\"\n }\n \n-prepare_httpd () {\n-\tfor d in \\\n-\t\t\"$SVN_HTTPD_PATH\" \\\n-\t\t/usr/sbin/apache2 \\\n-\t\t/usr/sbin/httpd \\\n-\t; do\n-\t\tif test -f \"$d\"\n-\t\tthen\n-\t\t\tSVN_HTTPD_PATH=\"$d\"\n-\t\t\tbreak\n-\t\tfi\n-\tdone\n-\tif test -z \"$SVN_HTTPD_PATH\"\n-\tthen\n-\t\techo >&2 '*** error: Apache not found'\n-\t\treturn 1\n-\tfi\n-\tfor d in \\\n-\t\t\"$SVN_HTTPD_MODULE_PATH\" \\\n-\t\t/usr/lib/apache2/modules \\\n-\t\t/usr/libexec/apache2 \\\n-\t; do\n-\t\tif test -d \"$d\"\n-\t\tthen\n-\t\t\tSVN_HTTPD_MODULE_PATH=\"$d\"\n-\t\t\tbreak\n-\t\tfi\n-\tdone\n-\tif test -z \"$SVN_HTTPD_MODULE_PATH\"\n-\tthen\n-\t\techo >&2 '*** error: Apache module dir not found'\n-\t\treturn 1\n-\tfi\n-\tif test ! -f \"$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so\"\n-\tthen\n-\t\techo >&2 '*** error: Apache module \"mod_dav_svn\" not found'\n-\t\treturn 1\n-\tfi\n-\n-\trepo_base_path=\"${1-svn}\"\n-\tmkdir \"$GIT_DIR\"/logs\n-\n-\tcat > \"$GIT_DIR/httpd.conf\" <<EOF\n-ServerName \"git svn test\"\n-ServerRoot \"$GIT_DIR\"\n-DocumentRoot \"$GIT_DIR\"\n-PidFile \"$GIT_DIR/httpd.pid\"\n-LockFile logs/accept.lock\n-Listen 127.0.0.1:$SVN_HTTPD_PORT\n-LoadModule dav_module $SVN_HTTPD_MODULE_PATH/mod_dav.so\n-LoadModule dav_svn_module $SVN_HTTPD_MODULE_PATH/mod_dav_svn.so\n-<Location /$repo_base_path>\n-\tDAV svn\n-\tSVNPath \"$rawsvnrepo\"\n-</Location>\n-EOF\n-}\n-\n-start_httpd () {\n-\tif test -z \"$SVN_HTTPD_PORT\"\n-\tthen\n-\t\techo >&2 'SVN_HTTPD_PORT is not defined!'\n-\t\treturn\n-\tfi\n-\n-\tprepare_httpd \"$1\" || return 1\n-\n-\t\"$SVN_HTTPD_PATH\" -f \"$GIT_DIR\"/httpd.conf -k start\n-\tsvnrepo=\"http://127.0.0.1:$SVN_HTTPD_PORT/$repo_base_path\"\n-}\n-\n-stop_httpd () {\n-\ttest -z \"$SVN_HTTPD_PORT\" && return\n-\ttest ! -f \"$GIT_DIR/httpd.conf\" && return\n-\t\"$SVN_HTTPD_PATH\" -f \"$GIT_DIR\"/httpd.conf -k stop\n+maybe_start_httpd () {\n+\tloc=${1-svn}\n+\n+\ttest_tristate GIT_SVN_TEST_HTTPD\n+\tcase $GIT_SVN_TEST_HTTPD in\n+\ttrue)\n+\t\t. \"$TEST_DIRECTORY\"/lib-httpd.sh\n+\t\tLIB_HTTPD_SVN=\"$loc\"\n+\t\tstart_httpd\n+\t\t;;\n+\t*)\n+\t\tstop_httpd () {\n+\t\t\t: noop\n+\t\t}\n+\t\t;;\n+\tesac\n }\n \n convert_to_rev_db () {\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex ac2cbee..435a374 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -24,7 +24,7 @@\n #    LIB_HTTPD_MODULE_PATH       web server modules path\n #    LIB_HTTPD_PORT              listening port\n #    LIB_HTTPD_DAV               enable DAV\n-#    LIB_HTTPD_SVN               enable SVN\n+#    LIB_HTTPD_SVN               enable SVN at given location (e.g. \"svn\")\n #    LIB_HTTPD_SSL               enable SSL\n #\n # Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n@@ -162,8 +162,10 @@ prepare_httpd() {\n \t\tif test -n \"$LIB_HTTPD_SVN\"\n \t\tthen\n \t\t\tHTTPD_PARA=\"$HTTPD_PARA -DSVN\"\n-\t\t\trawsvnrepo=\"$HTTPD_ROOT_PATH/svnrepo\"\n-\t\t\tsvnrepo=\"http://127.0.0.1:$LIB_HTTPD_PORT/svn\"\n+\t\t\tLIB_HTTPD_SVNPATH=\"$rawsvnrepo\"\n+\t\t\tsvnrepo=\"http://127.0.0.1:$LIB_HTTPD_PORT/\"\n+\t\t\tsvnrepo=\"$svnrepo$LIB_HTTPD_SVN\"\n+\t\t\texport LIB_HTTPD_SVN LIB_HTTPD_SVNPATH\n \t\tfi\n \tfi\n }\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nindex 018a83a..c3e6313 100644\n--- a/t/lib-httpd/apache.conf\n+++ b/t/lib-httpd/apache.conf\n@@ -208,8 +208,8 @@ RewriteRule ^/half-auth-complete/ - [E=AUTHREQUIRED:yes]\n <IfDefine SVN>\n \tLoadModule dav_svn_module modules/mod_dav_svn.so\n \n-\t<Location /svn>\n+\t<Location /${LIB_HTTPD_SVN}>\n \t\tDAV svn\n-\t\tSVNPath svnrepo\n+\t\tSVNPath \"${LIB_HTTPD_SVNPATH}\"\n \t</Location>\n </IfDefine>\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex a87d3d3..64bb495 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -8,9 +8,10 @@ test_description='git svn dcommit can commit renames of files with ugly names'\n . ./lib-git-svn.sh\n \n test_expect_success 'load repository with strange names' '\n-\tsvnadmin load -q \"$rawsvnrepo\" < \"$TEST_DIRECTORY\"/t9115/funky-names.dump &&\n-\tstart_httpd gtk+\n-\t'\n+\tsvnadmin load -q \"$rawsvnrepo\" <\"$TEST_DIRECTORY\"/t9115/funky-names.dump\n+'\n+\n+maybe_start_httpd gtk+\n \n test_expect_success 'init and fetch repository' '\n \tgit svn init \"$svnrepo\" &&\ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex ecb1fed..41a0266 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -32,7 +32,7 @@ test_expect_success 'setup svnrepo' '\n \t\t\t\"$svnrepo/pr ject/branches/trailing_dotlock.lock\" &&\n \tsvn_cmd cp -m \"reflog\" \"$svnrepo/pr ject/trunk\" \\\n \t\t\t\"$svnrepo/pr ject/branches/not-a@{0}reflog@\" &&\n-\tstart_httpd\n+\tmaybe_start_httpd\n \t'\n \n # SVN 1.7 will truncate \"not-a%40{0]\" to just \"not-a\".\ndiff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\nindex 59465b1..b28a174 100755\n--- a/t/t9120-git-svn-clone-with-percent-escapes.sh\n+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n@@ -15,7 +15,7 @@ test_expect_success 'setup svnrepo' '\n \tsvn_cmd cp -m \"tag\" \"$svnrepo/pr ject/trunk\" \\\n \t  \"$svnrepo/pr ject/tags/v1\" &&\n \trm -rf project &&\n-\tstart_httpd\n+\tmaybe_start_httpd\n '\n \n test_expect_success 'test clone with percent escapes' '\ndiff --git a/t/t9142-git-svn-shallow-clone.sh b/t/t9142-git-svn-shallow-clone.sh\nindex e21ee5f..9ee23be 100755\n--- a/t/t9142-git-svn-shallow-clone.sh\n+++ b/t/t9142-git-svn-shallow-clone.sh\n@@ -18,7 +18,7 @@ test_expect_success 'setup test repository' '\n \t\tsvn_cmd add foo &&\n \t\tsvn_cmd commit -m \"add foo\"\n \t) &&\n-\tstart_httpd\n+\tmaybe_start_httpd\n '\n \n test_expect_success 'clone trunk with \"-r HEAD\"' '\n-- \nEW\n\n"},{"id":"292112","messageId":"xmqqvazt62dq.fsf@gitster.mtv.corp.google.com","threadId":"42910","inReplyTo":"20160723042608.27489-3-e@80x24.org","subject":"Re: [PATCH 2/2] git svn: migrate tests to use lib-httpd","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-25T17:42:09Z","receivedAt":"2016-07-25T17:42:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <e@80x24.org> writes:\n\n> This allows us to use common test infrastructure and parallelize\n> the tests.  For now, GIT_SVN_TEST_HTTPD=true needs to be set to\n> enable the SVN HTTP tests because we reuse the same test cases\n> for both file:// and http:// SVN repositories.  SVN_HTTPD_PORT\n> is no longer honored.\n>\n> Tested under Apache 2.2 and 2.4 on Debian 7.x (wheezy) and\n> 8.x (jessie), respectively.\n>\n> Cc: Clemens Buchacher <drizzd@aon.at>\n> Cc: Michael J Gruber <git@drmicha.warpmail.net>\n> Signed-off-by: Eric Wong <e@80x24.org>\n> ---\n>  t/lib-git-svn.sh                              | 91 +++++----------------------\n>  t/lib-httpd.sh                                |  8 ++-\n>  t/lib-httpd/apache.conf                       |  4 +-\n>  t/t9115-git-svn-dcommit-funky-renames.sh      |  7 ++-\n>  t/t9118-git-svn-funky-branch-names.sh         |  2 +-\n>  t/t9120-git-svn-clone-with-percent-escapes.sh |  2 +-\n>  t/t9142-git-svn-shallow-clone.sh              |  2 +-\n>  7 files changed, 30 insertions(+), 86 deletions(-)\n\nNice code reduction ;-)\n\n"}]}