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

[PATCH 4/5] test-lib: add more exhaustive GIT_SKIP_TESTS testing

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 27, 2018, 22:54 UTC
Message-ID
<20181127225445.30045-4-avarab@gmail.com>
In-Reply-To
<20181127225445.30045-1-avarab@gmail.com>

Add a test for the when GIT_SKIP_TESTS is used to skip entire test files. Support for this was added back in 04ece59399 ("GIT_SKIP_TESTS: allow users to omit tests that are known to break", 2006-12-28), but never tested for.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t0000-basic.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index b6566003dd..b87a8f18c2 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -393,6 +393,23 @@ test_expect_success 'GIT_SKIP_TESTS sh pattern' "
 	)
 "
 
+test_expect_success 'GIT_SKIP_TESTS entire file' "
+	(
+		GIT_SKIP_TESTS='git' && export GIT_SKIP_TESTS &&
+		run_sub_test_lib_test git-skip-tests-entire-file \
+			'GIT_SKIP_TESTS' <<-\\EOF &&
+		for i in 1 2 3
+		do
+			test_expect_success \"passing test #\$i\" 'true'
+		done
+		test_done
+		EOF
+		check_sub_test_lib_test git-skip-tests-entire-file <<-\\EOF
+		1..0 # SKIP skip all tests in git
+		EOF
+	)
+"
+
 test_expect_success '--run basic' "
 	run_sub_test_lib_test run-basic \
 		'--run basic' --run='1 3 5' <<-\\EOF &&
-- 
2.20.0.rc1.379.g1dd7ef354c
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 3 of 7 in “t/README: make the 'Skipping tests' section less confusing”
  1. 1/5 t/README: make the 'Skipping tests' section less confusingÆvar Arnfjörð Bjarmason, Nov 27, 2018
  2. 3/5 t/README: re-flow a paragraphÆvar Arnfjörð Bjarmason, Nov 27, 2018
  3. 4/5 test-lib: add more exhaustive GIT_SKIP_TESTS testingÆvar Arnfjörð Bjarmason, Nov 27, 2018
  4. 5/5 test-lib: add support for GIT_TODO_TESTSÆvar Arnfjörð Bjarmason, Nov 27, 2018
  5. Junio C HamanoNov 29, 2018
  6. SZEDER GáborDec 4, 2018
  7. 2/5 t/README: modernize description of GIT_SKIP_TESTSÆvar Arnfjörð Bjarmason, Nov 27, 2018

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.