git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Bobyr <ilya.bobir@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
	Ilya Bobyr <ilya.bobyr@gmail.com>, Git List <git@vger.kernel.org>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Thomas Rast <tr@thomasrast.ch>
Subject: Re: [PATCH 2/2] test-lib: GIT_TEST_ONLY to run only specific tests
Date: Mon, 03 Mar 2014 23:06:26 -0800	[thread overview]
Message-ID: <53157B72.3000205@gmail.com> (raw)
In-Reply-To: <xmqq4n3en7un.fsf@gitster.dls.corp.google.com>

On 3/3/2014 4:08 PM, Junio C Hamano wrote:
> Ilya Bobyr <ilya.bobir@gmail.com> writes:
>
>> It might be that we are looking at different use cases, as you are
>> talking about whole test suits.
> I do not think so.

Good :)
I am trying to understand the use cases.  And make sure we are talking 
about the same ones.
I am not sure what are the use cases for GIT_SKIP_TESTS.

I think that while in it really nice when an interface allows to do new 
things, the main use case (or use cases) should be as easy and obvious 
in the first place.
If the target is the TDD use case I described, then it appears that a 
user needs to do double negation.  That is what concerns me.

> I do not see anything prevents you from saying
>
> 	GIT_SKIP_TESTS='t0000 !t0000.1 !t0000.4'
>
> to specify test-pieces in individual tests so that you can run the
> setup step (step .1) and the specific test (step .4) without running
> two tests in between.

While it could be done, it looks less obvious than this:

     GIT_TEST_ONLY='1 4' ./t0001-init.sh

What if we do what you proposed, but with GIT_RUN_TESTS?
If we want to have one interface, maybe, building on top of a "negation" 
(GIT_SKIP_TESTS) is not very good.
At the same time, GIT_TEST_ONLY is also too specific for a generic 
interface.
I could add GIT_RUN_TESTS and allow it to have all of the features, thus 
making GIT_SKIP_TESTS a working but deprecated tool.

Running specific tests:
     GIT_RUN_TESTS='t0000'
     GIT_RUN_TESTS='t0000.1 t0002'
     GIT_RUN_TESTS='1 3 7'

Negating some tests:
     GIT_RUN_TESTS='!t0000'
     GIT_RUN_TESTS='!t0000.1'
     GIT_RUN_TESTS='!1 !3 !7'

The above would work exactly as you described but with one less level of 
negation.  Default is everything, unless at least one positive pattern 
is given.

Later on range specification could added:
     GIT_RUN_TESTS='<11'

At least for now that would cover most use cases that I can think of 
that look reasonable.

  reply	other threads:[~2014-03-04  7:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 10:24 [PATCH 1/2] test-lib: tests skipped by GIT_SKIP_TESTS say so Ilya Bobyr
2014-03-03 10:24 ` [PATCH 2/2] test-lib: GIT_TEST_ONLY to run only specific tests Ilya Bobyr
2014-03-03 15:56   ` Philip Oakley
2014-03-03 23:03   ` Eric Sunshine
2014-03-03 23:16     ` Ilya Bobyr
2014-03-03 23:26     ` Junio C Hamano
2014-03-03 23:48       ` Ilya Bobyr
2014-03-04  0:08         ` Junio C Hamano
2014-03-04  7:06           ` Ilya Bobyr [this message]
2014-03-04  8:29             ` Junio C Hamano
2014-03-04  9:18               ` Ilya Bobyr
2014-03-04 19:01                 ` Junio C Hamano
2014-03-03 15:11 ` [PATCH 1/2] test-lib: tests skipped by GIT_SKIP_TESTS say so Philip Oakley
2014-03-03 23:08   ` Ilya Bobyr
2014-03-03 22:59 ` Eric Sunshine
2014-03-03 23:12   ` Ilya Bobyr
2014-03-03 23:13   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53157B72.3000205@gmail.com \
    --to=ilya.bobir@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ilya.bobyr@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=sunshine@sunshineco.com \
    --cc=tr@thomasrast.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).