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

Re: [PATCH v3 1/3] t0021: avoid grepping for a Perl-specific string at filter output

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 1, 2022, 20:41 UTC
Message-ID
<xmqqr11zpuhr.fsf@gitster.g>
In-Reply-To
<5ec95c7e696a49104322d243bee1d5f137bc8222.1659291025.git.matheus.bernardino@usp.br>
Matheus Tavares <matheus.bernardino@usp.br> writes:
Show 8 quoted lines
> This test sets the t0021/rot13-filter.pl script as a long-running
> process filter for a git checkout command. It then expects the filter to
> fail producing a specific error message at stderr. In the following
> commits we are going to replace the script with a C test-tool helper,
> but the test currently expects the error message in a Perl-specific
> format. That is, when you call `die <msg>` in Perl, it emits
> "<msg> at - line 1." In preparation for the conversion, let's avoid the
> Perl-specific part and only grep for <msg> itself.

Sounds sane. I am a bit surprised that we check for messages from the external filter tool, actually, rather than messages we would emit in response to an error by the filter tool, which ought to be more stable no matter how the external tool expresses its failures.

But the posted change gets the job done perfectly fine, so it is OK.
Thanks.
Show 18 quoted lines
> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
> ---
>  t/t0021-conversion.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
> index 1c840348bd..963b66e08c 100755
> --- a/t/t0021-conversion.sh
> +++ b/t/t0021-conversion.sh
> @@ -735,7 +735,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f
>  		rm -f debug.log &&
>  		git checkout --quiet --no-progress . 2>git-stderr.log &&
>  
> -		grep "smudge write error at" git-stderr.log &&
> +		grep "smudge write error" git-stderr.log &&
>  		test_i18ngrep "error: external filter" git-stderr.log &&
>  
>  		cat >expected.log <<-EOF &&
Previous: Matheus TavaresNext: Matheus Tavares
Message 15 of 28 in “t0021: convert perl script to C test-tool helper”
  1. 0/2 t0021: convert perl script to C test-tool helperMatheus Tavares, Jul 22, 2022
  2. 2/2 t/t0021: replace old rot13-filter.pl uses with new test-tool cmdMatheus Tavares, Jul 22, 2022
  3. 1/2 t/t0021: convert the rot13-filter.pl script to CMatheus Tavares, Jul 22, 2022
  4. Ævar Arnfjörð BjarmasonJul 23, 2022
  5. Ævar Arnfjörð BjarmasonJul 23, 2022
  6. Matheus TavaresJul 23, 2022
  7. t/t0021: convert the rot13-filter.pl script to CMatheus Tavares, Jul 24, 2022
  8. Johannes SchindelinJul 28, 2022
  9. Junio C HamanoJul 28, 2022
  10. Ævar Arnfjörð BjarmasonJul 28, 2022
  11. Matheus TavaresJul 31, 2022
  12. Johannes SchindelinAug 9, 2022
  13. 0/3 t0021: convert perl script to C test-tool helperMatheus Tavares, Jul 31, 2022
  14. 1/3 t0021: avoid grepping for a Perl-specific string at filter outputMatheus Tavares, Jul 31, 2022
  15. Junio C HamanoAug 1, 2022
  16. 2/3 t0021: implementation the rot13-filter.pl script in CMatheus Tavares, Jul 31, 2022
  17. Ævar Arnfjörð BjarmasonAug 1, 2022
  18. Matheus TavaresAug 2, 2022
  19. Johannes SchindelinAug 9, 2022
  20. Ævar Arnfjörð BjarmasonAug 1, 2022
  21. Junio C HamanoAug 1, 2022
  22. Matheus TavaresAug 2, 2022
  23. Johannes SchindelinAug 9, 2022
  24. Junio C HamanoAug 10, 2022
  25. Junio C HamanoAug 10, 2022
  26. Johannes SchindelinAug 9, 2022
  27. Johannes SchindelinAug 9, 2022
  28. 3/3 tests: use the new C rot13-filter helper to avoid PERL prereqMatheus Tavares, Jul 31, 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.