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

Re: [PATCH 0/4] meson: parse TAP output generated by our tests

From
Patrick Steinhardt <ps@pks.im>
Date
May 28, 2025, 12:27 UTC
Message-ID
<aDcBGIW2dxWxZ2l4@pks.im>
In-Reply-To
<xmqq34cqqbtk.fsf@gitster.g>
On Tue, May 27, 2025 at 09:04:55AM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> >> > I don't think it's inherently a bad thing to fail on unexpected passes.
> >> > After all, it shows that our assumption that the test fails is broken,
> >> > and that we should have a look why that is. But I can see arguments both
> >> > ways.
> >> 
> >> As Phillip noted, treating them as ordinary passes undermines the reason
> >> for having them.
> >
> > Yup, and I tend to agree.
> 
> OK.  So perhaps Make-driven CI jobs also follow suit?  In the same
> run that osx-meson job failed, osx-gcc job notices a passed TODO and
> happily declares "All tests successful.".
> 
> https://github.com/git/git/actions/runs/15221271947/job/42817168362#step:4:1933

prove itself doesn't treat unexpected passes as errors, and I couldn't find an option to adapt it. We can do something like the below patch, which makes us fail in case there are any fixed tests. The only downside is that prove will report test failures like this:

    t1400-update-ref.sh ................................ Dubious, test returned 1 (wstat 256, 0x100)
    All 299 subtests passed
        (1 TODO test unexpectedly succeeded)

It's not great because prove reports it as dubious. But it isn't all that bad either because we directly mention the unexpected success for one of the tests.

Patrick
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 16b785f3b91..2b63e1c86ca 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -130,7 +130,7 @@ test_expect_success 'subtest: a failing TODO test' '
 '
 
 test_expect_success 'subtest: a passing TODO test' '
-	write_and_run_sub_test_lib_test passing-todo <<-\EOF &&
+	write_and_run_sub_test_lib_test_err passing-todo <<-\EOF &&
 	test_expect_failure "pretend we have fixed a known breakage" "true"
 	test_done
 	EOF
@@ -142,7 +142,7 @@ test_expect_success 'subtest: a passing TODO test' '
 '
 
 test_expect_success 'subtest: 2 TODO tests, one passin' '
-	write_and_run_sub_test_lib_test partially-passing-todos <<-\EOF &&
+	write_and_run_sub_test_lib_test_err partially-passing-todos <<-\EOF &&
 	test_expect_failure "pretend we have a known breakage" "false"
 	test_expect_success "pretend we have a passing test" "true"
 	test_expect_failure "pretend we have fixed another known breakage" "true"
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0a124ffad38..5352209d3e4 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1272,7 +1272,14 @@ test_done () {
 
 		check_test_results_san_file_ "$test_failure"
 
-		if test -z "$skip_all" && test -n "$invert_exit_code"
+		if test "$test_fixed" != 0
+		then
+			if test -z "$invert_exit_code"
+			then
+				GIT_EXIT_OK=t
+				exit 1
+			fi
+		elif test -z "$skip_all" && test -n "$invert_exit_code"
 		then
 			say_color warn "# faking up non-zero exit with --invert-exit-code"
 			GIT_EXIT_OK=t
Previous: Junio C HamanoNext: Junio C Hamano
Message 32 of 79 in “meson: parse TAP output generated by our tests”
  1. 0/4 meson: parse TAP output generated by our testsPatrick Steinhardt, May 6, 2025
  2. 1/4 t: fix cases where output breaks TAP formatPatrick Steinhardt, May 6, 2025
  3. Phillip WoodMay 6, 2025
  4. Patrick SteinhardtMay 7, 2025
  5. Phillip WoodMay 7, 2025
  6. Karthik NayakMay 14, 2025
  7. 2/4 t/test-lib: don't print shell traces to stdoutPatrick Steinhardt, May 6, 2025
  8. 3/4 meson: introduce kwargs variable for testsPatrick Steinhardt, May 6, 2025
  9. Karthik NayakMay 15, 2025
  10. 4/4 meson: parse TAP output generated by our testsPatrick Steinhardt, May 6, 2025
  11. Karthik NayakMay 15, 2025
  12. Patrick SteinhardtMay 15, 2025
  13. Karthik NayakMay 15, 2025
  14. Patrick SteinhardtMay 6, 2025
  15. Patrick SteinhardtMay 7, 2025
  16. Patrick SteinhardtMay 21, 2025
  17. Hridoy AhmedMay 21, 2025
  18. Junio C HamanoMay 21, 2025
  19. Junio C HamanoMay 21, 2025
  20. Patrick SteinhardtMay 23, 2025
  21. Patrick SteinhardtMay 23, 2025
  22. Junio C HamanoMay 23, 2025
  23. Ramsay JonesMay 23, 2025
  24. Ramsay JonesMay 23, 2025
  25. Junio C HamanoMay 23, 2025
  26. Patrick SteinhardtMay 26, 2025
  27. Phillip WoodMay 26, 2025
  28. Todd ZullingerMay 26, 2025
  29. Eli SchwartzMay 26, 2025
  30. Patrick SteinhardtMay 26, 2025
  31. Junio C HamanoMay 27, 2025
  32. Patrick SteinhardtMay 28, 2025
  33. Junio C HamanoMay 27, 2025
  34. 0/6 meson: parse TAP output generated by our testsPatrick Steinhardt, May 27, 2025
  35. 1/6 t: fix cases where output breaks TAP formatPatrick Steinhardt, May 27, 2025
  36. Eric SunshineMay 27, 2025
  37. Patrick SteinhardtMay 28, 2025
  38. Eric SunshineMay 28, 2025
  39. Patrick SteinhardtMay 30, 2025
  40. 2/6 t/test-lib: don't print shell traces to stdoutPatrick Steinhardt, May 27, 2025
  41. Junio C HamanoMay 27, 2025
  42. Patrick SteinhardtMay 28, 2025
  43. 3/6 t/test-lib: fix TAP format for BASH_XTRACEFD warningPatrick Steinhardt, May 27, 2025
  44. 4/6 t7815: fix unexpectedly passing test on macOSPatrick Steinhardt, May 27, 2025
  45. 6/6 meson: parse TAP output generated by our testsPatrick Steinhardt, May 27, 2025
  46. 5/6 meson: introduce kwargs variable for testsPatrick Steinhardt, May 27, 2025
  47. 00/10 meson: parse TAP output generated by our testsPatrick Steinhardt, May 30, 2025
  48. 01/10 t: stop announcing prereqsPatrick Steinhardt, May 30, 2025
  49. Karthik NayakMay 31, 2025
  50. 03/10 t9822: use prereq to check for ISO-8859-1 supportPatrick Steinhardt, May 30, 2025
  51. 02/10 t: silence output from `test_create_repo()`Patrick Steinhardt, May 30, 2025
  52. Eric SunshineMay 30, 2025
  53. 04/10 t983*: use prereq to check for Python-specific git-b4(1) supportPatrick Steinhardt, May 30, 2025
  54. Todd ZullingerMay 30, 2025
  55. Patrick SteinhardtMay 30, 2025
  56. 05/10 t/test-lib: don't print shell traces to stdoutPatrick Steinhardt, May 30, 2025
  57. Karthik NayakMay 31, 2025
  58. 06/10 t/test-lib: fix TAP format for BASH_XTRACEFD warningPatrick Steinhardt, May 30, 2025
  59. Karthik NayakMay 31, 2025
  60. 07/10 t7815: fix unexpectedly passing test on macOSPatrick Steinhardt, May 30, 2025
  61. Karthik NayakMay 31, 2025
  62. Kristoffer HaugsbakkJun 1, 2025
  63. Patrick SteinhardtJun 2, 2025
  64. 08/10 test-lib: fail on unexpectedly passing testsPatrick Steinhardt, May 30, 2025
  65. 09/10 meson: introduce kwargs variable for testsPatrick Steinhardt, May 30, 2025
  66. 10/10 meson: parse TAP output generated by our testsPatrick Steinhardt, May 30, 2025
  67. Karthik NayakMay 31, 2025
  68. 00/10 meson: parse TAP output generated by our testsPatrick Steinhardt, Jun 2, 2025
  69. 01/10 t: stop announcing prereqsPatrick Steinhardt, Jun 2, 2025
  70. 02/10 t: silence output from `test_create_repo()`Patrick Steinhardt, Jun 2, 2025
  71. 03/10 t9822: use prereq to check for ISO-8859-1 supportPatrick Steinhardt, Jun 2, 2025
  72. 04/10 t983*: use prereq to check for Python-specific git-p4(1) supportPatrick Steinhardt, Jun 2, 2025
  73. 06/10 t/test-lib: fix TAP format for BASH_XTRACEFD warningPatrick Steinhardt, Jun 2, 2025
  74. 05/10 t/test-lib: don't print shell traces to stdoutPatrick Steinhardt, Jun 2, 2025
  75. 08/10 test-lib: fail on unexpectedly passing testsPatrick Steinhardt, Jun 2, 2025
  76. 07/10 t7815: fix unexpectedly passing test on macOSPatrick Steinhardt, Jun 2, 2025
  77. 09/10 meson: introduce kwargs variable for testsPatrick Steinhardt, Jun 2, 2025
  78. 10/10 meson: parse TAP output generated by our testsPatrick Steinhardt, Jun 2, 2025
  79. Karthik NayakJun 2, 2025

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.