git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests: fix overeager scrubbing of environment variables
@ 2011-03-27 21:22 Jens Lehmann
  2011-03-27 21:37 ` Jonathan Nieder
  0 siblings, 1 reply; 10+ messages in thread
From: Jens Lehmann @ 2011-03-27 21:22 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List, Jonathan Nieder

In commit 95a1d12e9b9f ("tests: scrub environment of GIT_* variables") all
environment variables starting with "GIT_" were unset for the tests using
a perl script rather than unsetting them one by one. Only three exceptions
were made to make them work as before: "GIT_TRACE*", "GIT_DEBUG*" and
"GIT_USE_LOOKUP".

Unfortunately some environment variables used by the test framework itself
were not added to the exceptions and thus stopped working when given
before the make command instead of after it. Those are:

- GIT_SKIP_TESTS

- GIT_TEST*

- GIT_PROVE_OPTS

Let's fix that by adding them to the exception list.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---

I noticed today that skipping a test the way I was used to suddenly failed:

GIT_SKIP_TESTS='t1234' GIT_TEST_OPTS='--root=/dev/shm' make -j10 test

This should work according to t/README, but didn't anymore.

 t/test-lib.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 7cc9a52..4a8c443 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -46,7 +46,7 @@ unset VISUAL
 unset EMAIL
 unset $(perl -e '
 	my @env = keys %ENV;
-	my @vars = grep(/^GIT_/ && !/^GIT_(TRACE|DEBUG|USE_LOOKUP)/, @env);
+	my @vars = grep(/^GIT_/ && !/^GIT_(TRACE|DEBUG|USE_LOOKUP|SKIP_TESTS|TEST|PROVE_OPTS)/, @env);
 	print join("\n", @vars);
 ')
 GIT_AUTHOR_EMAIL=author@example.com
-- 
1.7.4.2.407.gac78c

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

end of thread, other threads:[~2011-03-28 21:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-27 21:22 [PATCH] tests: fix overeager scrubbing of environment variables Jens Lehmann
2011-03-27 21:37 ` Jonathan Nieder
2011-03-27 22:17   ` [PATCH] squash! " Jonathan Nieder
2011-03-28 13:58     ` Jeff King
2011-03-27 22:26   ` [PATCH v2] " Jens Lehmann
2011-03-27 23:00     ` [PATCH/RFC] tests: use the --long-tests facility to toggle some slow tests Jonathan Nieder
2011-03-28 17:00   ` [PATCH] tests: fix overeager scrubbing of environment variables Junio C Hamano
2011-03-28 19:16     ` [PATCH v3] " Jens Lehmann
2011-03-28 19:37       ` Jonathan Nieder
2011-03-28 21:03         ` Junio C Hamano

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).