summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-08-26 08:17:25 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-08-26 08:17:25 +0000
commit789fcae35eb54296959818e962a8dd3541eb00cd (patch)
tree8f92af209ce8501de6a544430ee8a89be53754b4 /qa
parenta0cfc1b65ec959e187a4297bcab0b494cbe52cce (diff)
parent3f64b1ad204a6978543e74f8095be731ed4f287f (diff)
downloadgitlab-ce-789fcae35eb54296959818e962a8dd3541eb00cd.tar.gz
Merge branch 'make-qa-scenario-test-instance-back-compatible' into 'master'
[QA] Re-add Test::Instance for back-compatibility with GitLab < 11.3 See merge request gitlab-org/gitlab-ce!21339
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb1
-rw-r--r--qa/qa/scenario/test/instance.rb36
2 files changed, 37 insertions, 0 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 4b927067449..cf15a8b229c 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -83,6 +83,7 @@ module QA
# Test scenario entrypoints.
#
module Test
+ autoload :Instance, 'qa/scenario/test/instance'
module Instance
autoload :All, 'qa/scenario/test/instance/all'
autoload :Smoke, 'qa/scenario/test/instance/smoke'
diff --git a/qa/qa/scenario/test/instance.rb b/qa/qa/scenario/test/instance.rb
new file mode 100644
index 00000000000..b9a73d3ffb8
--- /dev/null
+++ b/qa/qa/scenario/test/instance.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+module QA
+ module Scenario
+ module Test
+ # This class exists for back-compatibility so that gitlab-qa can continue
+ # to call Test::Instance instead of Test::Instance::All until at least
+ # the current latest GitLab version has the Test::Instance::All class.
+ # As of Aug, 22nd 2018. Only GitLab >= 11.3 has this class.
+ module Instance
+ include Bootable
+
+ def self.perform(*args)
+ self.tap do |scenario|
+ yield scenario if block_given?
+ break scenario.do_perform(*args)
+ end
+ end
+
+ def self.do_perform(address, *rspec_options)
+ Runtime::Scenario.define(:gitlab_address, address)
+
+ Specs::Runner.perform do |specs|
+ specs.tty = true
+ specs.options =
+ if rspec_options.any?
+ rspec_options
+ else
+ ::File.expand_path('../specs/features', __dir__)
+ end
+ end
+ end
+ end
+ end
+ end
+end