diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-21 21:06:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-21 21:06:14 +0000 |
commit | 170f0bdcdef9c9b226abfe0a50d6687c65e8d613 (patch) | |
tree | 5c82769a5380a0fd495bd1adb098c8c360334587 /qa/qa/specs/loop_runner.rb | |
parent | f1bb2a307e9b125a8ee0be3728cb0d1baa21a3d4 (diff) | |
download | gitlab-ce-170f0bdcdef9c9b226abfe0a50d6687c65e8d613.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/specs/loop_runner.rb')
-rw-r--r-- | qa/qa/specs/loop_runner.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/qa/qa/specs/loop_runner.rb b/qa/qa/specs/loop_runner.rb new file mode 100644 index 00000000000..f97f5cbbd81 --- /dev/null +++ b/qa/qa/specs/loop_runner.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module QA + module Specs + module LoopRunner + module_function + + def run(args) + start = Time.now + loop_duration = 60 * QA::Runtime::Env.gitlab_qa_loop_runner_minutes + + while Time.now - start < loop_duration + RSpec::Core::Runner.run(args.flatten, $stderr, $stdout).tap do |status| + abort if status.nonzero? + end + RSpec.clear_examples + end + end + end + end +end |