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

Re: [PATCH 2/3] submodule tests: reset "trace.out" between "grep" invocations

From
Taylor Blau <me@ttaylorr.com>
Date
Oct 29, 2022, 20:13 UTC
Message-ID
<Y12JfADN/YRr9IaJ@nand.local>
In-Reply-To
<patch-2.3-708375e3104-20221029T025520Z-avarab@gmail.com>
On Sat, Oct 29, 2022 at 04:59:46AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 17 quoted lines
> diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
> index 75da8acf8f4..b9546ef8e5e 100755
> --- a/t/t5526-fetch-submodules.sh
> +++ b/t/t5526-fetch-submodules.sh
> @@ -178,6 +178,7 @@ test_expect_success "submodule.recurse option triggers recursive fetch" '
>  '
>
>  test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
> +	test_when_finished "rm -f trace.out" &&
>  	add_submodule_commits &&
>  	(
>  		cd downstream &&
> @@ -705,15 +706,22 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
>
>  test_expect_success 'fetching submodules respects parallel settings' '
>  	git config fetch.recurseSubmodules true &&
> +	test_when_finished "rm -f downstream/trace.out" &&
These two seem OK to me, but...
Show 6 quoted lines
>  	(
>  		cd downstream &&
>  		GIT_TRACE=$(pwd)/trace.out git fetch &&
>  		grep "1 tasks" trace.out &&
> +		>trace.out &&
> +

I fail to see why these hunks are necessary. If we specify GIT_TRACE, and don't have a test_must_fail around the execution, then why should we feel obligated to clean up the trace.out after every execution?

If we really are concerned about not cleaning up after ourselves, how about writing to a separate file each time?

Thanks, Taylor

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 7 of 11 in “tests: improve misc run-command, hook, submodule tests”
  1. 0/3 tests: improve misc run-command, hook, submodule testsÆvar Arnfjörð Bjarmason, Oct 29, 2022
  2. 1/3 hook tests: fix redirection logic error in 96e7225b310Ævar Arnfjörð Bjarmason, Oct 29, 2022
  3. Taylor BlauOct 29, 2022
  4. Ævar Arnfjörð BjarmasonOct 31, 2022
  5. Taylor BlauOct 31, 2022
  6. 2/3 submodule tests: reset "trace.out" between "grep" invocationsÆvar Arnfjörð Bjarmason, Oct 29, 2022
  7. Taylor BlauOct 29, 2022
  8. Ævar Arnfjörð BjarmasonOct 31, 2022
  9. Taylor BlauOct 31, 2022
  10. 3/3 run-command tests: test stdout of run_command_parallel()Ævar Arnfjörð Bjarmason, Oct 29, 2022
  11. Taylor BlauOct 29, 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.