gitlab-qa 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,9 +8,13 @@ module Gitlab
8
8
  # including staging and on-premises installation.
9
9
  #
10
10
  class Any < Scenario::Template
11
- def perform(release, tag, address)
12
- Docker::Specs.perform do |instance|
13
- instance.test_address(release, tag, address)
11
+ def perform(edition, tag, address)
12
+ release = Release.new(edition).tap do |r|
13
+ r.tag = tag
14
+ end
15
+
16
+ Component::Specs.perform do |instance|
17
+ instance.test_address(release: release, address: address)
14
18
  end
15
19
  end
16
20
  end
@@ -4,26 +4,21 @@ module Gitlab
4
4
  module Test
5
5
  module Instance
6
6
  class Image < Scenario::Template
7
- attr_writer :tag, :volumes
7
+ attr_writer :volumes
8
8
 
9
9
  def initialize
10
10
  @volumes = {}
11
11
  end
12
12
 
13
- # rubocop:disable Metrics/MethodLength
14
- #
15
13
  def perform(release)
16
- Docker::Gitlab.perform do |gitlab|
14
+ Component::Gitlab.perform do |gitlab|
17
15
  gitlab.release = release
18
- gitlab.name = "gitlab-qa-#{gitlab.release.edition}"
19
- gitlab.image = gitlab.release.image
20
- gitlab.tag = @tag || gitlab.release.tag
21
16
  gitlab.volumes = @volumes
22
17
  gitlab.network = 'test'
23
18
 
24
19
  gitlab.instance do
25
- Docker::Specs.perform do |instance|
26
- instance.test(gitlab)
20
+ Component::Specs.perform do |instance|
21
+ instance.test(gitlab: gitlab)
27
22
  end
28
23
  end
29
24
  end
@@ -0,0 +1,35 @@
1
+ module Gitlab
2
+ module QA
3
+ module Scenario
4
+ module Test
5
+ module Integration
6
+ class Mattermost < Scenario::Template
7
+ # rubocop:disable Metrics/MethodLength
8
+ def perform(release)
9
+ Component::Gitlab.perform do |gitlab|
10
+ gitlab.release = release
11
+ gitlab.network = 'test'
12
+
13
+ mattermost_hostname = "mattermost.#{gitlab.network}"
14
+ mattermost_external_url = "http://#{mattermost_hostname}"
15
+ gitlab.omnibus_config =
16
+ "mattermost_external_url '#{mattermost_external_url}'"
17
+ gitlab.network_aliases = [mattermost_hostname]
18
+
19
+ gitlab.instance do
20
+ Component::Specs.perform do |instance|
21
+ instance.test(
22
+ gitlab: gitlab,
23
+ suite: 'Test::Integration::Mattermost',
24
+ extra_args: [mattermost_external_url]
25
+ )
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -5,16 +5,12 @@ module Gitlab
5
5
  module Omnibus
6
6
  class Image < Scenario::Template
7
7
  # rubocop:disable Style/Semicolon
8
- # rubocop:disable Metrics/MethodLength
9
8
  def perform(release)
10
- Docker::Gitlab.perform do |instance|
11
- instance.release = release
12
- instance.name = "gitlab-qa-#{instance.release.edition}"
13
- instance.image = instance.release.image
14
- instance.tag = instance.release.tag
15
- instance.network = 'bridge'
9
+ Component::Gitlab.perform do |gitlab|
10
+ gitlab.release = release
11
+ gitlab.network = 'bridge'
16
12
 
17
- instance.act do
13
+ gitlab.act do
18
14
  prepare; start; reconfigure
19
15
  restart; wait; teardown
20
16
  end
@@ -12,16 +12,18 @@ module Gitlab
12
12
  'data' => '/var/opt/gitlab' }.freeze
13
13
 
14
14
  # rubocop:disable Metrics/MethodLength
15
- def perform(release)
15
+ #
16
+ def perform(next_release)
17
+ next_release = Release.new(next_release)
18
+
16
19
  with_temporary_volumes do |volumes|
17
20
  Scenario::Test::Instance::Image
18
- .perform(Release.new(release).edition) do |scenario|
19
- scenario.tag = 'latest'
21
+ .perform(next_release.previous_stable) do |scenario|
20
22
  scenario.volumes = volumes
21
23
  end
22
24
 
23
25
  Scenario::Test::Instance::Image
24
- .perform(release) do |scenario|
26
+ .perform(next_release) do |scenario|
25
27
  scenario.volumes = volumes
26
28
  end
27
29
  end
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '0.2.2'.freeze
3
+ VERSION = '0.3.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: 0.2.2
4
+ version: 0.3.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: 2017-06-30 00:00:00.000000000 Z
11
+ date: 2017-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,16 +106,18 @@ files:
106
106
  - exe/gitlab-qa
107
107
  - gitlab-qa.gemspec
108
108
  - lib/gitlab/qa.rb
109
+ - lib/gitlab/qa/component/gitlab.rb
110
+ - lib/gitlab/qa/component/specs.rb
109
111
  - lib/gitlab/qa/docker/command.rb
110
112
  - lib/gitlab/qa/docker/engine.rb
111
- - lib/gitlab/qa/docker/gitlab.rb
112
- - lib/gitlab/qa/docker/specs.rb
113
+ - lib/gitlab/qa/docker/shellout.rb
113
114
  - lib/gitlab/qa/release.rb
114
115
  - lib/gitlab/qa/runtime/env.rb
115
116
  - lib/gitlab/qa/scenario/actable.rb
116
117
  - lib/gitlab/qa/scenario/template.rb
117
118
  - lib/gitlab/qa/scenario/test/instance/any.rb
118
119
  - lib/gitlab/qa/scenario/test/instance/image.rb
120
+ - lib/gitlab/qa/scenario/test/integration/mattermost.rb
119
121
  - lib/gitlab/qa/scenario/test/omnibus/image.rb
120
122
  - lib/gitlab/qa/scenario/test/omnibus/upgrade.rb
121
123
  - lib/gitlab/qa/version.rb
@@ -1,40 +0,0 @@
1
- module Gitlab
2
- module QA
3
- module Docker
4
- class Specs
5
- include Scenario::Actable
6
-
7
- IMAGE_NAME = 'gitlab/gitlab-qa'.freeze
8
-
9
- def initialize
10
- @docker = Docker::Engine.new
11
- end
12
-
13
- def test(gitlab)
14
- test_address(gitlab.release.edition, gitlab.tag, gitlab.address,
15
- "#{gitlab.name}-specs", gitlab.network)
16
- end
17
-
18
- # rubocop:disable Metrics/MethodLength
19
- #
20
- def test_address(edition, tag, address, name = nil, network = nil)
21
- puts 'Running instance test scenarios for Gitlab ' \
22
- "#{edition.upcase} at #{address}"
23
-
24
- args = ['Test::Instance', address]
25
-
26
- @docker.run(IMAGE_NAME, "#{edition}-#{tag}", *args) do |command|
27
- command << "-t --rm --net=#{network || 'bridge'}"
28
-
29
- Runtime::Env.delegated.each do |env|
30
- command << %(-e #{env}="$#{env}") if ENV[env]
31
- end
32
-
33
- command << "-v #{Runtime::Env.screenshots_dir}:/home/qa/tmp"
34
- command << "--name #{name || ('gitlab-specs-' + Time.now.to_i)}"
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end