Re: [PATCH 1/2] daemon: add tests
- From
Jeff King <peff@peff.net>
- Date
- Oct 17, 2011, 02:01 UTC
- Message-ID
- <20111017020103.GA18536@sigill.intra.peff.net>
- In-Reply-To
- <1318803076-4229-1-git-send-email-drizzd@aon.at>
On Mon, Oct 17, 2011 at 12:11:15AM +0200, Clemens Buchacher wrote:
Show 6 quoted lines
> The semantics of the git daemon tests are similar to the http > transport tests. In fact, they are only a slightly modified copy > of t5550, plus the newly added remote error tests. > > All daemon tests will be skipped unless the environment variable > GIT_TEST_DAEMON is set.
Thanks, it's nice to have some tests. Overall, some of the tests feel a little silly, because the results should be exactly the same as fetching or pushing a local repository (so the "set-head" thing, for example, really has little to do with git-daemon). At the same time, maybe it's a good thing to re-confirm that the results really are the same. :)
Show 15 quoted lines
> diff --git a/t/lib-daemon.sh b/t/lib-daemon.sh
> new file mode 100644
> index 0000000..30a89ea
> --- /dev/null
> +++ b/t/lib-daemon.sh
> @@ -0,0 +1,52 @@
> +#!/bin/sh
> +
> +if test -z "$GIT_TEST_DAEMON"
> +then
> + skip_all="Daemon testing disabled (define GIT_TEST_DAEMON to enable)"
> + test_done
> +fi
> +
> +LIB_DAEMON_PORT=${LIB_DAEMON_PORT-'8121'}I assume you picked this arbitrarily to be LIB_HTTPD_PORT+10. It's fine to have a default, but note that each of the httpd tests actually defaults the port to their test number, so they can be run in parallel.
So that would be:
Show 10 quoted lines
> --- /dev/null > +++ b/t/t5570-git-daemon.sh > @@ -0,0 +1,148 @@ > +#!/bin/sh > + > +test_description='test fetching over git protocol' > +. ./test-lib.sh > + > +. "$TEST_DIRECTORY"/lib-daemon.sh > +start_daemon
LIB_DAEMON_PORT=${LIB_DAEMON_PORT-'5570'}here.