Class: Gitlab::QA::Scenario::Test::Integration::SMTP

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

perform

Constructor Details

#initializeSMTP

Returns a new instance of SMTP.



9
10
11
12
# File 'lib/gitlab/qa/scenario/test/integration/smtp.rb', line 9

def initialize
  @gitlab_name = 'gitlab-smtp'
  @spec_suite = 'Test::Integration::SMTP'
end

Instance Attribute Details

#gitlab_nameObject (readonly)

Returns the value of attribute gitlab_name.



14
15
16
# File 'lib/gitlab/qa/scenario/test/integration/smtp.rb', line 14

def gitlab_name
  @gitlab_name
end

#spec_suiteObject (readonly)

Returns the value of attribute spec_suite.



14
15
16
# File 'lib/gitlab/qa/scenario/test/integration/smtp.rb', line 14

def spec_suite
  @spec_suite
end

Instance Method Details

#configure_omnibus(gitlab, mail_hog) ⇒ Object



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

def configure_omnibus(gitlab, mail_hog)
  gitlab.omnibus_config = <<~OMNIBUS
        gitlab_rails['smtp_enable'] = true;
        gitlab_rails['smtp_address'] = '#{mail_hog.hostname}';
        gitlab_rails['smtp_port'] = 1025;
  OMNIBUS
end

#perform(release, *rspec_args) ⇒ Object



24
25
26
27
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/smtp.rb', line 24

def perform(release, *rspec_args)
  release = QA::Release.new(release)

  Component::Gitlab.perform do |gitlab|
    gitlab.release = release
    gitlab.network = 'test'
    gitlab.name = gitlab_name

    Component::MailHog.perform do |mail_hog|
      mail_hog.network = gitlab.network
      mail_hog.set_mailhog_hostname

      configure_omnibus(gitlab, mail_hog)

      mail_hog.instance do
        gitlab.instance do
          puts "Running #{spec_suite} specs!"

          Component::Specs.perform do |specs|
            specs.suite = spec_suite
            specs.release = release
            specs.network = gitlab.network
            specs.args = [gitlab.address, *rspec_args]
          end
        end
      end
    end
  end
end