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

Re: [PATCH] test-lib: whitelist GIT_TR2_* in the environment

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Apr 10, 2019, 13:56 UTC
Message-ID
<37d2e724-8abe-962a-54f9-46cf67f2a3ce@jeffhostetler.com>
In-Reply-To
<20190330075119.13156-1-avarab@gmail.com>
On 3/30/2019 3:51 AM, Ævar Arnfjörð Bjarmason wrote:
Show 36 quoted lines
> Add GIT_TR2_* to the whitelist of environment variables that we don't
> clear when running the test suite.
> 
> This allows us to use the test suite to produce trace2 test data,
> which is handy to e.g. write consumers that collate the trace data
> itself.
> 
> One caveat here is that we produce trace output for not *just* the
> tests, but also e.g. from this line in test-lib.sh:
> 
>      # It appears that people try to run tests without building...
>      "${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X" >/dev/null
>      [...]
> 
> I consider this not just OK but a feature. Let's log *all* the git
> commands we're going to execute, not just those within
> test_expect_*().
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>   t/test-lib.sh | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 562c57e685..f6318c54c9 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -379,6 +379,7 @@ unset VISUAL EMAIL LANGUAGE COLUMNS $("$PERL_PATH" -e '
>   	my @env = keys %ENV;
>   	my $ok = join("|", qw(
>   		TRACE
> +		TR2_
>   		DEBUG
>   		TEST
>   		.*_TEST
> 

I could go either way on this one. It would be nice to have telemetry for all of the commands run by the suite (and especially for perf tests) for our developer analysis purposes. But if your settings have you route that data to a DB, your DBA might not be happy with you....

Jeff
Previous: Ævar Arnfjörð Bjarmason
Message 2 of 2 in “test-lib: whitelist GIT_TR2_* in the environment”
  1. test-lib: whitelist GIT_TR2_* in the environmentÆvar Arnfjörð Bjarmason, Mar 30, 2019
  2. Jeff HostetlerApr 10, 2019

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.