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

[PATCH 2/2] t6500: mark tests as SHA1 reliant

From
Stefan Beller <sbeller@google.com>
Date
Jul 28, 2017, 17:18 UTC
Message-ID
<20170728171817.21458-3-sbeller@google.com>
In-Reply-To
<20170728171817.21458-1-sbeller@google.com>
The first test marked relies on hard coded sha1:
	# We need to create two object whose sha1s start with 17
	# since this is what git gc counts.  As it happens, these
	# two blobs will do so.
	test_commit 263 &&
	test_commit 410 &&

The next two seem to rely on state from the first one, I did not investigate.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t6500-gc.sh | 6 +++---
 t/test-lib.sh | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index 41b0be575d..3900baa01d 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -43,7 +43,7 @@ test_expect_success 'gc is not aborted due to a stale symref' '
 	)
 '
 
-test_expect_success 'auto gc with too many loose objects does not attempt to create bitmaps' '
+test_expect_success SHA1 'auto gc with too many loose objects does not attempt to create bitmaps' '
 	test_config gc.auto 3 &&
 	test_config gc.autodetach false &&
 	test_config pack.writebitmaps true &&
@@ -77,7 +77,7 @@ run_and_wait_for_auto_gc () {
 	doesnt_matter=$(git gc --auto 9>&1)
 }
 
-test_expect_success 'background auto gc does not run if gc.log is present and recent but does if it is old' '
+test_expect_success SHA1 'background auto gc does not run if gc.log is present and recent but does if it is old' '
 	test_commit foo &&
 	test_commit bar &&
 	git repack &&
@@ -95,7 +95,7 @@ test_expect_success 'background auto gc does not run if gc.log is present and re
 	test_line_count = 1 packs
 '
 
-test_expect_success 'background auto gc respects lock for all operations' '
+test_expect_success SHA1 'background auto gc respects lock for all operations' '
 	# make sure we run a background auto-gc
 	test_commit make-pack &&
 	git repack &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1b6e53f78a..a5a54c6d4a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1127,6 +1127,10 @@ test_lazy_prereq JGIT '
 	type jgit
 '
 
+test_lazy_prereq SHA1 '
+	false
+'
+
 # SANITY is about "can you correctly predict what the filesystem would
 # do by only looking at the permission bits of the files and
 # directories?"  A typical example of !SANITY is running the test
-- 
2.14.0.rc0.3.g6c2e499285
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 15 in “How to migrate our test infrastructure away from sha1”
  1. 0/2 How to migrate our test infrastructure away from sha1Stefan Beller, Jul 28, 2017
  2. 1/2 alter hash function: expose test dependencies on sha1Stefan Beller, Jul 28, 2017
  3. Junio C HamanoJul 28, 2017
  4. 2/2 t6500: mark tests as SHA1 reliantStefan Beller, Jul 28, 2017
  5. Junio C HamanoJul 28, 2017
  6. Stefan BellerJul 28, 2017
  7. Junio C HamanoJul 28, 2017
  8. brian m. carlsonJul 29, 2017
  9. Junio C HamanoJul 30, 2017
  10. brian m. carlsonJul 30, 2017
  11. brian m. carlsonJul 30, 2017
  12. Ævar Arnfjörð BjarmasonJul 31, 2017
  13. Stefan BellerJul 31, 2017
  14. Stefan BellerJul 31, 2017
  15. brian m. carlsonJul 31, 2017

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.