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.



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

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.



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

def gitlab_name
  @gitlab_name
end

#spec_suiteObject (readonly)

Returns the value of attribute spec_suite.



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

def spec_suite
  @spec_suite
end

Instance Method Details

#configure_omnibus(gitlab, mail_hog) ⇒ Object



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

def configure_omnibus(gitlab, mail_hog)
  gitlab.omnibus_configuration << <<~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



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
53
54
# File 'lib/gitlab/qa/scenario/test/integration/smtp.rb', line 26

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
          Runtime::Logger.info("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