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

[PATCH 3/3] t7900-maintenance: test for magic markers

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Dec 21, 2020, 21:26 UTC
Message-ID
<938ac9a831bacd70e3c3ab7756ed98afa6338554.1608585497.git.martin.agren@gmail.com>
In-Reply-To
<cover.1608585497.git.martin.agren@gmail.com>

When we insert our "BEGIN" and "END" markers into the cron table, it's so that a Git version from many years into the future would be able to identify this region in the cron table. Let's add a test to make sure that these markers don't ever change.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 t/t7900-maintenance.sh | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 4bbfce31e9..99bf0c7582 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -446,6 +446,15 @@ test_expect_success 'start preserves existing schedule' '
 	grep "Important information!" cron.txt
 '
 
+test_expect_success 'magic markers are correct' '
+	grep "GIT MAINTENANCE SCHEDULE" cron.txt >actual &&
+	cat >expect <<-\EOF &&
+	# BEGIN GIT MAINTENANCE SCHEDULE
+	# END GIT MAINTENANCE SCHEDULE
+	EOF
+	test_cmp actual expect
+'
+
 test_expect_success 'stop preserves surrounding schedule' '
 	echo "Crucial information!" >>cron.txt &&
 	GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance stop &&
-- 
2.30.0.rc1
Previous: Martin ÅgrenNext: Martin Ågren
Message 3 of 10 in “gc: fix handling of crontab magic markers”
  1. 0/3 gc: fix handling of crontab magic markersMartin Ågren, Dec 21, 2020
  2. 1/3 git-maintenance.txt: add missing wordMartin Ågren, Dec 21, 2020
  3. 3/3 t7900-maintenance: test for magic markersMartin Ågren, Dec 21, 2020
  4. 2/3 gc: fix handling of crontab magic markersMartin Ågren, Dec 21, 2020
  5. Junio C HamanoDec 22, 2020
  6. Junio C HamanoDec 22, 2020
  7. Eric SunshineDec 23, 2020
  8. Martin ÅgrenDec 23, 2020
  9. Junio C HamanoDec 23, 2020
  10. Derrick StoleeDec 21, 2020

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.