Class: Gitlab::QA::Scenario::Test::Integration::GitlabPages

Inherits:
Gitlab::QA::Scenario::Template show all
Defined in:
lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb

Instance Method Summary collapse

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

perform

Constructor Details

#initializeGitlabPages

Returns a new instance of GitlabPages.



9
10
11
12
13
14
15
# File 'lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb', line 9

def initialize
  @gitlab_name = 'gitlab-pages'
  @network = 'test'
  @pages_host = 'gitlab-pages.test'
  @pages_sandbox_name = 'gitlab-qa-sandbox-group-pages'
  @tag = 'gitlab_pages'
end

Instance Method Details

#gitlab_omnibus_configurationObject



17
18
19
20
21
22
# File 'lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb', line 17

def gitlab_omnibus_configuration
  <<~OMNIBUS
      pages_external_url 'http://#{@gitlab_name}.#{@network}';
      gitlab_pages['enable'] = true;
  OMNIBUS
end

#perform(release, *rspec_args) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb', line 28

def perform(release, *rspec_args)
  Component::Gitlab.perform do |gitlab|
    gitlab.release = QA::Release.new(release)
    gitlab.name = @gitlab_name
    gitlab.network = @network

    set_sandbox_name(@pages_sandbox_name)

    gitlab.omnibus_configuration << gitlab_omnibus_configuration
    gitlab.instance do
      if @tag
        rspec_args << "--" unless rspec_args.include?('--')
        rspec_args << "--tag" << @tag
      end

      Component::Specs.perform do |specs|
        specs.additional_hosts << "#{@pages_sandbox_name}.#{@pages_host}:#{gitlab.ip_address}"
        specs.suite = 'Test::Instance::All'
        specs.release = gitlab.release
        specs.network = gitlab.network
        specs.args = [gitlab.address, *rspec_args]
      end
    end
  end
end

#set_sandbox_name(sandbox_name) ⇒ Object



24
25
26
# File 'lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb', line 24

def set_sandbox_name(sandbox_name)
  ::Gitlab::QA::Runtime::Env.gitlab_sandbox_name = sandbox_name
end