Sha256: 1feaf94ac91956bdda976999827c4f75f9e57b95cb9d69aa44a2f13251dbedbc

Contents?: true

Size: 1.76 KB

Versions: 75

Compression:

Stored size: 1.76 KB

Contents

# frozen_string_literal: true

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

75 entries across 75 versions & 1 rubygems

Version Path
gitlab-qa-12.4.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-12.4.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-12.3.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.3.0.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-12.2.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-12.2.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-12.1.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-12.0.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-11.3.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-11.2.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-11.1.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-11.0.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.6.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.5.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.4.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.4.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.3.0 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.2.2 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.2.1 lib/gitlab/qa/scenario/test/integration/smtp.rb
gitlab-qa-10.2.0 lib/gitlab/qa/scenario/test/integration/smtp.rb