Commit 789fcae3 authored by Grzegorz Bizon's avatar Grzegorz Bizon

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
parents a0cfc1b6 3f64b1ad
...@@ -83,6 +83,7 @@ module QA ...@@ -83,6 +83,7 @@ module QA
# Test scenario entrypoints. # Test scenario entrypoints.
# #
module Test module Test
autoload :Instance, 'qa/scenario/test/instance'
module Instance module Instance
autoload :All, 'qa/scenario/test/instance/all' autoload :All, 'qa/scenario/test/instance/all'
autoload :Smoke, 'qa/scenario/test/instance/smoke' autoload :Smoke, 'qa/scenario/test/instance/smoke'
......
# 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment