gitlab-qa 5.13.7 → 5.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +42 -1
- data/README.md +52 -5
- data/docs/what_tests_can_be_run.md +97 -5
- data/lib/gitlab/qa.rb +2 -1
- data/lib/gitlab/qa/component/base.rb +32 -7
- data/lib/gitlab/qa/component/gitlab.rb +2 -1
- data/lib/gitlab/qa/component/specs.rb +44 -12
- data/lib/gitlab/qa/docker/command.rb +15 -3
- data/lib/gitlab/qa/docker/engine.rb +17 -2
- data/lib/gitlab/qa/docker/shellout.rb +2 -2
- data/lib/gitlab/qa/release.rb +17 -4
- data/lib/gitlab/qa/runner.rb +23 -15
- data/lib/gitlab/qa/runtime/env.rb +15 -6
- data/lib/gitlab/qa/scenario/test/instance/airgapped.rb +68 -0
- data/lib/gitlab/qa/scenario/test/instance/geo.rb +0 -3
- data/lib/gitlab/qa/scenario/test/integration/geo.rb +4 -2
- data/lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb +201 -0
- data/lib/gitlab/qa/scenario/test/integration/praefect.rb +18 -7
- data/lib/gitlab/qa/scenario/test/sanity/version.rb +1 -1
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +4 -3
- data/lib/gitlab/qa/scenario/test/integration/gitaly_ha.rb +0 -166
@@ -13,7 +13,11 @@ module Gitlab
|
|
13
13
|
gitlab.name = 'gitlab'
|
14
14
|
gitlab.network = 'test'
|
15
15
|
gitlab.volumes = volumes
|
16
|
-
gitlab.exec_commands = [
|
16
|
+
gitlab.exec_commands = [
|
17
|
+
'gitlab-psql -d template1 -c "CREATE DATABASE praefect_production OWNER gitlab"',
|
18
|
+
'mkdir -p /var/opt/gitlab/git-data/repositories/praefect',
|
19
|
+
'chown -R git:root /var/opt/gitlab/git-data/repositories'
|
20
|
+
]
|
17
21
|
|
18
22
|
gitlab.act do
|
19
23
|
prepare
|
@@ -21,7 +25,7 @@ module Gitlab
|
|
21
25
|
reconfigure
|
22
26
|
process_exec_commands
|
23
27
|
wait
|
24
|
-
teardown
|
28
|
+
teardown!
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
@@ -61,21 +65,25 @@ module Gitlab
|
|
61
65
|
def omnibus_config_with_praefect
|
62
66
|
<<~OMNIBUS
|
63
67
|
gitaly['enable'] = true;
|
64
|
-
gitaly['auth_token'] = '
|
68
|
+
gitaly['auth_token'] = 'secret-token';
|
65
69
|
gitaly['storage'] = [
|
66
70
|
{
|
67
71
|
'name' => 'praefect-gitaly-0',
|
68
|
-
'path' => '/var/opt/gitlab/git-data/repositories'
|
72
|
+
'path' => '/var/opt/gitlab/git-data/repositories/praefect'
|
73
|
+
},
|
74
|
+
{
|
75
|
+
'name' => 'gitaly',
|
76
|
+
'path' => '/var/opt/gitlab/git-data/repositories/gitaly'
|
69
77
|
}
|
70
78
|
];
|
71
79
|
praefect['enable'] = true;
|
72
80
|
praefect['listen_addr'] = '0.0.0.0:2305';
|
73
|
-
praefect['auth_token'] = '
|
81
|
+
praefect['auth_token'] = 'secret-token';
|
74
82
|
praefect['virtual_storages'] = {
|
75
83
|
'default' => {
|
76
84
|
'praefect-gitaly-0' => {
|
77
85
|
'address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket',
|
78
|
-
'token' => '
|
86
|
+
'token' => 'secret-token',
|
79
87
|
'primary' => true
|
80
88
|
}
|
81
89
|
}
|
@@ -84,10 +92,13 @@ module Gitlab
|
|
84
92
|
praefect['database_user'] = 'gitlab';
|
85
93
|
praefect['database_dbname'] = 'praefect_production';
|
86
94
|
praefect['postgres_queue_enabled'] = true;
|
87
|
-
gitlab_rails['gitaly_token'] = '
|
95
|
+
gitlab_rails['gitaly_token'] = 'secret-token';
|
88
96
|
git_data_dirs({
|
89
97
|
'default' => {
|
90
98
|
'gitaly_address' => 'tcp://localhost:2305'
|
99
|
+
},
|
100
|
+
'gitaly' => {
|
101
|
+
'path' => '/var/opt/gitlab/git-data/repositories/gitaly'
|
91
102
|
}
|
92
103
|
});
|
93
104
|
OMNIBUS
|
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: 5.
|
4
|
+
version: 5.17.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: 2020-
|
11
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -269,6 +269,7 @@ files:
|
|
269
269
|
- lib/gitlab/qa/scenario/actable.rb
|
270
270
|
- lib/gitlab/qa/scenario/cli_commands.rb
|
271
271
|
- lib/gitlab/qa/scenario/template.rb
|
272
|
+
- lib/gitlab/qa/scenario/test/instance/airgapped.rb
|
272
273
|
- lib/gitlab/qa/scenario/test/instance/any.rb
|
273
274
|
- lib/gitlab/qa/scenario/test/instance/deployment_base.rb
|
274
275
|
- lib/gitlab/qa/scenario/test/instance/geo.rb
|
@@ -283,7 +284,7 @@ files:
|
|
283
284
|
- lib/gitlab/qa/scenario/test/instance/staging_geo.rb
|
284
285
|
- lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
|
285
286
|
- lib/gitlab/qa/scenario/test/integration/geo.rb
|
286
|
-
- lib/gitlab/qa/scenario/test/integration/
|
287
|
+
- lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb
|
287
288
|
- lib/gitlab/qa/scenario/test/integration/group_saml.rb
|
288
289
|
- lib/gitlab/qa/scenario/test/integration/instance_saml.rb
|
289
290
|
- lib/gitlab/qa/scenario/test/integration/jira.rb
|
@@ -1,166 +0,0 @@
|
|
1
|
-
module Gitlab
|
2
|
-
module QA
|
3
|
-
module Scenario
|
4
|
-
module Test
|
5
|
-
module Integration
|
6
|
-
class GitalyHA < Scenario::Template
|
7
|
-
attr_reader :gitlab_name, :spec_suite
|
8
|
-
|
9
|
-
def initialize
|
10
|
-
@gitlab_name = 'gitlab-gitaly-ha'
|
11
|
-
@primary_node = 'gitaly1'
|
12
|
-
@secondary_node = 'gitaly2'
|
13
|
-
@praefect_node = 'praefect'
|
14
|
-
@database = 'postgres'
|
15
|
-
@spec_suite = 'Test::Integration::GitalyHA'
|
16
|
-
@network = 'test'
|
17
|
-
end
|
18
|
-
|
19
|
-
# rubocop:disable Metrics/AbcSize
|
20
|
-
def perform(release, *rspec_args)
|
21
|
-
gitaly(@primary_node, release) do
|
22
|
-
gitaly(@secondary_node, release) do
|
23
|
-
Component::PostgreSQL.perform do |sql|
|
24
|
-
sql.name = @database
|
25
|
-
sql.network = @network
|
26
|
-
|
27
|
-
sql.instance do
|
28
|
-
sql.run_psql '-d template1 -c "CREATE DATABASE praefect_production OWNER postgres"'
|
29
|
-
|
30
|
-
Component::Gitlab.perform do |praefect|
|
31
|
-
praefect.release = QA::Release.new(release)
|
32
|
-
praefect.name = @praefect_node
|
33
|
-
praefect.network = @network
|
34
|
-
praefect.skip_availability_check = true
|
35
|
-
|
36
|
-
praefect.omnibus_config = praefect_omnibus_configuration
|
37
|
-
|
38
|
-
praefect.instance do
|
39
|
-
Component::Gitlab.perform do |gitlab|
|
40
|
-
gitlab.release = QA::Release.new(release)
|
41
|
-
gitlab.name = gitlab_name
|
42
|
-
gitlab.network = @network
|
43
|
-
|
44
|
-
gitlab.omnibus_config = gitlab_omnibus_configuration
|
45
|
-
gitlab.instance do
|
46
|
-
puts "Running Gitaly HA specs!"
|
47
|
-
|
48
|
-
Component::Specs.perform do |specs|
|
49
|
-
specs.suite = spec_suite
|
50
|
-
specs.release = gitlab.release
|
51
|
-
specs.network = gitlab.network
|
52
|
-
specs.args = [gitlab.address, *rspec_args]
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
# rubocop:enable Metrics/AbcSize
|
64
|
-
|
65
|
-
private
|
66
|
-
|
67
|
-
def disable_other_services
|
68
|
-
<<~OMNIBUS
|
69
|
-
postgresql['enable'] = false;
|
70
|
-
redis['enable'] = false;
|
71
|
-
nginx['enable'] = false;
|
72
|
-
prometheus['enable'] = false;
|
73
|
-
grafana['enable'] = false;
|
74
|
-
unicorn['enable'] = false;
|
75
|
-
sidekiq['enable'] = false;
|
76
|
-
gitlab_workhorse['enable'] = false;
|
77
|
-
gitlab_rails['rake_cache_clear'] = false;
|
78
|
-
gitlab_rails['auto_migrate'] = false;
|
79
|
-
OMNIBUS
|
80
|
-
end
|
81
|
-
|
82
|
-
def praefect_omnibus_configuration
|
83
|
-
<<~OMNIBUS
|
84
|
-
#{disable_other_services}
|
85
|
-
gitaly['enable'] = false;
|
86
|
-
praefect['enable'] = true;
|
87
|
-
praefect['listen_addr'] = '0.0.0.0:2305';
|
88
|
-
praefect['prometheus_listen_addr'] = '0.0.0.0:9652';
|
89
|
-
praefect['auth_token'] = 'PRAEFECT_EXTERNAL_TOKEN';
|
90
|
-
praefect['database_host'] = '#{@database}.#{@network}';
|
91
|
-
praefect['database_user'] = 'postgres';
|
92
|
-
praefect['database_port'] = 5432;
|
93
|
-
praefect['database_password'] = 'SQL_PASSWORD';
|
94
|
-
praefect['database_dbname'] = 'praefect_production';
|
95
|
-
praefect['database_sslmode'] = 'disable';
|
96
|
-
praefect['postgres_queue_enabled'] = true;
|
97
|
-
praefect['failover_enabled'] = true;
|
98
|
-
praefect['virtual_storages'] = {
|
99
|
-
'default' => {
|
100
|
-
'#{@primary_node}' => {
|
101
|
-
'address' => 'tcp://#{@primary_node}.#{@network}:8075',
|
102
|
-
'token' => 'PRAEFECT_INTERNAL_TOKEN',
|
103
|
-
'primary' => true
|
104
|
-
},
|
105
|
-
'#{@secondary_node}' => {
|
106
|
-
'address' => 'tcp://#{@secondary_node}.#{@network}:8075',
|
107
|
-
'token' => 'PRAEFECT_INTERNAL_TOKEN'
|
108
|
-
}
|
109
|
-
}
|
110
|
-
};
|
111
|
-
OMNIBUS
|
112
|
-
end
|
113
|
-
|
114
|
-
def gitaly_omnibus_configuration
|
115
|
-
<<~OMNIBUS
|
116
|
-
#{disable_other_services}
|
117
|
-
prometheus_monitoring['enable'] = false;
|
118
|
-
gitaly['enable'] = true;
|
119
|
-
gitaly['listen_addr'] = '0.0.0.0:8075';
|
120
|
-
gitaly['prometheus_listen_addr'] = '0.0.0.0:9236';
|
121
|
-
gitaly['auth_token'] = 'PRAEFECT_INTERNAL_TOKEN';
|
122
|
-
gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
|
123
|
-
gitlab_rails['internal_api_url'] = 'http://#{@gitlab_name}.#{@network}';
|
124
|
-
git_data_dirs({
|
125
|
-
'#{@primary_node}' => {
|
126
|
-
'path' => '/var/opt/gitlab/git-data'
|
127
|
-
},
|
128
|
-
'#{@secondary_node}' => {
|
129
|
-
'path' => '/var/opt/gitlab/git-data'
|
130
|
-
}
|
131
|
-
});
|
132
|
-
OMNIBUS
|
133
|
-
end
|
134
|
-
|
135
|
-
def gitlab_omnibus_configuration
|
136
|
-
<<~OMNIBUS
|
137
|
-
git_data_dirs({
|
138
|
-
'default' => {
|
139
|
-
'gitaly_address' => 'tcp://#{@praefect_node}.#{@network}:2305',
|
140
|
-
'gitaly_token' => 'PRAEFECT_EXTERNAL_TOKEN'
|
141
|
-
}
|
142
|
-
});
|
143
|
-
gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
|
144
|
-
OMNIBUS
|
145
|
-
end
|
146
|
-
|
147
|
-
def gitaly(name, release)
|
148
|
-
Component::Gitlab.perform do |gitaly|
|
149
|
-
gitaly.release = QA::Release.new(release)
|
150
|
-
gitaly.name = name
|
151
|
-
gitaly.network = @network
|
152
|
-
gitaly.skip_availability_check = true
|
153
|
-
|
154
|
-
gitaly.omnibus_config = gitaly_omnibus_configuration
|
155
|
-
|
156
|
-
gitaly.instance do
|
157
|
-
yield self
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
166
|
-
end
|