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

Re: [PATCH 06/12] t: prepare execution of potentially failing commands for `set -e`

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 14, 2026, 07:23 UTC
Message-ID
<ad3rgbgadjIZRgaz@pks.im>
In-Reply-To
<xmqq340yfivf.fsf@gitster.g>
On Mon, Apr 13, 2026 at 06:09:08PM -0700, Junio C Hamano wrote:
Show 29 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > I think I know what is lacking in this patch.  Following the above
> > section (which is a good conversion), there is this bit that needs a
> > similar handling.
> >
> >  t/lib-git-svn.sh | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git c/t/lib-git-svn.sh w/t/lib-git-svn.sh
> > index 2fde2353fd..24c15d17eb 100644
> > --- c/t/lib-git-svn.sh
> > +++ w/t/lib-git-svn.sh
> > @@ -27,13 +27,13 @@ export svnrepo
> >  svnconf=$PWD/svnconf
> >  export svnconf
> >  
> > +x=0
> >  perl -w -e "
> >  use SVN::Core;
> >  use SVN::Repos;
> >  \$SVN::Core::VERSION gt '1.1.0' or exit(42);
> >  system(qw/svnadmin create --fs-type fsfs/, \$ENV{svnrepo}) == 0 or exit(41);
> > -" >&3 2>&4
> > -x=$?
> > +" >&3 2>&4 || x=$?
> >  if test $x -ne 0
> >  then
> >  	if test $x -eq 42; then
Thanks, I've queued that change locally.
Show 35 quoted lines
> The above is queued as a squash fix-up on top of the topic, but with
> the topic merged to 'seen', we seem to be getting a CI failure that
> appears specific to macOS.  Compare the failing
> 
>   https://github.com/git/git/actions/runs/24371204585 (aa13593)
> 
> with the same tree without the topic
> 
>   https://github.com/git/git/actions/runs/24369661492 (ad8b884)
> 
> The only differences between the commits are
> 
> $ git diff --compact-summary ad8b884 aa13593
>  t/lib-git-daemon.sh                | 13 ++++++++++---
>  t/lib-git-svn.sh                   |  7 +++----
>  t/lib-httpd.sh                     |  3 +--
>  t/t0005-signals.sh                 |  4 ++--
>  t/t0008-ignores.sh                 |  4 ++--
>  t/t1301-shared-repo.sh             |  2 +-
>  t/t3600-rm.sh                      |  2 +-
>  t/t4032-diff-inter-hunk-context.sh | 14 ++++++++------
>  t/t6002-rev-list-bisect.sh         | 17 ++++++++++-------
>  t/t7450-bad-git-dotfiles.sh        | 24 +++++++++++++-----------
>  t/t7508-status.sh                  |  4 ++--
>  t/t9138-git-svn-authors-prog.sh    |  4 ++--
>  t/t9200-git-cvsexportcommit.sh     |  3 +--
>  t/t9400-git-cvsserver-server.sh    |  5 +++--
>  t/t9401-git-cvsserver-crlf.sh      |  4 ++--
>  t/t9402-git-cvsserver-refs.sh      |  4 ++--
>  t/t9902-completion.sh              |  2 +-
>  t/test-lib-functions.sh            | 12 ++++++++----
>  t/test-lib.sh                      |  8 ++++++--
>  19 files changed, 78 insertions(+), 58 deletions(-)
> 
> which does match what is contained in this topic.

I knew it was a bad idea to not also run tests on GitHub Actions :) I'll do that before the next reroll.

Anyway, looking at the failing test t9501, I assume that Perl isn't able to enable the DATE_PARSER prerequisite. So something like the below patch might hopefully fix it.

Thanks!
Patrick
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 32814e75df..3acb58125b 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -15,12 +15,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-gitweb.sh
 
-#
 # Gitweb only provides the functionality tested by the 'modification times'
 # tests if it can access a date parser from one of these modules:
-#
-perl -MHTTP::Date -e 0 >/dev/null 2>&1 && test_set_prereq DATE_PARSER
-perl -MTime::ParseDate -e 0 >/dev/null 2>&1 && test_set_prereq DATE_PARSER
+test_lazy_prereq DATE_PARSER '
+	perl -MHTTP::Date -e 0 ||
+	perl -MTime::ParseDate -e 0
+'
 
 # ----------------------------------------------------------------------
 # snapshot settings
Previous: Patrick SteinhardtNext: Junio C Hamano
Message 26 of 95 in “t: detect errors outside of test cases”
  1. 00/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 13, 2026
  2. 01/12 t: prepare `test_match_signal ()` calls for `set -e`Patrick Steinhardt, Apr 13, 2026
  3. Junio C HamanoApr 13, 2026
  4. Patrick SteinhardtApr 14, 2026
  5. Junio C HamanoApr 14, 2026
  6. 02/12 t: prepare `test_must_fail ()` for `set -e`Patrick Steinhardt, Apr 13, 2026
  7. Junio C HamanoApr 13, 2026
  8. Patrick SteinhardtApr 14, 2026
  9. Jeff KingApr 14, 2026
  10. Junio C HamanoApr 14, 2026
  11. Patrick SteinhardtApr 15, 2026
  12. Jeff KingApr 16, 2026
  13. 03/12 t: prepare `stop_git_daemon ()` for `set -e`Patrick Steinhardt, Apr 13, 2026
  14. Junio C HamanoApr 13, 2026
  15. 04/12 t: prepare `git config --unset` calls for `set -e`Patrick Steinhardt, Apr 13, 2026
  16. Junio C HamanoApr 13, 2026
  17. 05/12 t: prepare conditional test execution for `set -e`Patrick Steinhardt, Apr 13, 2026
  18. Junio C HamanoApr 13, 2026
  19. 06/12 t: prepare execution of potentially failing commands for `set -e`Patrick Steinhardt, Apr 13, 2026
  20. Junio C HamanoApr 13, 2026
  21. Patrick SteinhardtApr 14, 2026
  22. Junio C HamanoApr 14, 2026
  23. Junio C HamanoApr 13, 2026
  24. Junio C HamanoApr 14, 2026
  25. Patrick SteinhardtApr 14, 2026
  26. Patrick SteinhardtApr 14, 2026
  27. Junio C HamanoApr 14, 2026
  28. Jeff KingApr 14, 2026
  29. Jeff KingApr 14, 2026
  30. Jeff KingApr 14, 2026
  31. Patrick SteinhardtApr 15, 2026
  32. Jeff KingApr 16, 2026
  33. Patrick SteinhardtApr 16, 2026
  34. Junio C HamanoApr 16, 2026
  35. Jeff KingApr 18, 2026
  36. Junio C HamanoApr 15, 2026
  37. 07/12 t: prepare `test_when_finished ()`/`test_atexit()` for `set -e`Patrick Steinhardt, Apr 13, 2026
  38. Junio C HamanoApr 13, 2026
  39. Patrick SteinhardtApr 14, 2026
  40. 08/12 t0008: silence error in subshell when using `grep -v`Patrick Steinhardt, Apr 13, 2026
  41. Junio C HamanoApr 13, 2026
  42. Patrick SteinhardtApr 14, 2026
  43. 09/12 t1301: don't fail in case setfacl(1) doesn't exist or failsPatrick Steinhardt, Apr 13, 2026
  44. 10/12 t6002: fix use of `expr` with `set -e`Patrick Steinhardt, Apr 13, 2026
  45. 11/12 t9902: fix use of `read` with `set -e`Patrick Steinhardt, Apr 13, 2026
  46. 12/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 13, 2026
  47. Junio C HamanoApr 13, 2026
  48. Junio C HamanoApr 13, 2026
  49. Junio C HamanoApr 13, 2026
  50. 00/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 16, 2026
  51. 01/12 t: prepare `test_match_signal ()` calls for `set -e`Patrick Steinhardt, Apr 16, 2026
  52. 02/12 t: prepare `test_must_fail ()` for `set -e`Patrick Steinhardt, Apr 16, 2026
  53. 03/12 t: prepare `stop_git_daemon ()` for `set -e`Patrick Steinhardt, Apr 16, 2026
  54. 04/12 t: prepare `git config --unset` calls for `set -e`Patrick Steinhardt, Apr 16, 2026
  55. 05/12 t: prepare conditional test execution for `set -e`Patrick Steinhardt, Apr 16, 2026
  56. 06/12 t: prepare execution of potentially failing commands for `set -e`Patrick Steinhardt, Apr 16, 2026
  57. 07/12 t: prepare `test_when_finished ()`/`test_atexit()` for `set -e`Patrick Steinhardt, Apr 16, 2026
  58. 08/12 t0008: silence error in subshell when using `grep -v`Patrick Steinhardt, Apr 16, 2026
  59. 09/12 t1301: don't fail in case setfacl(1) doesn't exist or failsPatrick Steinhardt, Apr 16, 2026
  60. 10/12 t6002: fix use of `expr` with `set -e`Patrick Steinhardt, Apr 16, 2026
  61. 11/12 t9902: fix use of `read` with `set -e`Patrick Steinhardt, Apr 16, 2026
  62. SZEDER GáborApr 16, 2026
  63. Junio C HamanoApr 16, 2026
  64. Patrick SteinhardtApr 17, 2026
  65. 12/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 16, 2026
  66. Junio C HamanoApr 16, 2026
  67. 00/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 20, 2026
  68. 01/12 t: prepare `test_match_signal ()` calls for `set -e`Patrick Steinhardt, Apr 20, 2026
  69. 02/12 t: prepare `test_must_fail ()` for `set -e`Patrick Steinhardt, Apr 20, 2026
  70. 03/12 t: prepare `stop_git_daemon ()` for `set -e`Patrick Steinhardt, Apr 20, 2026
  71. 04/12 t: prepare `git config --unset` calls for `set -e`Patrick Steinhardt, Apr 20, 2026
  72. 05/12 t: prepare conditional test execution for `set -e`Patrick Steinhardt, Apr 20, 2026
  73. 06/12 t: prepare execution of potentially failing commands for `set -e`Patrick Steinhardt, Apr 20, 2026
  74. 07/12 t: prepare `test_when_finished ()`/`test_atexit()` for `set -e`Patrick Steinhardt, Apr 20, 2026
  75. 08/12 t0008: silence error in subshell when using `grep -v`Patrick Steinhardt, Apr 20, 2026
  76. 09/12 t1301: don't fail in case setfacl(1) doesn't exist or failsPatrick Steinhardt, Apr 20, 2026
  77. 10/12 t6002: fix use of `expr` with `set -e`Patrick Steinhardt, Apr 20, 2026
  78. 11/12 t9902: fix use of `read` with `set -e`Patrick Steinhardt, Apr 20, 2026
  79. 12/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 20, 2026
  80. Junio C HamanoApr 20, 2026
  81. Jeff KingApr 21, 2026
  82. Patrick SteinhardtApr 21, 2026
  83. 00/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 21, 2026
  84. 01/12 t: prepare `test_match_signal ()` calls for `set -e`Patrick Steinhardt, Apr 21, 2026
  85. 02/12 t: prepare `test_must_fail ()` for `set -e`Patrick Steinhardt, Apr 21, 2026
  86. 03/12 t: prepare `stop_git_daemon ()` for `set -e`Patrick Steinhardt, Apr 21, 2026
  87. 04/12 t: prepare `git config --unset` calls for `set -e`Patrick Steinhardt, Apr 21, 2026
  88. 05/12 t: prepare conditional test execution for `set -e`Patrick Steinhardt, Apr 21, 2026
  89. 06/12 t: prepare execution of potentially failing commands for `set -e`Patrick Steinhardt, Apr 21, 2026
  90. 07/12 t: prepare `test_when_finished ()`/`test_atexit()` for `set -e`Patrick Steinhardt, Apr 21, 2026
  91. 08/12 t0008: silence error in subshell when using `grep -v`Patrick Steinhardt, Apr 21, 2026
  92. 09/12 t1301: don't fail in case setfacl(1) doesn't exist or failsPatrick Steinhardt, Apr 21, 2026
  93. 10/12 t6002: fix use of `expr` with `set -e`Patrick Steinhardt, Apr 21, 2026
  94. 11/12 t9902: fix use of `read` with `set -e`Patrick Steinhardt, Apr 21, 2026
  95. 12/12 t: detect errors outside of test casesPatrick Steinhardt, Apr 21, 2026

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.