All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Emily Shaffer" <emilyshaffer@google.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 00/10] tests: add and use a "test_hook" wrapper + hook fixes
Date: Wed,  2 Mar 2022 14:22:19 +0100	[thread overview]
Message-ID: <cover-00.10-00000000000-20220302T131859Z-avarab@gmail.com> (raw)

This series is a test-only improvement series split up and adapted
from a previous series of mine to add a "git init --no-template":
https://lore.kernel.org/git/cover-00.13-00000000000-20211212T201308Z-avarab@gmail.com/

As the range-diff to that shows (with --creation-factor=50) all but
one commit changed too much for "range-diff" to show it by default.

At the end of this series we have a "test_hook" that behaves like the
existing "test_config", i.e. cleans up after itself (by default). See
08/10.

As also explained in 08/10 this means that it'll be much easier to
thoroughly test the "config-based hooks" series, as everything that
now writes hooks will go through this wrapper, and can be made to use
the config-based hooks.

Along the way I found various issues in existing tests that tested our
hooks, and fixed those issues.there were variou

Ævar Arnfjörð Bjarmason (10):
  hook tests: turn exit code assertions into a loop
  t5540: don't rely on "hook/post-update.sample"
  tests: assume the hooks are disabled by default
  bugreport tests: tighten up "git bugreport -s hooks" test
  tests: indent and add hook setup to "test_expect_success"
  hook tests: get rid of unnecessary sub-shells
  fetch+push tests: have tests clean up their own mess
  test-lib-functions: add and use a "test_hook" wrapper
  tests: change "mkdir -p && write_script" to use "test_hook"
  tests: change "cat && chmod +x" to use "test_hook"

 t/t0029-core-unsetenvvars.sh        |   3 +-
 t/t0091-bugreport.sh                |  20 +--
 t/t1350-config-hooks-path.sh        |   4 +-
 t/t1416-ref-transaction-hooks.sh    |  27 ++--
 t/t1800-hook.sh                     |  45 +++----
 t/t3404-rebase-interactive.sh       |  10 +-
 t/t3412-rebase-root.sh              |  18 +--
 t/t3413-rebase-hook.sh              |  18 +--
 t/t3430-rebase-merges.sh            |   6 +-
 t/t4150-am.sh                       |  24 +---
 t/t5401-update-hooks.sh             |  62 ++++-----
 t/t5402-post-merge-hook.sh          |  16 ++-
 t/t5403-post-checkout-hook.sh       |   3 +-
 t/t5406-remote-rejects.sh           |   2 +-
 t/t5407-post-rewrite-hook.sh        |  14 +-
 t/t5409-colorize-remote-messages.sh |   2 +-
 t/t5411-proc-receive-hook.sh        |   4 +-
 t/t5510-fetch.sh                    |   6 +-
 t/t5516-fetch-push.sh               | 192 +++++++++++++---------------
 t/t5521-pull-options.sh             |   4 +-
 t/t5534-push-signed.sh              |  26 ++--
 t/t5540-http-push-webdav.sh         |   4 +-
 t/t5541-http-push-smart.sh          |  22 ++--
 t/t5547-push-quarantine.sh          |   4 +-
 t/t5548-push-porcelain.sh           |   2 +-
 t/t5601-clone.sh                    |   4 +-
 t/t6500-gc.sh                       |  18 +--
 t/t7113-post-index-change-hook.sh   |   7 +-
 t/t7519-status-fsmonitor.sh         |  20 ++-
 t/t9001-send-email.sh               |   4 +-
 t/t9800-git-p4-basic.sh             |  23 ++--
 t/test-lib-functions.sh             |  52 ++++++++
 32 files changed, 320 insertions(+), 346 deletions(-)

Range-diff:
 1:  5526d3dc838 <  -:  ----------- t0001: fix gaps in "TEMPLATE DIRECTORY" coverage
 2:  ef2b67768cf <  -:  ----------- init: split out template population from create_default_files()
 3:  784b7947512 <  -:  ----------- init: unconditionally create the "info" directory
 4:  3d4ea5c5d30 <  -:  ----------- t0008: don't rely on default ".git/info/exclude"
 5:  6bbb39f13fc <  -:  ----------- init & clone: add a --no-template option
 6:  2f478f7ba4a <  -:  ----------- init & clone: add init.templateDir=[bool]
 7:  9402fb23b40 <  -:  ----------- test-lib: create test data with "git init --no-template" (almost)
 8:  0c9b953dd43 <  -:  ----------- tests: don't depend on template-created .git/branches
 -:  ----------- >  1:  706460d10b9 hook tests: turn exit code assertions into a loop
 9:  d97122f5fd8 !  2:  4bee939a894 t5540: don't rely on "hook/post-update.sample"
    @@ t/t5540-http-push-webdav.sh: test_expect_success 'setup remote repository' '
      	cd test_repo.git &&
      	git --bare update-server-info &&
     -	mv hooks/post-update.sample hooks/post-update &&
    -+	write_script "hooks/post-update" <<-\EOF &&
    ++	write_script hooks/post-update <<-\EOF &&
     +	exec git update-server-info
     +	EOF
      	ORIG_HEAD=$(git rev-parse --verify HEAD) &&
10:  ca55471d134 <  -:  ----------- test-lib-functions: add and use a "write_hook" wrapper
11:  6f805f7ebac <  -:  ----------- tests: change "cat && chmod +x" to use "write_hook"
12:  2acbaa77f8d <  -:  ----------- tests: migrate miscellaneous "write_script" to "write_hooks"
13:  d021a5981a1 <  -:  ----------- tests: don't depend on template-created .git/hooks
 -:  ----------- >  3:  0519102edeb tests: assume the hooks are disabled by default
 -:  ----------- >  4:  1da2efc9886 bugreport tests: tighten up "git bugreport -s hooks" test
 -:  ----------- >  5:  8dc478460ee tests: indent and add hook setup to "test_expect_success"
 -:  ----------- >  6:  d86ee06b46e hook tests: get rid of unnecessary sub-shells
 -:  ----------- >  7:  7ce22dbe738 fetch+push tests: have tests clean up their own mess
 -:  ----------- >  8:  d4102e9b929 test-lib-functions: add and use a "test_hook" wrapper
 -:  ----------- >  9:  1802158b14d tests: change "mkdir -p && write_script" to use "test_hook"
 -:  ----------- > 10:  7fef92872f3 tests: change "cat && chmod +x" to use "test_hook"
-- 
2.35.1.1228.g56895c6ee86


             reply	other threads:[~2022-03-02 13:22 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 13:22 Ævar Arnfjörð Bjarmason [this message]
2022-03-02 13:22 ` [PATCH 01/10] hook tests: turn exit code assertions into a loop Ævar Arnfjörð Bjarmason
2022-03-02 20:55   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 02/10] t5540: don't rely on "hook/post-update.sample" Ævar Arnfjörð Bjarmason
2022-03-02 21:06   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 03/10] tests: assume the hooks are disabled by default Ævar Arnfjörð Bjarmason
2022-03-02 21:13   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 04/10] bugreport tests: tighten up "git bugreport -s hooks" test Ævar Arnfjörð Bjarmason
2022-03-02 21:22   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 05/10] tests: indent and add hook setup to "test_expect_success" Ævar Arnfjörð Bjarmason
2022-03-02 21:27   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 06/10] hook tests: get rid of unnecessary sub-shells Ævar Arnfjörð Bjarmason
2022-03-02 21:31   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 07/10] fetch+push tests: have tests clean up their own mess Ævar Arnfjörð Bjarmason
2022-03-02 21:44   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 08/10] test-lib-functions: add and use a "test_hook" wrapper Ævar Arnfjörð Bjarmason
2022-03-02 21:59   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 09/10] tests: change "mkdir -p && write_script" to use "test_hook" Ævar Arnfjörð Bjarmason
2022-03-02 22:06   ` Junio C Hamano
2022-03-02 13:22 ` [PATCH 10/10] tests: change "cat && chmod +x" " Ævar Arnfjörð Bjarmason
2022-03-03  5:46   ` Eric Sunshine
2022-03-02 22:38 ` [PATCH 00/10] tests: add and use a "test_hook" wrapper + hook fixes Junio C Hamano
2022-03-07 12:43 ` [PATCH v2 " Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 01/10] hook tests: turn exit code assertions into a loop Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 02/10] t5540: don't rely on "hook/post-update.sample" Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 03/10] tests: assume the hooks are disabled by default Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 04/10] bugreport tests: tighten up "git bugreport -s hooks" test Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 05/10] tests: indent and add hook setup to "test_expect_success" Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 06/10] hook tests: get rid of unnecessary sub-shells Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 07/10] fetch+push tests: have tests clean up their own mess Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 08/10] test-lib-functions: add and use a "test_hook" wrapper Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 09/10] tests: change "mkdir -p && write_script" to use "test_hook" Ævar Arnfjörð Bjarmason
2022-03-07 12:43   ` [PATCH v2 10/10] tests: change "cat && chmod +x" " Ævar Arnfjörð Bjarmason
2022-03-07 21:26   ` [PATCH v2 00/10] tests: add and use a "test_hook" wrapper + hook fixes Junio C Hamano
2022-03-17 10:13   ` [PATCH v3 00/13] " Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 01/13] test-lib-functions: add and use a "test_hook" wrapper Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 02/13] hook tests: turn exit code assertions into a loop Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 03/13] http tests: don't rely on "hook/post-update.sample" Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 04/13] tests: assume the hooks are disabled by default Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 05/13] bugreport tests: tighten up "git bugreport -s hooks" test Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 06/13] fetch+push tests: use "test_hook" and "test_when_finished" pattern Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 07/13] gc + p4 tests: use "test_hook", remove sub-shells Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 08/13] tests: change "cat && chmod +x" to use "test_hook" Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 09/13] tests: change "mkdir -p && write_script" " Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 10/13] tests: use "test_hook" for misc "mkdir -p" and "chmod" cases Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 11/13] tests: extend "test_hook" for "rm" and "chmod -x", convert "$HOOK" Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 12/13] proc-receive hook tests: use "test_hook" instead of "write_script" Ævar Arnfjörð Bjarmason
2022-03-17 10:13     ` [PATCH v3 13/13] http tests: use "test_hook" for "smart" and "dumb" http tests Ævar Arnfjörð Bjarmason
2022-03-17 16:31     ` [PATCH v3 00/13] tests: add and use a "test_hook" wrapper + hook fixes Junio C Hamano
2022-03-17 21:04       ` Ævar Arnfjörð Bjarmason
2022-03-17 21:40         ` 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=cover-00.10-00000000000-20220302T131859Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.