Sha256: f5f9ff131a7535fb18d93aa4b53805020c6c67b591c9751fd532e8dd188643cc

Contents?: true

Size: 1.73 KB

Versions: 30

Compression:

Stored size: 1.73 KB

Contents

require 'yaml'

module Gitlab
  module QA
    module Scenario
      module Test
        module Integration
          class SMTP < Scenario::Template
            def initialize
              @gitlab_name = 'gitlab-smtp'
              @spec_suite = 'Test::Integration::SMTP'
            end

            attr_reader :gitlab_name, :spec_suite

            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

            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
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
gitlab-qa-7.34.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.33.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.32.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.31.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.30.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.29.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.29.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.27.2 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.27.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.27.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.26.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.25.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.25.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.24.6 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.24.5 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.24.4 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.24.3 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.24.2 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.24.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-7.24.0 lib/gitlab/qa/scenario/test/integration/smtp.rb