mbox series

[v2,0/3] Make test selection easier by specifying description substrings instead of just numeric counters

Message ID pull.878.v2.git.git.1602616786.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series Make test selection easier by specifying description substrings instead of just numeric counters | expand

Message

Philippe Blain via GitGitGadget Oct. 13, 2020, 7:19 p.m. UTC
This patch series enables me to change

 ./t9999-my-test.sh --run=1-3,5,17,19

into

 ./t9999-my-test.sh --run=setup,rename,symlink

and have it pick out tests with "setup", "rename", or "symlink" in their
description and run those. Saves me a lot of time, especially since numbers
for tests aren't readily accessible. The easiest way for me to get the
numbers corresponding to the tests I want to run, is to run all the tests
and look at the output to match up the descriptions with their numbers --
thus defeating the point of selecting just a subset of the tests to run in
the first place.

Changes since v1:

 * Modified the documentation slightly to combine a separate sentence into
   the previous paragraph and avoid confusion around whether negation
   applies to substring selections (pointed out by Taylor)
 * Simplified the output for skipped tests even further, as suggested by
   Taylor.

Elijah Newren (3):
  test-lib: allow selecting tests by substring/regex with --run
  t6006, t6012: adjust tests to use 'setup' instead of synonyms
  test-lib: reduce verbosity of skipped tests

 t/README                     | 29 ++++++++++++++++---------
 t/t0000-basic.sh             | 41 ++++++++++++++++++++++--------------
 t/t6006-rev-list-format.sh   |  2 +-
 t/t6012-rev-list-simplify.sh |  2 +-
 t/test-lib.sh                | 14 ++++++------
 5 files changed, 53 insertions(+), 35 deletions(-)


base-commit: d98273ba77e1ab9ec755576bc86c716a97bf59d7
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-878%2Fnewren%2Ftest-selection-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-878/newren/test-selection-v2
Pull-Request: https://github.com/git/git/pull/878

Range-diff vs v1:

 1:  46fce3a844 ! 1:  41e2528e83 test-lib: allow selecting tests by substring/regex with --run
     @@ t/README: For an individual test suite --run could be used to specify that
      -been included.  You may omit the first or the second number to
      -mean "from the first test" or "up to the very last test"
      -respectively.
     +-
     +-Optional prefix of '!' means that the test or a range of tests
     +-should be excluded from the run.
      +The argument for --run, <test-selector>, is a list of description
      +substrings or regexes or individual test numbers or ranges with an
     -+optional negation prefix that define what tests in a test suite to
     -+include in the run.  A range is two numbers separated with a dash and
     -+matches a range of tests with both ends been included.  You may omit
     -+the first or the second number to mean "from the first test" or "up to
     -+the very last test" respectively.
     ++optional negation prefix (of '!') that define what tests in a test
     ++suite to include (or exclude, if negated) in the run.  A range is two
     ++numbers separated with a dash and matches a range of tests with both
     ++ends been included.  You may omit the first or the second number to
     ++mean "from the first test" or "up to the very last test" respectively.
       
     - Optional prefix of '!' means that the test or a range of tests
     - should be excluded from the run.
     + If --run starts with an unprefixed number or range the initial
     + set of tests to run is empty. If the first item starts with '!'
      @@ t/README: test in the test suite except from 7 up to 11:
       
           $ sh ./t9200-git-cvsexport-commit.sh --run='!7-11'
 2:  d1d73400e8 = 2:  8f1a4420f4 t6006, t6012: adjust tests to use 'setup' instead of synonyms
 3:  bb2317972a ! 3:  85a4ca164a test-lib: reduce verbosity of skipped tests
     @@ t/test-lib.sh: test_skip () {
       		fi
       
      -		say_color skip >&3 "skipping test: $@"
     -+		say_color skip >&3 "skipping test: $1"
       		say_color skip "ok $test_count # skip $1 ($skipped_reason)"
       		: true
       		;;

Comments

Taylor Blau Oct. 13, 2020, 7:49 p.m. UTC | #1
On Tue, Oct 13, 2020 at 07:19:43PM +0000, Elijah Newren via GitGitGadget wrote:
> Changes since v1:
>
>  * Modified the documentation slightly to combine a separate sentence into
>    the previous paragraph and avoid confusion around whether negation
>    applies to substring selections (pointed out by Taylor)
>  * Simplified the output for skipped tests even further, as suggested by
>    Taylor.

Thanks, this version looks very good to me. With Junio's ack on the
changes in test-lib, I feel much better about my own suggestion. So,
this all looks good to me.

Thanks,
Taylor