summaryrefslogtreecommitdiff
path: root/qa/qa
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-13 11:23:37 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-13 11:23:59 +0100
commit0778cad285a7b8fac2487f2611a601b2e9326c5d (patch)
treee5378ab49b499f429fea02faf90f3fcb71fe067a /qa/qa
parent175a3dfda00fb5a2bf1703803277ee4abb721baf (diff)
downloadgitlab-ce-0778cad285a7b8fac2487f2611a601b2e9326c5d.tar.gz
Do not use GITLAB_RELEASE env to define QA strategy
[ci skip]
Diffstat (limited to 'qa/qa')
-rw-r--r--qa/qa/runtime/release.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/qa/qa/runtime/release.rb b/qa/qa/runtime/release.rb
index e3da00a1881..40d24e8d342 100644
--- a/qa/qa/runtime/release.rb
+++ b/qa/qa/runtime/release.rb
@@ -2,35 +2,32 @@ module QA
module Runtime
##
# Class that is responsible for plugging CE/EE extensions in, depending on
- # environment variable GITLAB_RELEASE that should be present in the runtime
- # environment.
+ # existence of EE module.
#
# We need that to reduce the probability of conflicts when merging
# CE to EE.
#
class Release
- UnspecifiedReleaseError = Class.new(StandardError)
-
- def initialize(version = ENV['GITLAB_RELEASE'])
- @version = version.to_s.upcase
-
- unless %w[CE EE].include?(@version)
- raise UnspecifiedReleaseError, 'GITLAB_RELEASE env not defined!'
- end
+ def initialize(variant = nil)
+ @version = variant || version
begin
- require "qa/#{version.downcase}/strategy"
+ require "qa/#{@version.downcase}/strategy"
rescue LoadError
# noop
end
end
+ def version
+ File.directory?("#{__dir__}/../ee") ? :EE : :CE
+ end
+
def has_strategy?
- QA.const_defined?("#{@version}::Strategy")
+ QA.const_defined?("QA::#{@version}::Strategy")
end
def strategy
- QA.const_get("#{@version}::Strategy")
+ QA.const_get("QA::#{@version}::Strategy")
end
def self.method_missing(name, *args)