mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
retry failing feature specs if there are <= 10
This commit is contained in:
+17
-2
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
export PATH="/usr/lib/postgresql/$PGVERSION/bin:$PATH"
|
||||
export JOBS="${CI_JOBS:=$(nproc)}"
|
||||
@@ -166,7 +167,21 @@ run_features() {
|
||||
shopt -s globstar nullglob
|
||||
run_background start_hocuspocus
|
||||
reset_dbs
|
||||
execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_features.log {,modules/*/}spec/features/**/*_spec.rb"
|
||||
|
||||
if ! execute "time bundle exec turbo_tests --verbose -n $JOBS --runtime-log spec/support/runtime-logs/turbo_runtime_features.log {,modules/*/}spec/features/**/*_spec.rb"; then
|
||||
failed_count=$(grep --count ' failed ' tmp/spec_examples.txt 2>/dev/null || echo 0)
|
||||
if [ "$failed_count" -eq 0 ]; then
|
||||
echo "failed to find failing examples, unexpected"
|
||||
exit 1
|
||||
elif [ "$failed_count" -le 10 ]; then
|
||||
echo "retrying $failed_count failed examples"
|
||||
execute "bundle exec rspec --only-failures --format documentation {,modules/*/}spec/features/**/*_spec.rb"
|
||||
else
|
||||
echo "too many failures ($failed_count), not retrying"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
cleanup
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user