gitlab-qa 4.12.0 → 4.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be29a5a9db9ec0e8bf2978867441705138f451eeff78486fd648f963e152fce7
4
- data.tar.gz: 538e0b25c50c493488073e04861d634730ecd4b7da7482adacce44501ccc2fc8
3
+ metadata.gz: 2752708af7bf59c627137ef9d097e5994bf9f80a619b3fac817f24cde5c92c85
4
+ data.tar.gz: 839f552e6b8d94633aa45db829c1886f08c3cb62fdeb72a6ea108f2c28f2b494
5
5
  SHA512:
6
- metadata.gz: 63e172af2327cb4dbd5e8ab5f6edaa8a78621ca65d428a9aa659b2d6ae8f4405a42a1bdb0fd77b8f922c087c5cd38d57bee30bdc526071e0ff108c1ac92ccbf1
7
- data.tar.gz: 58d2f017bf496c78cb634bb242d17fa5ba81a2d48b26eaeb928e2d516249f2c93185079c98807962bef10dca1fca62420c8b8a14e2041e3942008dc1aa3e1f12
6
+ metadata.gz: bcf336cc8dc394e4743fa0295ed290043b08eda968b3bd4c5c371a1eadb284a74e6a0f5d123c03bcca72f3b19cd45253386de82106049020bfb1d0f1bbe54d29
7
+ data.tar.gz: f2663a7e7c9d588591feae456c29aaac2669dd382864fa900d45347eece9c92b187f250d3dfeb995596a76178da15a6ec326e4dc857dd026cd40e399e31d509d
@@ -27,6 +27,7 @@ before_script:
27
27
  - if [ -n "$TRIGGERED_USER" ] && [ -n "$TRIGGER_SOURCE" ]; then
28
28
  echo "Pipeline triggered by $TRIGGERED_USER at $TRIGGER_SOURCE";
29
29
  fi
30
+ - export LANG=C.UTF-8
30
31
 
31
32
  check:rubocop:
32
33
  stage: check
@@ -395,7 +396,7 @@ ee:elasticsearch:
395
396
  - .high-capacity
396
397
  - .ee-qa
397
398
  - .rspec-report-opts
398
-
399
+
399
400
  ce:praefect:
400
401
  script:
401
402
  - exe/gitlab-qa Test::Integration::Praefect ${RELEASE:=CE} -- $RSPEC_REPORT_OPTS
@@ -420,6 +421,24 @@ ee:praefect:
420
421
  parallel: 5
421
422
  when: manual
422
423
 
424
+ ce:smtp:
425
+ script:
426
+ - exe/gitlab-qa Test::Integration::SMTP ${RELEASE:=CE} -- $RSPEC_REPORT_OPTS
427
+ extends:
428
+ - .test
429
+ - .high-capacity
430
+ - .ce-qa
431
+ - .rspec-report-opts
432
+
433
+ ee:smtp:
434
+ script:
435
+ - exe/gitlab-qa Test::Integration::SMTP ${RELEASE:=EE} -- $RSPEC_REPORT_OPTS
436
+ extends:
437
+ - .test
438
+ - .high-capacity
439
+ - .ee-qa
440
+ - .rspec-report-opts
441
+
423
442
  .report-base:
424
443
  image: ruby:2.6-alpine
425
444
  variables:
@@ -494,6 +494,25 @@ Example:
494
494
  $ gitlab-qa Test::Integration::Praefect EE
495
495
  ```
496
496
 
497
+ ### `Test::Integration::SMTP CE|EE|<full image address>`
498
+
499
+ This tests SMTP notification email delivery from Gitlab by using
500
+ [MailHog](https://github.com/mailhog/MailHog) as MTA.
501
+ It starts up a Docker container for MailHog and sets the Omnibus configuration
502
+ to use it for SMTP delivery. The MailHog container will expose the configured
503
+ port for SMTP delivery, and also another port for the HTTP MailHog API used for
504
+ querying the delivered messages.
505
+
506
+ To run tests against the GitLab container, a GitLab QA (`gitlab/gitlab-qa`)
507
+ container is spun up and tests are run from it by running the
508
+ `Test::Integration::SMTP` scenario.
509
+
510
+ Example:
511
+
512
+ ```
513
+ $ gitlab-qa Test::Integration::SMTP CE
514
+ ```
515
+
497
516
  ### `Test::Instance::Any CE|EE|<full image address>:nightly|latest|any_tag http://your.instance.gitlab`
498
517
 
499
518
  This tests that a live GitLab instance works as expected by running tests
@@ -46,6 +46,7 @@ module Gitlab
46
46
  autoload :Packages, 'gitlab/qa/scenario/test/integration/packages'
47
47
  autoload :Praefect, 'gitlab/qa/scenario/test/integration/praefect'
48
48
  autoload :Elasticsearch, 'gitlab/qa/scenario/test/integration/elasticsearch'
49
+ autoload :SMTP, 'gitlab/qa/scenario/test/integration/smtp'
49
50
  end
50
51
 
51
52
  module Sanity
@@ -65,6 +66,7 @@ module Gitlab
65
66
  autoload :Minio, 'gitlab/qa/component/minio'
66
67
  autoload :Preprod, 'gitlab/qa/component/preprod'
67
68
  autoload :Elasticsearch, 'gitlab/qa/component/elasticsearch'
69
+ autoload :MailHog, 'gitlab/qa/component/mail_hog'
68
70
  end
69
71
 
70
72
  module Support
@@ -0,0 +1,77 @@
1
+ # This component sets up the MailHog (https://github.com/mailhog/MailHog)
2
+ # image with the proper configuration for SMTP email delivery from Gitlab
3
+
4
+ module Gitlab
5
+ module QA
6
+ module Component
7
+ class MailHog
8
+ include Scenario::Actable
9
+
10
+ MAILHOG_IMAGE = 'mailhog/mailhog'.freeze
11
+ MAILHOG_IMAGE_TAG = 'v1.0.0'.freeze
12
+
13
+ attr_reader :docker
14
+ attr_accessor :environment, :network
15
+ attr_writer :name
16
+
17
+ def initialize
18
+ @docker = Docker::Engine.new
19
+ @environment = {}
20
+ end
21
+
22
+ def name
23
+ @name ||= "mailhog"
24
+ end
25
+
26
+ def hostname
27
+ "#{name}.#{network}"
28
+ end
29
+
30
+ def instance
31
+ raise 'Please provide a block!' unless block_given?
32
+
33
+ prepare
34
+ start
35
+
36
+ yield self
37
+ ensure
38
+ teardown
39
+ end
40
+
41
+ def prepare
42
+ @docker.pull(MAILHOG_IMAGE, MAILHOG_IMAGE_TAG)
43
+
44
+ return if @docker.network_exists?(network)
45
+
46
+ @docker.network_create(network)
47
+ end
48
+
49
+ def start
50
+ docker.run(MAILHOG_IMAGE, MAILHOG_IMAGE_TAG) do |command|
51
+ command << '-d '
52
+ command << "--name #{name}"
53
+ command << "--net #{network}"
54
+ command << "--hostname #{hostname}"
55
+ command << "--publish 1025:1025"
56
+ command << "--publish 8025:8025"
57
+ end
58
+ end
59
+
60
+ def restart
61
+ @docker.restart(name)
62
+ end
63
+
64
+ def teardown
65
+ raise 'Invalid instance name!' unless name
66
+
67
+ @docker.stop(name)
68
+ @docker.remove(name)
69
+ end
70
+
71
+ def set_mailhog_hostname
72
+ ::Gitlab::QA::Runtime::Env.mailhog_hostname = hostname
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -56,6 +56,7 @@ module Gitlab
56
56
  'KNAPSACK_TEST_FILE_PATTERN' => :knapsack_test_file_pattern,
57
57
  'KNAPSACK_TEST_DIR' => :knapsack_test_dir,
58
58
  'CI' => :ci,
59
+ 'CI_RUNNER_ID' => :ci_runner_id,
59
60
  'CI_NODE_INDEX' => :ci_node_index,
60
61
  'CI_NODE_TOTAL' => :ci_node_total,
61
62
  'GITLAB_CI' => :gitlab_ci,
@@ -66,7 +67,8 @@ module Gitlab
66
67
  'GITLAB_QA_1P_SECRET' => :gitlab_qa_1p_secret,
67
68
  'GITLAB_QA_1P_GITHUB_UUID' => :gitlab_qa_1p_github_uuid,
68
69
  'GITLAB_QA_LOOP_RUNNER_MINUTES' => :gitlab_qa_loop_runner_minutes,
69
- 'QA_CAN_TEST_ADMIN_FEATURES' => :qa_can_test_admin_features
70
+ 'QA_CAN_TEST_ADMIN_FEATURES' => :qa_can_test_admin_features,
71
+ 'MAILHOG_HOSTNAME' => :mailhog_hostname
70
72
  }.freeze
71
73
 
72
74
  ENV_VARIABLES.each_value do |accessor|
@@ -0,0 +1,58 @@
1
+ require 'yaml'
2
+
3
+ module Gitlab
4
+ module QA
5
+ module Scenario
6
+ module Test
7
+ module Integration
8
+ class SMTP < Scenario::Template
9
+ def initialize
10
+ @gitlab_name = 'gitlab-smtp'
11
+ @spec_suite = 'Test::Integration::SMTP'
12
+ end
13
+
14
+ attr_reader :gitlab_name, :spec_suite
15
+
16
+ def configure_omnibus(gitlab, mail_hog)
17
+ gitlab.omnibus_config = <<~OMNIBUS
18
+ gitlab_rails['smtp_enable'] = true;
19
+ gitlab_rails['smtp_address'] = '#{mail_hog.hostname}';
20
+ gitlab_rails['smtp_port'] = 1025
21
+ OMNIBUS
22
+ end
23
+
24
+ def perform(release, *rspec_args)
25
+ release = Release.new(release)
26
+
27
+ Component::Gitlab.perform do |gitlab|
28
+ gitlab.release = release
29
+ gitlab.network = 'test'
30
+ gitlab.name = gitlab_name
31
+
32
+ Component::MailHog.perform do |mail_hog|
33
+ mail_hog.network = gitlab.network
34
+ mail_hog.set_mailhog_hostname
35
+
36
+ configure_omnibus(gitlab, mail_hog)
37
+
38
+ mail_hog.instance do
39
+ gitlab.instance do
40
+ puts "Running #{spec_suite} specs!"
41
+
42
+ Component::Specs.perform do |specs|
43
+ specs.suite = spec_suite
44
+ specs.release = release
45
+ specs.network = gitlab.network
46
+ specs.args = [gitlab.address, *rspec_args]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '4.12.0'.freeze
3
+ VERSION = '4.13.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.0
4
+ version: 4.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grzegorz Bizon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-02 00:00:00.000000000 Z
11
+ date: 2019-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -168,6 +168,7 @@ files:
168
168
  - lib/gitlab/qa/component/gitlab.rb
169
169
  - lib/gitlab/qa/component/internet_tunnel.rb
170
170
  - lib/gitlab/qa/component/ldap.rb
171
+ - lib/gitlab/qa/component/mail_hog.rb
171
172
  - lib/gitlab/qa/component/minio.rb
172
173
  - lib/gitlab/qa/component/preprod.rb
173
174
  - lib/gitlab/qa/component/production.rb
@@ -207,6 +208,7 @@ files:
207
208
  - lib/gitlab/qa/scenario/test/integration/packages.rb
208
209
  - lib/gitlab/qa/scenario/test/integration/praefect.rb
209
210
  - lib/gitlab/qa/scenario/test/integration/saml.rb
211
+ - lib/gitlab/qa/scenario/test/integration/smtp.rb
210
212
  - lib/gitlab/qa/scenario/test/omnibus/image.rb
211
213
  - lib/gitlab/qa/scenario/test/omnibus/update.rb
212
214
  - lib/gitlab/qa/scenario/test/omnibus/upgrade.rb