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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-30 03:12:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-30 03:12:59 +0300
commitcb29b873b658591f571b4041717090ddceff2e0f (patch)
treeca4273c571ce1e691155dc4e42185c19a2c1d9b7 /scripts/rspec_bisect_flaky
parent3ff3fea9095e503196f889f58c3cde34019fcad7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/rspec_bisect_flaky')
-rwxr-xr-xscripts/rspec_bisect_flaky29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/rspec_bisect_flaky b/scripts/rspec_bisect_flaky
new file mode 100755
index 00000000000..efeb9bcb5a0
--- /dev/null
+++ b/scripts/rspec_bisect_flaky
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+## Usage: scripts/rspec_bisect_flaky <files...>
+#
+# The files should be listed in order, with the last file being the file where
+# the flaky spec lives.
+
+if [ $# -eq 0 ]; then
+ echo "Usage: scripts/rspec_bisect_flaky <files...>"
+ exit
+fi
+
+files=( $@ )
+len=${#files[@]}
+target=${files[$len-1]}
+
+# Trap interrupts and exit instead of continuing the loop
+trap "echo Exited!; exit 2;" SIGINT SIGTERM
+
+# Show which set of specs are running
+set -x
+
+# Do the speedy case first, run each spec with our failing spec
+for file in "${files[@]}"; do
+ bin/rspec $file $target
+done
+
+# Do a full bisect given we did not find candidates with speedy cases
+bin/rspec --bisect=verbose $@