Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-11-10 19:36:36 +0300
committerTaylor Blau <me@ttaylorr.com>2022-11-12 01:05:48 +0300
commit982fecf7c195d47c50cd397db303d262d2af88f6 (patch)
treec74e2d8df1bbe68627b978f8a7932e1aeb6ad407 /t/t6030-bisect-porcelain.sh
parent2445d34fb9e426c9b4e55ffffa6a32f536b7ff05 (diff)
bisect tests: test for v2.30.0 "bisect run" regressions
Add three failing tests which succeed on v2.29.0, but due to the topic merged at [1] (specifically [2]) have been failing since then. We'll address those regressions in subsequent commits. There was also a "regression" where: git bisect run ./missing-script.sh Would count a non-existing script as "good", as the shell would exit with 127. That edge case is a bit too insane to preserve, so let's not add it to these regression tests. There was another regression that 'git bisect' consumed some options that was meant to passed down to program run with 'git bisect run'. Since that regression is breaking user's expectation, it has been fixed earlier without this patch queued. 1. 0a4cb1f1f2f (Merge branch 'mr/bisect-in-c-4', 2021-09-23) 2. d1bbbe45df8 (bisect--helper: reimplement `bisect_run` shell function in C, 2021-09-13) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 't/t6030-bisect-porcelain.sh')
-rwxr-xr-xt/t6030-bisect-porcelain.sh79
1 files changed, 79 insertions, 0 deletions
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 6dbbe62eb2..6c2c57cadf 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -252,6 +252,85 @@ test_expect_success 'bisect skip: with commit both bad and skipped' '
grep $HASH4 my_bisect_log.txt
'
+test_bisect_run_args () {
+ test_when_finished "rm -f run.sh actual" &&
+ >actual &&
+ cat >expect.args &&
+ cat <&6 >expect.out &&
+ cat <&7 >expect.err &&
+ write_script run.sh <<-\EOF &&
+ while test $# != 0
+ do
+ echo "<$1>" &&
+ shift
+ done >actual.args
+ EOF
+
+ test_when_finished "git bisect reset" &&
+ git bisect start &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run ./run.sh $@ >actual.out.raw 2>actual.err &&
+ # Prune just the log output
+ sed -n \
+ -e '/^Author:/d' \
+ -e '/^Date:/d' \
+ -e '/^$/d' \
+ -e '/^commit /d' \
+ -e '/^ /d' \
+ -e 'p' \
+ <actual.out.raw >actual.out &&
+ test_cmp expect.out actual.out &&
+ test_cmp expect.err actual.err &&
+ test_cmp expect.args actual.args
+}
+
+test_expect_failure 'git bisect run: args, stdout and stderr with no arguments' "
+ test_bisect_run_args <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
+ EOF_ARGS
+ running ./run.sh
+ $HASH4 is the first bad commit
+ bisect run success
+ EOF_OUT
+ EOF_ERR
+"
+
+test_expect_failure 'git bisect run: args, stdout and stderr: "--" argument' "
+ test_bisect_run_args -- <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
+ <-->
+ EOF_ARGS
+ running ./run.sh --
+ $HASH4 is the first bad commit
+ bisect run success
+ EOF_OUT
+ EOF_ERR
+"
+
+test_expect_failure 'git bisect run: args, stdout and stderr: "--log foo --no-log bar" arguments' "
+ test_bisect_run_args --log foo --no-log bar <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
+ <--log>
+ <foo>
+ <--no-log>
+ <bar>
+ EOF_ARGS
+ running ./run.sh --log foo --no-log bar
+ $HASH4 is the first bad commit
+ bisect run success
+ EOF_OUT
+ EOF_ERR
+"
+
+test_expect_failure 'git bisect run: args, stdout and stderr: "--bisect-start" argument' "
+ test_bisect_run_args --bisect-start <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
+ <--bisect-start>
+ EOF_ARGS
+ running ./run.sh --bisect-start
+ $HASH4 is the first bad commit
+ bisect run success
+ EOF_OUT
+ EOF_ERR
+"
+
# We want to automatically find the commit that
# added "Another" into hello.
test_expect_success '"git bisect run" simple case' '