git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] test-lib: whitelist GIT_TR2_* in the environment
@ 2019-03-30  7:51 Ævar Arnfjörð Bjarmason
  2019-04-10 13:56 ` Jeff Hostetler
  0 siblings, 1 reply; 2+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2019-03-30  7:51 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff Hostetler, Ævar Arnfjörð Bjarmason

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
-- 
2.21.0.392.gf8f6787159e


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] test-lib: whitelist GIT_TR2_* in the environment
  2019-03-30  7:51 [PATCH] test-lib: whitelist GIT_TR2_* in the environment Ævar Arnfjörð Bjarmason
@ 2019-04-10 13:56 ` Jeff Hostetler
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Hostetler @ 2019-04-10 13:56 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason, git
  Cc: Junio C Hamano, Jeff Hostetler



On 3/30/2019 3:51 AM, Ævar Arnfjörð Bjarmason wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-10 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-30  7:51 [PATCH] test-lib: whitelist GIT_TR2_* in the environment Ævar Arnfjörð Bjarmason
2019-04-10 13:56 ` Jeff Hostetler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).