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

[PATCH 1/3] t7900: fix test failures when invoked individually via --run

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Nov 27, 2020, 07:50 UTC
Message-ID
<20201127075054.31174-2-sunshine@sunshineco.com>
In-Reply-To
<20201127075054.31174-1-sunshine@sunshineco.com>

A couple tests use `rm expect` to remove a file created by earlier tests. The presence of this file is immaterial at the point the attempt is made to remove it, yet if it doesn't exist, the test fails unnecessarily. One case in which the file may validly not exist is when --run or GIT_SKIP_TESTS is used to selectively run particular tests. Fix these pointless failures.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---
 t/t7900-maintenance.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 0246e4ce30..ef3aec3253 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -429,7 +429,7 @@ test_expect_success !MINGW 'start and stop macOS maintenance' '
 	EOF
 	test_cmp expect actual &&
 
-	rm expect &&
+	rm -f expect &&
 	for frequency in hourly daily weekly
 	do
 		PLIST="$HOME/Library/LaunchAgents/org.git-scm.git.$frequency.plist" &&
@@ -491,7 +491,6 @@ test_expect_success 'start and stop Windows maintenance' '
 	# stop does not unregister the repo
 	git config --get --global maintenance.repo "$(pwd)" &&
 
-	rm expect &&
 	printf "/delete /tn Git Maintenance (%s) /f\n" \
 		hourly daily weekly >expect &&
 	test_cmp expect args
-- 
2.29.2.576.ga3fc446d84
Previous: Eric SunshineNext: Eric Sunshine
Message 2 of 6 in “make macOS `git maintenance` test work on Windows”
  1. 0/3 make macOS `git maintenance` test work on WindowsEric Sunshine, Nov 27, 2020
  2. 1/3 t7900: fix test failures when invoked individually via --runEric Sunshine, Nov 27, 2020
  3. 2/3 test-tool: add `getuid` subcommandEric Sunshine, Nov 27, 2020
  4. 3/3 t7900: make macOS-specific test work on WindowsEric Sunshine, Nov 27, 2020
  5. Ævar Arnfjörð BjarmasonNov 27, 2020
  6. Eric SunshineNov 28, 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.