git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, chriscool@tuxfamily.org,
	pranit.bauva@gmail.com, ramsay@ramsayjones.plus.com,
	Bagas Sanjaya <bagasdotme@gmail.com>
Subject: [PATCH v2] t6030: add test for git bisect skip started with --term* arguments
Date: Sun, 25 Apr 2021 15:05:09 +0700	[thread overview]
Message-ID: <20210425080508.154159-1-bagasdotme@gmail.com> (raw)

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>
---
 Changes from v1 [1]:

   * Move the test to the the end of test script (test 74).
     v1 placed the test as test 26, and when I run the script, there
     are 9 more failed tests rather than just one (because such tests
     depended on previous ones). Now the test is placed together with
     similar tests (git bisect with --terms*).
   * Begin the test with git bisect reset, as with other nearby tests.

 [1]: https://lore.kernel.org/git/20210423070308.85275-1-bagasdotme@gmail.com/

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

diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 32bb66e1ed..b1b847ebbc 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -922,6 +922,19 @@ test_expect_success 'bisect start takes options and revs in any order' '
 	test_cmp expected actual
 '
 
+# 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 reset &&
+	git bisect start --term-new=fixed --term-old=unfixed HEAD $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
+'
+
 test_expect_success 'git bisect reset cleans bisection state properly' '
 	git bisect reset &&
 	git bisect start &&

base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a
-- 
2.25.1


             reply	other threads:[~2021-04-25  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25  8:05 Bagas Sanjaya [this message]
2021-04-28  8:11 ` [PATCH v2] t6030: add test for git bisect skip started with --term* arguments Christian Couder
2021-04-28 16:32   ` Eric Sunshine
2021-04-28 17:16     ` Christian Couder
2021-04-28 17:48       ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210425080508.154159-1-bagasdotme@gmail.com \
    --to=bagasdotme@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pranit.bauva@gmail.com \
    --cc=ramsay@ramsayjones.plus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).