Re: [PATCH v1 3/3] travis-ci: run Git bisect on failed tests
- From
Christian Couder <christian.couder@gmail.com>
- Date
- May 22, 2016, 15:35 UTC
- Message-ID
- <CAP8UFD3TJ7mJEu2xCXhrspHY1v02uTonUGdszZbcQGf9ne9_Cg@mail.gmail.com>
- In-Reply-To
- <1463914856-64745-4-git-send-email-larsxschneider@gmail.com>
On Sun, May 22, 2016 at 1:00 PM, <larsxschneider@gmail.com> wrote:
[...]
Show 22 quoted lines
> +#
> +# Run Git bisect
> +#
> +run_bisect () {
> + TEST_SCRIPT=$1
> + BAD_REV=$2
> + GOOD_RV=$3
> + TMPDIR=$(mktemp -d -t "ci-report-bisect-XXXXXX" 2>/dev/null)
> + cat > "$TMPDIR/bisect-run.sh" <<EOF
> +
> +EOF
> + chmod +x "$TMPDIR/bisect-run.sh"
> + git bisect start $BAD_REV $GOOD_RV
> + git bisect run "$TMPDIR/bisect-run.sh"
> + if test -e ./t/$TEST_SCRIPT.sh && make --jobs=2 >/dev/null 2>&1
> + then
> + cd t && ./$TEST_SCRIPT.sh >/dev/null 2>&1
> + else
> + # If the test file does not exist or the build fails then tell
> + # Git bisect to skip the commit.
> + exit 125
> + fiShouldn't all the above "if ... fi" be in the here document creating "$TMPDIR/bisect-run.sh"?
> + git bisect reset >/dev/null 2>&1 > +}