mbox series

[v4,00/11] test-lib.sh: new test_commit args, simplification & fixes

Message ID cover-00.11-0000000000-20210421T101156Z-avarab@gmail.com (mailing list archive)
Headers show
Series test-lib.sh: new test_commit args, simplification & fixes | expand

Message

Ævar Arnfjörð Bjarmason April 21, 2021, 10:15 a.m. UTC
A fast re-roll of this test topic that a few things depend on, per
https://lore.kernel.org/git/xmqqk0ow1plt.fsf@gitster.g/

Changes since v3:

 * Dropped the check-non-portable-shell change

   As noted in
   https://lore.kernel.org/git/87r1j42ffz.fsf@evledraar.gmail.com/ it
   wasn't needed for the rest of this series, so let's not hold it up
   for the discussion of if/how to check "-a" and "-o" invocations of
   "test".

 * Set the remove_trash= variable so we won't leak it from the
   environment.

Ævar Arnfjörð Bjarmason (11):
  test-lib: bring $remove_trash out of retirement
  test-lib tests: remove dead GIT_TEST_FRAMEWORK_SELFTEST variable
  test-lib-functions: reword "test_commit --append" docs
  test-lib-functions: document test_commit --no-tag
  test-lib functions: add an --annotated option to "test_commit"
  describe tests: convert setup to use test_commit
  test-lib functions: add --printf option to test_commit
  submodule tests: use symbolic-ref --short to discover branch name
  test-lib: reformat argument list in test_create_repo()
  test-lib: do not show advice about init.defaultBranch under --verbose
  test-lib: split up and deprecate test_create_repo()

 t/lib-submodule-update.sh           |  3 +-
 t/t0000-basic.sh                    |  4 --
 t/t1307-config-blob.sh              |  4 +-
 t/t1403-show-ref.sh                 |  6 +--
 t/t2030-unresolve-info.sh           |  3 +-
 t/t4006-diff-mode.sh                |  6 +--
 t/t4030-diff-textconv.sh            |  8 +---
 t/t5406-remote-rejects.sh           |  1 -
 t/t5407-post-rewrite-hook.sh        |  2 -
 t/t5409-colorize-remote-messages.sh |  1 -
 t/t5520-pull.sh                     | 10 +----
 t/t6120-describe.sh                 | 58 +++++++---------------------
 t/test-lib-functions.sh             | 60 ++++++++++++++++++-----------
 t/test-lib.sh                       | 40 +++++++++++--------
 14 files changed, 87 insertions(+), 119 deletions(-)

Range-diff against v3:
 1:  a8b483bc77 <  -:  ---------- check-non-portable-shell: check for "test <cond> -a/-o <cond>"
 2:  39759d00ad !  1:  a76ea749bb test-lib: bring $remove_trash out of retirement
    @@ Commit message
         variable, 2017-04-23) and move the decision about whether to skip all
         tests earlier.
     
    +    Let's also fix a bug that was with us since abc5d372ec (Enable
    +    parallel tests, 2008-08-08): we would leak $remove_trash from the
    +    environment. We don't want this to error out, so let's reset it to the
    +    empty string first:
    +
    +         remove_trash=t GIT_SKIP_TESTS=t0001 ./t0001-init.sh
    +
         I tested this with --debug, see 4d0912a206 (test-lib.sh: do not barf
         under --debug at the end of the test, 2017-04-24) for a bug we don't
         want to re-introduce.
    @@ t/test-lib.sh: then
      fi
      
     +# Are we running this test at all?
    ++remove_trash=
     +this_test=${0##*/}
     +this_test=${this_test%%-*}
     +if match_pattern_list "$this_test" $GIT_SKIP_TESTS
 3:  d669ce3196 =  2:  de7be7844e test-lib tests: remove dead GIT_TEST_FRAMEWORK_SELFTEST variable
 4:  9313d35bf8 =  3:  709bc773fb test-lib-functions: reword "test_commit --append" docs
 5:  c916d648e4 =  4:  b67654334e test-lib-functions: document test_commit --no-tag
 6:  9b6bf65ce1 =  5:  3a166c9206 test-lib functions: add an --annotated option to "test_commit"
 7:  683b3ba3dd =  6:  981fc43ee6 describe tests: convert setup to use test_commit
 8:  dc0a863db7 =  7:  15057cdecf test-lib functions: add --printf option to test_commit
 9:  90bf55d2d4 =  8:  5d437f53ec submodule tests: use symbolic-ref --short to discover branch name
10:  e0a1e2fd52 =  9:  9ee13ee71b test-lib: reformat argument list in test_create_repo()
11:  cedf5d383b = 10:  6ba568df9f test-lib: do not show advice about init.defaultBranch under --verbose
12:  0dc0da9490 = 11:  311a9dba36 test-lib: split up and deprecate test_create_repo()