git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t6030: add test for git bisect skip started with --term* arguments
@ 2021-04-23  7:03 Bagas Sanjaya
  0 siblings, 0 replies; only message in thread
From: Bagas Sanjaya @ 2021-04-23  7:03 UTC (permalink / raw)
  To: git
  Cc: trygveaa, gitster, pranit.bauva, tanushreetumane, mirucam,
	chriscool, Bagas Sanjaya

Trygve Aaberge reported [1] git bisect breakage when the bisection
is started with --term* arguments (--term-new and --term-old). In that
case, skipping with `git bisect skip` should cause HEAD to be changed,
but actually the HEAD stayed same after skipping.

Let's add the test to catch the breakage. Because there isn't any fixes
yet, mark the test as test_expect_failure.

[1]: https://lore.kernel.org/git/20210418151459.GC10839@aaberge.net/

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
---

Junio suggested that I should had written this test in t6030, not in
separate script as per [2], so that I could reuse the history from
existing tests.

[2]: https://lore.kernel.org/git/xmqqa6przh08.fsf@gitster.g/

 t/t6030-bisect-porcelain.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 32bb66e1ed..c500fa893d 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -299,6 +299,18 @@ test_expect_success 'bisect skip and bisect replay' '
 	git bisect reset
 '
 
+# Bisect is started with --term-new and --term-old arguments,
+# then skip. The HEAD should be changed.
+# FIXME: Mark this test as test_expect_failure. Remove the FIXME and
+# mark as test_expect_success when this test successes (fixed bug).
+test_expect_failure '"bisect skip: bisection is started with --term*"' '
+	git bisect start --term-new=fixed --term-old=unfixed $HASH5 $HASH1 &&
+	HASH_SKIPPED_FROM=$(git rev-parse --verify HEAD) &&
+	git bisect skip &&
+	HASH_SKIPPED_TO=$(git rev-parse --verify HEAD) &&
+	test $HASH_SKIPPED_FROM != $HASH_SKIPPED_TO
+'
+
 HASH6=
 test_expect_success 'bisect run & skip: cannot tell between 2' '
 	add_line_into_file "6: Yet a line." hello &&

base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-23  7:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23  7:03 [PATCH] t6030: add test for git bisect skip started with --term* arguments Bagas Sanjaya

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).