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

[PATCH v2 14/20] t9300: make the series Y tests self-contained

From
Karthik Nayak <karthik.188@gmail.com>
Date
Nov 12, 2026, 17:34 UTC
Message-ID
<20261112-kn-fast-import-tests-1-v2-14-b8c3a0ab27e8@gmail.com>
In-Reply-To
<20261112-kn-fast-import-tests-1-v2-0-b8c3a0ab27e8@gmail.com>

Similar to the previous commits, modify the 'series Y' tests to make them independent of state from previous tests.

The 'Y: setup' test only fills the OID cache for 'Y: rewrite submodules', so merge it into that test. Also clean up the repositories created by the tests.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 t/t9300-fast-import.sh | 40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 1022299b7d..7b755d8de1 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -4579,27 +4579,35 @@ cat >Y-marks <<\Y_INPUT_END
 :4 ff729f5e62f72c0c3978207d9a80e5f3a65f14d7
 Y_INPUT_END
 
-test_expect_success 'Y: setup' '
-	test_oid_cache <<-EOF
-	Ymain sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
-	Ymain sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
-	EOF
-'
-
 test_expect_success 'Y: rewrite-submodules-to feature forbidden by default' '
-	echo "feature rewrite-submodules-to=sub:sub2-marks" >input &&
-	test_must_fail git fast-import <input 2>err &&
-	test_grep "feature ${SQ}rewrite-submodules-to${SQ} forbidden in input without --allow-unsafe-features" err
+	test_when_finished "rm -rf repo" &&
+	git init repo &&
+	(
+		cd repo &&
+		echo "feature rewrite-submodules-to=sub:sub2-marks" >input &&
+		test_must_fail git fast-import <input 2>err &&
+		test_grep "feature ${SQ}rewrite-submodules-to${SQ} forbidden in input without --allow-unsafe-features" err
+	)
 '
 
 test_expect_success 'Y: rewrite-submodules-from feature forbidden by default' '
-	echo "feature rewrite-submodules-from=sub:../Y-marks" >input &&
-	test_must_fail git fast-import <input 2>err &&
-	test_grep "feature ${SQ}rewrite-submodules-from${SQ} forbidden in input without --allow-unsafe-features" err
+	test_when_finished "rm -rf repo" &&
+	git init repo &&
+	(
+		cd repo &&
+		echo "feature rewrite-submodules-from=sub:../Y-marks" >input &&
+		test_must_fail git fast-import <input 2>err &&
+		test_grep "feature ${SQ}rewrite-submodules-from${SQ} forbidden in input without --allow-unsafe-features" err
+	)
 '
 
 test_expect_success 'Y: rewrite submodules' '
 	test_when_finished "rm -rf main1" &&
+	test_oid_cache <<-EOF &&
+	Ymain sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
+	Ymain sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
+	EOF
+
 	git init main1 &&
 	(
 		cd main1 &&
@@ -4619,6 +4627,7 @@ test_expect_success 'Y: reference pending tag or commit' '
 	pending_tag sha256:85edc5eac315bc680677b2fc71622bd77476f057eb8dc8ed6a497803a24f1f46
 	EOF
 
+	test_when_finished "rm -rf reference-pending" &&
 	git init reference-pending &&
 	(
 		cd reference-pending &&
@@ -4656,6 +4665,11 @@ test_expect_success 'Y: reference pending tag or commit' '
 
 test_expect_success 'Y: rewrite submodules via stdin' '
 	test_when_finished "rm -rf main1" &&
+	test_oid_cache <<-EOF &&
+	Ymain sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
+	Ymain sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
+	EOF
+
 	git init main1 &&
 	(
 		cd main1 &&
-- 
2.56.GIT
Previous: Karthik NayakNext: Karthik Nayak
Message 39 of 45 in “t9300: group and move tests to other files”
  1. 00/20 t9300: group and move tests to other filesKarthik Nayak, Nov 10, 2026
  2. 01/20 t9300: move 'fastimport.unpackLimit' to the required testKarthik Nayak, Nov 10, 2026
  3. 02/20 t9300: make the series B tests self-containedKarthik Nayak, Nov 10, 2026
  4. 03/20 t9300: make the series T tests self-containedKarthik Nayak, Nov 10, 2026
  5. 04/20 t9300: make the series S tests self-containedKarthik Nayak, Nov 10, 2026
  6. 05/20 t9300: make the series V tests self-containedKarthik Nayak, Nov 10, 2026
  7. 06/20 t9300: make the series Q tests self-containedKarthik Nayak, Nov 10, 2026
  8. 07/20 t9300: make the series P tests self-containedKarthik Nayak, Nov 10, 2026
  9. 08/20 t9300: make the series O tests self-containedKarthik Nayak, Nov 10, 2026
  10. 09/20 t9300: make the big blob tests self-containedKarthik Nayak, Nov 10, 2026
  11. 10/20 t9300: make the ref update tests self-containedKarthik Nayak, Nov 10, 2026
  12. 11/20 t9300: make the date format tests self-containedKarthik Nayak, Nov 10, 2026
  13. 12/20 t9300: make the pack edges test self-containedKarthik Nayak, Nov 10, 2026
  14. 13/20 t9300: make the marks tests self-containedKarthik Nayak, Nov 10, 2026
  15. 14/20 t9300: make the series Y tests self-containedKarthik Nayak, Nov 10, 2026
  16. 15/20 t9300: make the cat-blob tests self-containedKarthik Nayak, Nov 10, 2026
  17. 16/20 t9300: make the feature and option tests self-containedKarthik Nayak, Nov 10, 2026
  18. 17/20 t9300: make the stream tests self-containedKarthik Nayak, Nov 10, 2026
  19. 18/20 t9300: make the get-mark and encoding tests self-containedKarthik Nayak, Nov 10, 2026
  20. 19/20 t9300: move self-contained tests into dedicated filesKarthik Nayak, Nov 10, 2026
  21. 20/20 t93xx: drop the series letter from the moved test namesKarthik Nayak, Nov 10, 2026
  22. Junio C HamanoNov 10, 2026
  23. Junio C HamanoNov 10, 2026
  24. Karthik NayakNov 11, 2026
  25. 00/20 t9300: group and move tests to other filesKarthik Nayak, Nov 12, 2026
  26. 01/20 t9300: move 'fastimport.unpackLimit' to the required testKarthik Nayak, Nov 12, 2026
  27. 02/20 t9300: make the series B tests self-containedKarthik Nayak, Nov 12, 2026
  28. 03/20 t9300: make the series T tests self-containedKarthik Nayak, Nov 12, 2026
  29. 04/20 t9300: make the series S tests self-containedKarthik Nayak, Nov 12, 2026
  30. 05/20 t9300: make the series V tests self-containedKarthik Nayak, Nov 12, 2026
  31. 06/20 t9300: make the series Q tests self-containedKarthik Nayak, Nov 12, 2026
  32. 07/20 t9300: make the series P tests self-containedKarthik Nayak, Nov 12, 2026
  33. 08/20 t9300: make the series O tests self-containedKarthik Nayak, Nov 12, 2026
  34. 09/20 t9300: make the big blob tests self-containedKarthik Nayak, Nov 12, 2026
  35. 10/20 t9300: make the ref update tests self-containedKarthik Nayak, Nov 12, 2026
  36. 11/20 t9300: make the date format tests self-containedKarthik Nayak, Nov 12, 2026
  37. 12/20 t9300: make the pack edges test self-containedKarthik Nayak, Nov 12, 2026
  38. 13/20 t9300: make the marks tests self-containedKarthik Nayak, Nov 12, 2026
  39. 14/20 t9300: make the series Y tests self-containedKarthik Nayak, Nov 12, 2026
  40. 15/20 t9300: make the cat-blob tests self-containedKarthik Nayak, Nov 12, 2026
  41. 16/20 t9300: make the feature and option tests self-containedKarthik Nayak, Nov 12, 2026
  42. 17/20 t9300: make the stream tests self-containedKarthik Nayak, Nov 12, 2026
  43. 18/20 t9300: make the get-mark and encoding tests self-containedKarthik Nayak, Nov 12, 2026
  44. 19/20 t9300: move self-contained tests into dedicated filesKarthik Nayak, Nov 12, 2026
  45. 20/20 t93xx: drop the series letter from the moved test namesKarthik Nayak, Nov 12, 2026

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.