Class: Gitlab::QA::Component::Specs
- Inherits:
-
Scenario::Template
- Object
- Scenario::Template
- Gitlab::QA::Component::Specs
- Defined in:
- lib/gitlab/qa/component/specs.rb
Overview
This class represents GitLab QA specs image that is implemented in the ‘qa/` directory located in GitLab CE / EE repositories.
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#network ⇒ Object
Returns the value of attribute network.
-
#release ⇒ Object
Returns the value of attribute release.
-
#suite ⇒ Object
Returns the value of attribute suite.
Instance Method Summary collapse
-
#initialize ⇒ Specs
constructor
A new instance of Specs.
-
#perform ⇒ Object
rubocop:disable Metrics/AbcSize.
Methods inherited from Scenario::Template
Constructor Details
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
11 12 13 |
# File 'lib/gitlab/qa/component/specs.rb', line 11 def args @args end |
#network ⇒ Object
Returns the value of attribute network.
11 12 13 |
# File 'lib/gitlab/qa/component/specs.rb', line 11 def network @network end |
#release ⇒ Object
Returns the value of attribute release.
11 12 13 |
# File 'lib/gitlab/qa/component/specs.rb', line 11 def release @release end |
#suite ⇒ Object
Returns the value of attribute suite.
11 12 13 |
# File 'lib/gitlab/qa/component/specs.rb', line 11 def suite @suite end |
Instance Method Details
#perform ⇒ Object
rubocop:disable Metrics/AbcSize
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gitlab/qa/component/specs.rb', line 17 def perform # rubocop:disable Metrics/AbcSize raise ArgumentError unless [suite, release].all? puts "Running test suite `#{suite}` for #{release.project_name}" name = "#{release.project_name}-qa-#{SecureRandom.hex(4)}" @docker.run(release.qa_image, release.qa_tag, suite, *args) do |command| command << "-t --rm --net=#{network || 'bridge'}" Runtime::Env.variables.each do |key, value| command.env(key, value) end command.volume('/var/run/docker.sock', '/var/run/docker.sock') command.volume(File.join(Runtime::Env.host_artifacts_dir, name), '/home/qa/tmp') command.name(name) end end |