Re: [PATCH 2/2] t/lib-git-svn.sh: improve svnserve tests with parallel make test

2017-11-30 Thread Todd Zullinger

Jonathan Nieder wrote:
Yep, with this description it is 
Reviewed-by: Jonathan Nieder 


Thanks for putting up with my nits. :)


Thank you for taking the time and looking at the details. :)

I'll send a v2 with the changes in the morning, in case there are any 
other comments (but mostly because it's late and time for a swim).


--
Todd
~~
It is impossible to enjoy idling thoroughly unless one has plenty of
work to do.
   -- Jerome K. Jerome



Re: [PATCH 2/2] t/lib-git-svn.sh: improve svnserve tests with parallel make test

2017-11-30 Thread Todd Zullinger

Hi Jonathan,

Jonathan Nieder wrote:

Todd Zullinger wrote:


Previously, setting SVNSERVE_PORT enabled several tests which require a
local svnserve daemon to be run (in t9113 & t9126).  The tests share the
setup of the local svnserve via `start_svnserve()`.  The function uses
the svnserve option `--listen-once` 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.


I had trouble reading this because I didn't know what previous time it
was referring to.  Is it about how the option currently behaves?

(Git's commit messages tend to use the present tense to describe the
behavior before the patch, like a bug report, and the imperative to
describe the change the patch proposes to make, like an impolite bug
report. :))


This is what I get for skipping grammar classes to go hiking in my
youth.  But I'm sure I'd do it all again, if given the chance. ;)


Use the test number as the svnserve port (similar to httpd tests) to
avoid port conflicts.  Set GIT_TEST_SVNSERVE to any value other than
'false' or 'auto' to enable these tests.


This uses imperative in two ways and also ended up confusing me.  The
second one is a direction to me, not Git, right?  How about:

Use the test number instead of $SVNSERVE_PORT 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.


Much better, thank you.  How about this for the full commit message:

   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.

?

Thanks,

--
Todd
~~
Curiosity killed the cat, but for awhile I was a suspect.
   -- Steven Wright



Re: [PATCH 2/2] t/lib-git-svn.sh: improve svnserve tests with parallel make test

2017-11-30 Thread Jonathan Nieder
Hi,

Todd Zullinger wrote:

> Previously, setting SVNSERVE_PORT enabled several tests which require a
> local svnserve daemon to be run (in t9113 & t9126).  The tests share the
> setup of the local svnserve via `start_svnserve()`.  The function uses
> the svnserve option `--listen-once` 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.

I had trouble reading this because I didn't know what previous time it
was referring to.  Is it about how the option currently behaves?

(Git's commit messages tend to use the present tense to describe the
behavior before the patch, like a bug report, and the imperative to
describe the change the patch proposes to make, like an impolite bug
report. :))

> Use the test number as the svnserve port (similar to httpd tests) to
> avoid port conflicts.  Set GIT_TEST_SVNSERVE to any value other than
> 'false' or 'auto' to enable these tests.

This uses imperative in two ways and also ended up confusing me.  The
second one is a direction to me, not Git, right?  How about:

Use the test number instead of $SVNSERVE_PORT 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.
>
> Signed-off-by: Todd Zullinger 
> ---
>  t/lib-git-svn.sh | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

The patch looks good.  Thanks.

> diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
> index 84366b2624..4c1f81f167 100644
> --- a/t/lib-git-svn.sh
> +++ b/t/lib-git-svn.sh
> @@ -110,14 +110,16 @@ EOF
>  }
>  
>  require_svnserve () {
> - if test -z "$SVNSERVE_PORT"
> + test_tristate GIT_TEST_SVNSERVE
> + if ! test "$GIT_TEST_SVNSERVE" = true
>   then
> - skip_all='skipping svnserve test. (set $SVNSERVE_PORT to 
> enable)'
> + skip_all='skipping svnserve test. (set $GIT_TEST_SVNSERVE to 
> enable)'
>   test_done
>   fi
>  }
>  
>  start_svnserve () {
> + SVNSERVE_PORT=${SVNSERVE_PORT-${this_test#t}}
>   svnserve --listen-port $SVNSERVE_PORT \
>--root "$rawsvnrepo" \
>--listen-once \
> -- 
> 2.15.1
>