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

[PATCH 02/10] t/perf/fsmonitor: move watchman setup to one-time-repo-setup

From
Nipunn Koorapati via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 26, 2020, 19:32 UTC
Message-ID
<34d11447b46b06ae5f4fa8700885bcc8b70a3a43.1603740773.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.772.git.1603740773.gitgitgadget@gmail.com>
From: Nipunn Koorapati <nipunn@dropbox.com>

It is only required to be set up once. This prepares for testing multiple hooks in one invocation.

Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com>
---
 t/perf/p7519-fsmonitor.sh | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh
index 23755012df..4030f569cf 100755
--- a/t/perf/p7519-fsmonitor.sh
+++ b/t/perf/p7519-fsmonitor.sh
@@ -94,7 +94,13 @@ test_expect_success "one time repo setup" '
 	for i in $(test_seq 1 1000); do touch 1000_files/$i; done &&
 	for i in $(test_seq 1 10000); do touch 10000_files/$i; done &&
 	git add 1_file 10_files 100_files 1000_files 10000_files &&
-	git commit -m "Add files"
+	git commit -m "Add files" &&
+
+	# If Watchman exists, watch the work tree and attempt a query.
+	if test_have_prereq WATCHMAN; then
+		watchman watch "$GIT_WORK_TREE" &&
+		watchman watch-list | grep -q -F "$GIT_WORK_TREE"
+	fi
 '
 
 test_expect_success "setup for fsmonitor" '
@@ -105,17 +111,13 @@ test_expect_success "setup for fsmonitor" '
 	else
 		#
 		# Choose integration script based on existence of Watchman.
-		# If Watchman exists, watch the work tree and attempt a query.
-		# If everything succeeds, use Watchman integration script,
-		# else fall back to an empty integration script.
+		# Fall back to an empty integration script.
 		#
 		mkdir .git/hooks &&
 		if test_have_prereq WATCHMAN
 		then
 			INTEGRATION_SCRIPT=".git/hooks/fsmonitor-watchman" &&
-			cp "$TEST_DIRECTORY/../templates/hooks--fsmonitor-watchman.sample" "$INTEGRATION_SCRIPT" &&
-			watchman watch "$GIT_WORK_TREE" &&
-			watchman watch-list | grep -q -F "$GIT_WORK_TREE"
+			cp "$TEST_DIRECTORY/../templates/hooks--fsmonitor-watchman.sample" "$INTEGRATION_SCRIPT"
 		else
 			INTEGRATION_SCRIPT=".git/hooks/fsmonitor-empty" &&
 			write_script "$INTEGRATION_SCRIPT"<<-\EOF
-- 
gitgitgadget
Previous: Nipunn Koorapati via GitGitGadgetNext: Nipunn Koorapati via GitGitGadget
Message 10 of 13 in “Update fsmonitor perf suite to support integration comparisons”
  1. 00/10 Update fsmonitor perf suite to support integration comparisonsNipunn Koorapati via GitGitGadget, Oct 26, 2020
  2. 03/10 t/perf/fsmonitor: improve error message if typoing hook nameNipunn Koorapati via GitGitGadget, Oct 26, 2020
  3. Junio C HamanoOct 26, 2020
  4. Nipunn KoorapatiOct 26, 2020
  5. 06/10 t/perf/fsmonitor: silence initial git commitNipunn Koorapati via GitGitGadget, Oct 26, 2020
  6. 07/10 t/perf/fsmonitor: factor setup for fsmonitor into functionNipunn Koorapati via GitGitGadget, Oct 26, 2020
  7. 08/10 t/perf/fsmonitor: initialize test with git resetNipunn Koorapati via GitGitGadget, Oct 26, 2020
  8. 10/10 t/perf/fsmonitor: add benchmark for dirty statusNipunn Koorapati via GitGitGadget, Oct 26, 2020
  9. 09/10 t/perf/fsmonitor: perf comparison of multiple fsmonitor integrationsNipunn Koorapati via GitGitGadget, Oct 26, 2020
  10. 02/10 t/perf/fsmonitor: move watchman setup to one-time-repo-setupNipunn Koorapati via GitGitGadget, Oct 26, 2020
  11. 05/10 t/perf/fsmonitor: shorten DESC to basenameNipunn Koorapati via GitGitGadget, Oct 26, 2020
  12. 04/10 t/perf/fsmonitor: factor description out for readabilityNipunn Koorapati via GitGitGadget, Oct 26, 2020
  13. 01/10 t/perf/fsmonitor: separate one time repo initializationNipunn Koorapati via GitGitGadget, Oct 26, 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.