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

Re: [PATCH 3/3] [RFC] test_todo: allow [verbose] test as the command

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 6, 2022, 16:02 UTC
Message-ID
<221006.86zge9q6js.gmgdl@evledraar.gmail.com>
In-Reply-To
<c0d955c2d1fa234ad2e4a8aad467b991030ccf47.1665068476.git.gitgitgadget@gmail.com>
On Thu, Oct 06 2022, Phillip Wood via GitGitGadget wrote:
Show 13 quoted lines
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> For simplicity test_todo() allows verbose to precede any valid
> command.  As POSIX specifies that a return code greater than one is an
> error rather than a failed test we take care not to hide that.
>
> I'm in two minds about this patch. Generally it is better to use one
> of our test helpers such as test_cmp() rather than calling test
> directly.  There are so few instances of test being used within
> test_expect_failure() (the conversions here are not exhaustive but
> there are not many more) that it would probably be better to convert
> the tests by using the appropriate helper rather than supporting
> calling test as the command to test_todo().

I think that we might want to salvage parts of this, but we really shouldn't be spending review time on carrying forward a bad pattern that hides segfaults.

I.e. whatever we do about "test_todo"'s interaction with "test" let's first change things like...

Show 11 quoted lines
> -test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
> +test_expect_success CASE_INSENSITIVE_FS 'add (with different case)' '
>  	git reset --hard initial &&
>  	rm camelcase &&
>  	echo 1 >CamelCase &&
> @@ -108,7 +108,7 @@ test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
>  	git ls-files >tmp &&
>  	camel=$(grep -i camelcase tmp) &&
>  	test $(echo "$camel" | wc -l) = 1 &&
> -	test "z$(git cat-file blob :$camel)" = z1
> +	test_todo test "z$(git cat-file blob :$camel)" = z1
...this to e.g.:
	echo z1 >expect &&
	git cat-file blob :$camel >actual &&
	test_cmp expect actual

Or whatever, then let's see if migrating "verbose" is worthwhile, in the post-image you end up with no real users of it, only your tests.

I've wanted to just remove it for a while, all its users seem to be either bad uses like that, or we'd get much better bang for the buck out of it by having a t/verbose-bin/ or whatever, which would just wrap arbitrary commands like "grep" and the like (i.e. ones where we could provide useful context).

Previous: Phillip Wood via GitGitGadgetNext: Junio C Hamano
Message 16 of 20 in “[RFC] tests: add test_todo() for known failures”
  1. 0/3 [RFC] tests: add test_todo() for known failuresPhillip Wood via GitGitGadget, Oct 6, 2022
  2. 1/3 [RFC] tests: add test_todo() to mark known breakagesPhillip Wood via GitGitGadget, Oct 6, 2022
  3. Ævar Arnfjörð BjarmasonOct 6, 2022
  4. Phillip WoodOct 6, 2022
  5. Ævar Arnfjörð BjarmasonOct 6, 2022
  6. Victoria DyeDec 6, 2022
  7. Ævar Arnfjörð BjarmasonDec 7, 2022
  8. Phillip WoodDec 8, 2022
  9. Junio C HamanoDec 9, 2022
  10. Phillip WoodDec 9, 2022
  11. 2/3 [RFC] test_todo: allow [!] grep as the commandPhillip Wood via GitGitGadget, Oct 6, 2022
  12. Ævar Arnfjörð BjarmasonOct 6, 2022
  13. Phillip WoodOct 6, 2022
  14. Ævar Arnfjörð BjarmasonOct 6, 2022
  15. 3/3 [RFC] test_todo: allow [verbose] test as the commandPhillip Wood via GitGitGadget, Oct 6, 2022
  16. Ævar Arnfjörð BjarmasonOct 6, 2022
  17. Junio C HamanoOct 6, 2022
  18. Ævar Arnfjörð BjarmasonOct 6, 2022
  19. Phillip WoodOct 7, 2022
  20. Junio C HamanoOct 7, 2022

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.