Class: Gitlab::QA::Scenario::Test::Integration::Import
- Inherits:
-
Gitlab::QA::Scenario::Template
- Object
- Gitlab::QA::Scenario::Template
- Gitlab::QA::Scenario::Test::Integration::Import
- Defined in:
- lib/gitlab/qa/scenario/test/integration/import.rb
Overview
Scenario type for testing importers
In addition to main gitlab instance, starts another gitlab instance to act as source
and mock server to replace all other possible import sources
Direct Known Subclasses
Instance Attribute Summary collapse
-
#mail_hog_server ⇒ Object
readonly
Returns the value of attribute mail_hog_server.
-
#mock_server ⇒ Object
readonly
Returns the value of attribute mock_server.
-
#network ⇒ Object
readonly
Returns the value of attribute network.
-
#source_gitlab ⇒ Object
readonly
Returns the value of attribute source_gitlab.
-
#spec_suite ⇒ Object
readonly
Returns the value of attribute spec_suite.
-
#target_gitlab ⇒ Object
readonly
Returns the value of attribute target_gitlab.
Instance Method Summary collapse
- #configure_omnibus(gitlab, mail_hog) ⇒ Object
-
#initialize ⇒ Import
constructor
A new instance of Import.
-
#perform(target_release, source_release = nil, *rspec_args) ⇒ void
Import tests that spins up two gitlab instances.
Methods inherited from Gitlab::QA::Scenario::Template
Constructor Details
#initialize ⇒ Import
Returns a new instance of Import.
16 17 18 19 20 21 22 23 24 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 16 def initialize @network = Runtime::Env.docker_network @source_gitlab = new_gitlab_instance @target_gitlab = new_gitlab_instance @mock_server = new_mock_server @mail_hog_server = new_mail_hog_server @spec_suite = 'Test::Integration::Import' end |
Instance Attribute Details
#mail_hog_server ⇒ Object (readonly)
Returns the value of attribute mail_hog_server.
26 27 28 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 26 def mail_hog_server @mail_hog_server end |
#mock_server ⇒ Object (readonly)
Returns the value of attribute mock_server.
26 27 28 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 26 def mock_server @mock_server end |
#network ⇒ Object (readonly)
Returns the value of attribute network.
26 27 28 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 26 def network @network end |
#source_gitlab ⇒ Object (readonly)
Returns the value of attribute source_gitlab.
26 27 28 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 26 def source_gitlab @source_gitlab end |
#spec_suite ⇒ Object (readonly)
Returns the value of attribute spec_suite.
26 27 28 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 26 def spec_suite @spec_suite end |
#target_gitlab ⇒ Object (readonly)
Returns the value of attribute target_gitlab.
26 27 28 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 26 def target_gitlab @target_gitlab end |
Instance Method Details
#configure_omnibus(gitlab, mail_hog) ⇒ Object
28 29 30 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 28 def configure_omnibus(gitlab, mail_hog) raise NotImplementedError end |
#perform(target_release, source_release = nil, *rspec_args) ⇒ void
This method returns an undefined value.
Import tests that spins up two gitlab instances
perform(gitlab-ee, gitlab-ee:17.4.0-ee.0)
> will perform import from gitlab-ee:17.4.0-ee.0 to gitlab-ee
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 42 def perform(target_release, source_release = nil, *rspec_args) # When source_release isn't actually passed but RSpec args arg passed with `-- rspec_args...`, # source_release is wrongly set to `--`, so we fix that here. if source_release == "--" rspec_args.prepend('--') source_release = nil end source_release = target_release if source_release.nil? start_mock_server start_gitlab_instances(source_release, target_release) run_specs(rspec_args) ensure mock_server.teardown target_gitlab.teardown source_gitlab.teardown end |