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

[PATCH 2/3] t3418: decouple test cases from a previous `rebase -p` test case

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 31, 2018, 20:02 UTC
Message-ID
<f7d7892a48a90b54f466569ac220cb2c9e319806.1541016115.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.63.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

It is in general a good idea for regression test cases to be as independent of each other as possible (with the one exception of an initial `setup` test case, which is only a test case in Git's test suite because it does not have a notion of a fixture or setup).

This patch addresses one particular instance of this principle being violated: a few test cases in t3418-rebase-continue.sh depend on a side effect of a test case that verifies a specific `rebase -p` behavior. The later test cases should, however, still succeed even if the `rebase -p` test case is skipped.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3418-rebase-continue.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 25099d715c..031e3d8ddb 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -177,6 +177,7 @@ test_expect_success 'setup rerere database' '
 	git checkout master &&
 	test_commit "commit-new-file-F3" F3 3 &&
 	test_config rerere.enabled true &&
+	git update-ref refs/heads/topic commit-new-file-F3-on-topic-branch &&
 	test_must_fail git rebase -m master topic &&
 	echo "Resolved" >F2 &&
 	cp F2 expected-F2 &&
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 3 of 7 in “tests: allow to skip git rebase -p tests”
  1. 0/3 tests: allow to skip git rebase -p testsJohannes Schindelin via GitGitGadget, Oct 31, 2018
  2. 1/3 t3404: decouple some test cases from outcomes of previous test casesJohannes Schindelin via GitGitGadget, Oct 31, 2018
  3. 2/3 t3418: decouple test cases from a previous `rebase -p` test caseJohannes Schindelin via GitGitGadget, Oct 31, 2018
  4. 3/3 tests: optionally skip `git rebase -p` testsJohannes Schindelin via GitGitGadget, Oct 31, 2018
  5. Junio C HamanoNov 1, 2018
  6. Johannes SixtNov 1, 2018
  7. Junio C HamanoNov 1, 2018

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.