From e8834a68f3b2eb8c8f26353f2f47ab0f8a0fcebb Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Mon, 14 Sep 2015 13:40:15 +0200 Subject: [PATCH] Script for fully automated test bisecting. Automate cucumber tests bisecting by providing a `git bisect` script. Because it is stored in source control, but bisecting changes the HEAD, it is advised to first copy over the script to a place outside source control, e.g. `/tmp`. Usage: git bisect start HEAD HEAD~10 bit bisect run /tmp/bisect_cucumber.sh This automatically configures and builds OSRM, spawns the cucumber tests and communicates with `git bisect` based on its return code. Reference: - man git-bisect --- scripts/bisect_cucumber.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 scripts/bisect_cucumber.sh diff --git a/scripts/bisect_cucumber.sh b/scripts/bisect_cucumber.sh new file mode 100755 index 000000000..38c2b8c5e --- /dev/null +++ b/scripts/bisect_cucumber.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Automates bisecting cucumber tests in a portable way; usage: +# +# git bisect start GOODGITSHA BADGITSHA +# git bisect run /path/to/bisect_cucumber.sh +# +# XXX: store this file outside source control first, e.g. by copying it over +# to /tmp, otherwise jumping through commits will change this script, too. + + +# e: exit on first error, x: print commands +set -ex + +BUILD_DIR=build + +cmake -E remove_directory $BUILD_DIR +cmake -E make_directory $BUILD_DIR +cmake -E chdir $BUILD_DIR cmake .. -DCMAKE_BUILD_TYPE=Release +cmake -E chdir $BUILD_DIR cmake --build . +cucumber -p verify + + +# notes on the return codes git bisect understands: +# - exit code 0 means okay +# - exit code 125 means skip this commit and try a commit nearby +# - every other exit code means bad