git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] remote-helpers: move tests out of contrib

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 21, 2014, 18:36 UTC
Message-ID
<xmqq7g6ia5rr.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1398029971-1396-3-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 54 quoted lines
> They should be tested by default.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  contrib/remote-helpers/Makefile                            | 14 --------------
>  t/Makefile                                                 |  8 +++++++-
>  .../remote-helpers/test-bzr.sh => t/remote-helpers/bzr.t   |  2 +-
>  .../test-hg-bidi.sh => t/remote-helpers/hg-bidi.t          |  2 +-
>  .../test-hg-hg-git.sh => t/remote-helpers/hg-hg-git.t      |  2 +-
>  contrib/remote-helpers/test-hg.sh => t/remote-helpers/hg.t |  2 +-
>  6 files changed, 11 insertions(+), 19 deletions(-)
>  delete mode 100644 contrib/remote-helpers/Makefile
>  rename contrib/remote-helpers/test-bzr.sh => t/remote-helpers/bzr.t (99%)
>  rename contrib/remote-helpers/test-hg-bidi.sh => t/remote-helpers/hg-bidi.t (98%)
>  rename contrib/remote-helpers/test-hg-hg-git.sh => t/remote-helpers/hg-hg-git.t (99%)
>  rename contrib/remote-helpers/test-hg.sh => t/remote-helpers/hg.t (99%)
>
> diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
> deleted file mode 100644
> index 239161d..0000000
> --- a/contrib/remote-helpers/Makefile
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -TESTS := $(wildcard test*.sh)
> -
> -export T := $(addprefix $(CURDIR)/,$(TESTS))
> -export MAKE := $(MAKE) -e
> -export PATH := $(CURDIR):$(PATH)
> -export TEST_LINT := test-lint-executable test-lint-shell-syntax
> -
> -test:
> -	$(MAKE) -C ../../t $@
> -
> -$(TESTS):
> -	$(MAKE) -C ../../t $(CURDIR)/$@
> -
> -.PHONY: $(TESTS)
> diff --git a/t/Makefile b/t/Makefile
> index 8fd1a72..818f4ed 100644
> --- a/t/Makefile
> +++ b/t/Makefile
> @@ -14,6 +14,7 @@ RM ?= rm -f
>  PROVE ?= prove
>  DEFAULT_TEST_TARGET ?= test
>  TEST_LINT ?= test-lint-duplicates test-lint-executable
> +export TEST_DIRECTORY = $(CURDIR)
>  
>  ifdef TEST_OUTPUT_DIRECTORY
>  TEST_RESULTS_DIRECTORY = $(TEST_OUTPUT_DIRECTORY)/test-results
> @@ -29,6 +30,9 @@ TEST_RESULTS_DIRECTORY_SQ = $(subst ','\'',$(TEST_RESULTS_DIRECTORY))
>  T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
>  TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
>  TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
> +TREMOTE = $(wildcard remote-helpers/*.t)

This step needs a bit more work, I am afraid, to at least have these three test scripts follow the same numbering scheme. Especially given that there were recent discussions on allowing a range of tests to be run (or omitted) via notations like "5000,5020,9800-9812", not doing so now will make it harder to implement such an enhancement.

Also, I noticed that, unlike say t9801 that shows this:
    $ cd t && make T=t9801-*sh prove
    rm -f -r 'test-results'
    *** prove ***
    t9801-git-p4-branch.sh .. skipped: skipping git p4 tests; no p4 or p4d
    Files=1, Tests=0,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.00 ...
    Result: NOTESTS
these are unnecessarily noisy when refusing to run:
    $ cd t && make T=remote-helpers/bzr.t prove
    *** prove ***
    remote-helpers/bzr.t .. Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/buildtools/current/sitecustomize/sitecu...
        return real_import(name, globals, locals, fromlist, level)
    ImportError: No module named bzrlib
    remote-helpers/bzr.t .. skipped: skipping remote-bzr tests; bzr not available
    Files=1, Tests=0,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.02 ...
Can we squelch these expected import error messages?
Thanks.
Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 8 in “remote-helpers: graduate”
  1. 0/2 remote-helpers: graduateFelipe Contreras, Apr 20, 2014
  2. 1/2 remote-helpers: move out of contribFelipe Contreras, Apr 20, 2014
  3. 2/2 remote-helpers: move tests out of contribFelipe Contreras, Apr 20, 2014
  4. Junio C HamanoApr 21, 2014
  5. Felipe ContrerasApr 21, 2014
  6. Junio C HamanoApr 21, 2014
  7. Felipe ContrerasApr 21, 2014
  8. Junio C HamanoApr 21, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.