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

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

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 14, 2020, 21:13 UTC
Message-ID
<pull.878.v3.git.git.1602710025.gitgitgadget@gmail.com>
In-Reply-To
<pull.878.v2.git.git.1602616786.gitgitgadget@gmail.com>
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 v2:
 * Use a glob rather than a regex for selecting tests
 * Touched up the commit message in patch 3 to mention that the TAP output
   line is still included for skipped tests and already included the word
   "skip" to highlight the fact that the test was skipped.
 * Fixed a bug where -run="!rename" would run all tests instead of skipping
   the ones with 'rename' in the description
Elijah Newren (3):
  test-lib: allow selecting tests by substring/glob 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                | 17 +++++++++------
 5 files changed, 56 insertions(+), 35 deletions(-)
base-commit: d98273ba77e1ab9ec755576bc86c716a97bf59d7
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-878%2Fnewren%2Ftest-selection-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-878/newren/test-selection-v3
Pull-Request: https://github.com/git/git/pull/878
Range-diff vs v2:
 1:  41e2528e83 ! 1:  9c8b6a1a94 test-lib: allow selecting tests by substring/regex with --run
     @@ Metadata
      Author: Elijah Newren <newren@gmail.com>
      
       ## Commit message ##
     -    test-lib: allow selecting tests by substring/regex with --run
     +    test-lib: allow selecting tests by substring/glob with --run
      
          Many of our test scripts have several "setup" tests.  It's a lot easier
          to say
     @@ t/README: For an individual test suite --run could be used to specify that
      -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
     ++substrings or globs or individual test numbers or ranges with an
      +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
     @@ t/README: test in the test suite except from 7 up to 11:
       
      +Sometimes there may be multiple tests with e.g. "setup" in their name
      +that are needed and rather than figuring out the number for all of them
     -+we can just use "setup" as a substring/regex to match against the test
     ++we can just use "setup" as a substring/glob to match against the test
      +description:
      +
      +    $ sh ./t0050-filesystem.sh --run=setup,9-11
     @@ t/test-lib.sh: match_test_selector_list () {
      -					echo "error: $title: invalid non-numeric in test" \
      -						"selector: '$orig_selector'" >&2
      -					exit 1
     -+					echo "$title" | grep -q "$selector" && return
     ++					case "$title" in *${selector}*)
     ++						include=$positive
     ++						;;
     ++					esac
      +					continue
       				fi
       		esac
 2:  8f1a4420f4 = 2:  6479d73603 t6006, t6012: adjust tests to use 'setup' instead of synonyms
 3:  85a4ca164a ! 3:  24f6febde6 test-lib: reduce verbosity of skipped tests
     @@ Commit message
          When using the --run flag to run just two or three tests from a test
          file which contains several dozen tests, having every skipped test print
          out dozens of lines of output for the test code for that skipped test
     -    adds up to hundreds or thousands of lines of irrelevant output that make
     -    it very hard to fish out the relevant results you were looking for.
     -    Simplify the output for skipped tests down to just showing the one-line
     -    descriptions.
     +    (in addition to the TAP output line) adds up to hundreds or thousands of
     +    lines of irrelevant output that make it very hard to fish out the
     +    relevant results you were looking for.  Simplify the output for skipped
     +    tests to remove this extra output, leaving only the TAP output line
     +    (i.e. the line reading "ok <number> # skip <test-description>", which
     +    already mentions that the test was "skip"ped).
      
          Signed-off-by: Elijah Newren <newren@gmail.com>
      
-- 
gitgitgadget
Previous: Taylor BlauNext: Elijah Newren via GitGitGadget
Message 46 of 71 in “Make test selection easier by specifying description substrings instead of just numeric counters”
  1. 0/3 Make test selection easier by specifying description substrings instead of just numeric countersElijah Newren via GitGitGadget, Oct 12, 2020
  2. 1/3 test-lib: allow selecting tests by substring/regex with --runElijah Newren via GitGitGadget, Oct 12, 2020
  3. Taylor BlauOct 13, 2020
  4. Elijah NewrenOct 13, 2020
  5. Taylor BlauOct 13, 2020
  6. Elijah NewrenOct 13, 2020
  7. 3/3 test-lib: reduce verbosity of skipped testsElijah Newren via GitGitGadget, Oct 12, 2020
  8. Taylor BlauOct 13, 2020
  9. Elijah NewrenOct 13, 2020
  10. Junio C HamanoOct 13, 2020
  11. 2/3 t6006, t6012: adjust tests to use 'setup' instead of synonymsElijah Newren via GitGitGadget, Oct 12, 2020
  12. Phillip WoodOct 13, 2020
  13. Johannes SchindelinOct 15, 2020
  14. Phillip WoodOct 15, 2020
  15. 0/3 Make test selection easier by specifying description substrings instead of just numeric countersElijah Newren via GitGitGadget, Oct 13, 2020
  16. 1/3 test-lib: allow selecting tests by substring/regex with --runElijah Newren via GitGitGadget, Oct 13, 2020
  17. Jeff KingOct 14, 2020
  18. Junio C HamanoOct 14, 2020
  19. Jeff KingOct 14, 2020
  20. Junio C HamanoOct 14, 2020
  21. Elijah NewrenOct 14, 2020
  22. Jeff KingOct 14, 2020
  23. Junio C HamanoOct 15, 2020
  24. Junio C HamanoOct 15, 2020
  25. Elijah NewrenOct 14, 2020
  26. Junio C HamanoOct 14, 2020
  27. Elijah NewrenOct 14, 2020
  28. Junio C HamanoOct 15, 2020
  29. Jeff KingOct 14, 2020
  30. Elijah NewrenOct 14, 2020
  31. Junio C HamanoOct 15, 2020
  32. Jeff KingOct 15, 2020
  33. Junio C HamanoOct 15, 2020
  34. Jeff KingOct 16, 2020
  35. Junio C HamanoOct 16, 2020
  36. Junio C HamanoOct 16, 2020
  37. Jeff KingOct 16, 2020
  38. Junio C HamanoOct 16, 2020
  39. 2/3 t6006, t6012: adjust tests to use 'setup' instead of synonymsElijah Newren via GitGitGadget, Oct 13, 2020
  40. 3/3 test-lib: reduce verbosity of skipped testsElijah Newren via GitGitGadget, Oct 13, 2020
  41. Jeff KingOct 14, 2020
  42. Elijah NewrenOct 14, 2020
  43. Jeff KingOct 14, 2020
  44. Elijah NewrenOct 14, 2020
  45. Taylor BlauOct 13, 2020
  46. 0/3 Make test selection easier by specifying description substrings instead of just numeric countersElijah Newren via GitGitGadget, Oct 14, 2020
  47. 2/3 t6006, t6012: adjust tests to use 'setup' instead of synonymsElijah Newren via GitGitGadget, Oct 14, 2020
  48. 3/3 test-lib: reduce verbosity of skipped testsElijah Newren via GitGitGadget, Oct 14, 2020
  49. 1/3 test-lib: allow selecting tests by substring/glob with --runElijah Newren via GitGitGadget, Oct 14, 2020
  50. Phillip WoodOct 16, 2020
  51. Elijah NewrenOct 16, 2020
  52. Phillip WoodOct 16, 2020
  53. Junio C HamanoOct 16, 2020
  54. Jeff KingOct 16, 2020
  55. Jeff KingOct 15, 2020
  56. 0/3 Make test selection easier by specifying description substrings instead of just numeric countersElijah Newren via GitGitGadget, Oct 16, 2020
  57. 1/3 test-lib: allow selecting tests by substring/glob with --runElijah Newren via GitGitGadget, Oct 16, 2020
  58. 3/3 test-lib: reduce verbosity of skipped testsElijah Newren via GitGitGadget, Oct 16, 2020
  59. 2/3 t6006, t6012: adjust tests to use 'setup' instead of synonymsElijah Newren via GitGitGadget, Oct 16, 2020
  60. Junio C HamanoOct 16, 2020
  61. Elijah NewrenOct 16, 2020
  62. 0/3 Make test selection easier by specifying description substrings instead of just numeric countersElijah Newren via GitGitGadget, Oct 16, 2020
  63. 2/3 t6006, t6012: adjust tests to use 'setup' instead of synonymsElijah Newren via GitGitGadget, Oct 16, 2020
  64. 3/3 test-lib: reduce verbosity of skipped testsElijah Newren via GitGitGadget, Oct 16, 2020
  65. 1/3 test-lib: allow selecting tests by substring/glob with --runElijah Newren via GitGitGadget, Oct 16, 2020
  66. Andrei RybakOct 16, 2020
  67. Elijah NewrenOct 17, 2020
  68. 0/3 Make test selection easier by specifying description substrings instead of just numeric countersElijah Newren via GitGitGadget, Oct 18, 2020
  69. 1/3 test-lib: allow selecting tests by substring/glob with --runElijah Newren via GitGitGadget, Oct 18, 2020
  70. 2/3 t6006, t6012: adjust tests to use 'setup' instead of synonymsElijah Newren via GitGitGadget, Oct 18, 2020
  71. 3/3 test-lib: reduce verbosity of skipped testsElijah Newren via GitGitGadget, Oct 18, 2020

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.