gitlab-qa 0.2.2 → 0.3.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 +4 -4
- data/.gitlab-ci.yml +9 -1
- data/CONTRIBUTING.md +19 -620
- data/README.md +20 -3
- data/lib/gitlab/qa.rb +10 -2
- data/lib/gitlab/qa/{docker → component}/gitlab.rb +55 -21
- data/lib/gitlab/qa/component/specs.rb +59 -0
- data/lib/gitlab/qa/docker/command.rb +17 -22
- data/lib/gitlab/qa/docker/engine.rb +1 -1
- data/lib/gitlab/qa/docker/shellout.rb +27 -0
- data/lib/gitlab/qa/release.rb +37 -15
- data/lib/gitlab/qa/runtime/env.rb +6 -1
- data/lib/gitlab/qa/scenario/test/instance/any.rb +7 -3
- data/lib/gitlab/qa/scenario/test/instance/image.rb +4 -9
- data/lib/gitlab/qa/scenario/test/integration/mattermost.rb +35 -0
- data/lib/gitlab/qa/scenario/test/omnibus/image.rb +4 -8
- data/lib/gitlab/qa/scenario/test/omnibus/upgrade.rb +6 -4
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +6 -4
- data/lib/gitlab/qa/docker/specs.rb +0 -40
@@ -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(
|
12
|
-
|
13
|
-
|
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 :
|
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
|
-
|
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
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
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
|
-
|
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(
|
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(
|
26
|
+
.perform(next_release) do |scenario|
|
25
27
|
scenario.volumes = volumes
|
26
28
|
end
|
27
29
|
end
|
data/lib/gitlab/qa/version.rb
CHANGED
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.
|
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-
|
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/
|
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
|