Skip to content

Commit bf9d7df

Browse files
tmzullingergitster
authored andcommitted
t/lib-git-svn.sh: improve svnserve tests with parallel make test
Setting SVNSERVE_PORT enables several tests which require a local svnserve daemon to be run (in t9113 & t9126). The tests share setup of the local svnserve via `start_svnserve()`. The function uses svnserve's `--listen-once` option, which causes svnserve to accept one connection on the port, serve it, and exit. When running the tests in parallel this fails if one test tries to start svnserve while the other is still running. Use the test number as the svnserve port (similar to httpd tests) to avoid port conflicts. Developers can set GIT_TEST_SVNSERVE to any value other than 'false' or 'auto' to enable these tests. Acked-by: Eric Wong <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Todd Zullinger <[email protected]>
1 parent 7810977 commit bf9d7df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/lib-git-svn.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,16 @@ EOF
110110
}
111111

112112
require_svnserve () {
113-
if test -z "$SVNSERVE_PORT"
113+
test_tristate GIT_TEST_SVNSERVE
114+
if ! test "$GIT_TEST_SVNSERVE" = true
114115
then
115-
skip_all='skipping svnserve test. (set $SVNSERVE_PORT to enable)'
116+
skip_all='skipping svnserve test. (set $GIT_TEST_SVNSERVE to enable)'
116117
test_done
117118
fi
118119
}
119120

120121
start_svnserve () {
122+
SVNSERVE_PORT=${SVNSERVE_PORT-${this_test#t}}
121123
svnserve --listen-port $SVNSERVE_PORT \
122124
--root "$rawsvnrepo" \
123125
--listen-once \

0 commit comments

Comments
 (0)