Class: Gitlab::QA::Scenario::Test::Integration::Import

Inherits:
Gitlab::QA::Scenario::Template show all
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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Gitlab::QA::Scenario::Template

perform

Constructor Details

#initializeImport

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 = "test"
  @source_gitlab = Component::Gitlab.new.tap { |gitlab| gitlab.network = @network }
  @target_gitlab = Component::Gitlab.new.tap { |gitlab| gitlab.network = @network }
  @mock_server = Component::MockServer.new.tap do |server|
    server.network = @network
    server.tls = true
  end
end

Instance Attribute Details

#mock_serverObject (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

#networkObject (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_gitlabObject (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

#target_gitlabObject (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

#perform(release, *rspec_args) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/gitlab/qa/scenario/test/integration/import.rb', line 28

def perform(release, *rspec_args)
  start_mock_server
  start_gitlab_instances(release)

  run_specs(rspec_args)
ensure
  mock_server.teardown
  target_gitlab.teardown
  source_gitlab.teardown
end