gitlab-qa 5.15.0 → 5.16.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 +40 -1
- data/lib/gitlab/qa.rb +1 -1
- data/lib/gitlab/qa/component/base.rb +10 -4
- data/lib/gitlab/qa/docker/command.rb +15 -3
- data/lib/gitlab/qa/docker/engine.rb +1 -1
- data/lib/gitlab/qa/docker/shellout.rb +2 -2
- data/lib/gitlab/qa/release.rb +3 -2
- data/lib/gitlab/qa/runtime/env.rb +9 -0
- 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/version.rb +1 -1
- metadata +3 -3
- data/lib/gitlab/qa/scenario/test/integration/gitaly_ha.rb +0 -166
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc79855be61afd8dfaef793cb1a6520bde1f07f6c44a18b9fdd605e26ac947c4
|
4
|
+
data.tar.gz: d326f64befb861020097fd55b9772b54d7014509e87c5c13c71e619c11a21a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e497734ed2d4d9d58c2dcdf051eb3a4a6ad02adcfc7954ae54ac83ee912b47ff0d6f8478ea6e272a8a93feb14cdda8d55632fb0f92e97379596a12b67ee25f57
|
7
|
+
data.tar.gz: fc927589ca591708a7b61341acf69d48125812642ce9ca87f0183cf11bcf14c55d6bfa8bb04fe1cf3c4685e1d4da0781bab6af15a942c0675ae149fac8b20704
|
data/.gitlab-ci.yml
CHANGED
@@ -832,6 +832,44 @@ ee:praefect-quarantine:
|
|
832
832
|
QA_CAN_TEST_PRAEFECT: "true"
|
833
833
|
QA_RSPEC_TAGS: "--tag quarantine --tag ~orchestrated"
|
834
834
|
|
835
|
+
ce:gitaly-cluster:
|
836
|
+
extends:
|
837
|
+
- .test
|
838
|
+
- .high-capacity
|
839
|
+
- .ce-qa
|
840
|
+
- .rspec-report-opts
|
841
|
+
variables:
|
842
|
+
QA_SCENARIO: "Test::Integration::GitalyCluster"
|
843
|
+
|
844
|
+
ce:gitaly-cluster-quarantine:
|
845
|
+
extends:
|
846
|
+
- .test
|
847
|
+
- .high-capacity
|
848
|
+
- .ce-qa
|
849
|
+
- .quarantine
|
850
|
+
- .rspec-report-opts
|
851
|
+
variables:
|
852
|
+
QA_SCENARIO: "Test::Integration::GitalyCluster"
|
853
|
+
|
854
|
+
ee:gitaly-cluster:
|
855
|
+
extends:
|
856
|
+
- .test
|
857
|
+
- .high-capacity
|
858
|
+
- .ee-qa
|
859
|
+
- .rspec-report-opts
|
860
|
+
variables:
|
861
|
+
QA_SCENARIO: "Test::Integration::GitalyCluster"
|
862
|
+
|
863
|
+
ee:gitaly-cluster-quarantine:
|
864
|
+
extends:
|
865
|
+
- .test
|
866
|
+
- .high-capacity
|
867
|
+
- .ee-qa
|
868
|
+
- .quarantine
|
869
|
+
- .rspec-report-opts
|
870
|
+
variables:
|
871
|
+
QA_SCENARIO: "Test::Integration::GitalyCluster"
|
872
|
+
|
835
873
|
ce:smtp:
|
836
874
|
extends:
|
837
875
|
- .test
|
@@ -893,7 +931,8 @@ ee:jira-quarantine:
|
|
893
931
|
staging:
|
894
932
|
script:
|
895
933
|
- unset EE_LICENSE
|
896
|
-
- exe/gitlab-qa Test::Instance::Staging
|
934
|
+
- 'echo "Running: exe/gitlab-qa Test::Instance::Staging ${RELEASE:=$DEFAULT_RELEASE} -- $QA_TESTS $QA_RSPEC_TAGS"'
|
935
|
+
- exe/gitlab-qa Test::Instance::Staging ${RELEASE:=$DEFAULT_RELEASE} -- $QA_TESTS $QA_RSPEC_TAGS
|
897
936
|
extends:
|
898
937
|
- .test
|
899
938
|
- .high-capacity
|
data/lib/gitlab/qa.rb
CHANGED
@@ -54,7 +54,7 @@ module Gitlab
|
|
54
54
|
autoload :Praefect, 'gitlab/qa/scenario/test/integration/praefect'
|
55
55
|
autoload :Elasticsearch, 'gitlab/qa/scenario/test/integration/elasticsearch'
|
56
56
|
autoload :SMTP, 'gitlab/qa/scenario/test/integration/smtp'
|
57
|
-
autoload :
|
57
|
+
autoload :GitalyCluster, 'gitlab/qa/scenario/test/integration/gitaly_cluster'
|
58
58
|
autoload :Jira, 'gitlab/qa/scenario/test/integration/jira'
|
59
59
|
end
|
60
60
|
|
@@ -42,6 +42,16 @@ module Gitlab
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def instance
|
45
|
+
instance_no_teardown do
|
46
|
+
yield self if block_given?
|
47
|
+
end
|
48
|
+
ensure
|
49
|
+
teardown
|
50
|
+
end
|
51
|
+
|
52
|
+
alias_method :launch_and_teardown_instance, :instance
|
53
|
+
|
54
|
+
def instance_no_teardown
|
45
55
|
prepare
|
46
56
|
start
|
47
57
|
reconfigure
|
@@ -49,12 +59,8 @@ module Gitlab
|
|
49
59
|
process_exec_commands
|
50
60
|
|
51
61
|
yield self if block_given?
|
52
|
-
ensure
|
53
|
-
teardown
|
54
62
|
end
|
55
63
|
|
56
|
-
alias_method :launch_and_teardown_instance, :instance
|
57
|
-
|
58
64
|
def prepare
|
59
65
|
prepare_docker_image
|
60
66
|
prepare_network
|
@@ -4,8 +4,9 @@ module Gitlab
|
|
4
4
|
class Command
|
5
5
|
attr_reader :args
|
6
6
|
|
7
|
-
def initialize(cmd = nil)
|
7
|
+
def initialize(cmd = nil, mask_secrets: nil)
|
8
8
|
@args = Array(cmd)
|
9
|
+
@mask_secrets = Array(mask_secrets)
|
9
10
|
end
|
10
11
|
|
11
12
|
def <<(*args)
|
@@ -28,6 +29,17 @@ module Gitlab
|
|
28
29
|
"docker #{@args.join(' ')}"
|
29
30
|
end
|
30
31
|
|
32
|
+
# Returns a masked string form of a Command
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
# Command.new('a docker command', mask_secrets: 'command').mask_secrets #=> 'a docker *****'
|
36
|
+
# Command.new('a docker command', mask_secrets: %w[docker command]).mask_secrets #=> 'a ***** *****'
|
37
|
+
#
|
38
|
+
# @return [String] The masked command string
|
39
|
+
def mask_secrets
|
40
|
+
@mask_secrets.each_with_object(to_s) { |secret, s| s.gsub!(secret, '*****') }
|
41
|
+
end
|
42
|
+
|
31
43
|
def ==(other)
|
32
44
|
to_s == other.to_s
|
33
45
|
end
|
@@ -36,8 +48,8 @@ module Gitlab
|
|
36
48
|
Docker::Shellout.new(self).execute!(&block)
|
37
49
|
end
|
38
50
|
|
39
|
-
def self.execute(cmd, &block)
|
40
|
-
new(cmd).execute!(&block)
|
51
|
+
def self.execute(cmd, mask_secrets: nil, &block)
|
52
|
+
new(cmd, mask_secrets: mask_secrets).execute!(&block)
|
41
53
|
end
|
42
54
|
end
|
43
55
|
end
|
@@ -10,7 +10,7 @@ module Gitlab
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def login(username:, password:, registry:)
|
13
|
-
Docker::Command.execute(%(login --username "#{username}" --password "#{password}" #{registry}))
|
13
|
+
Docker::Command.execute(%(login --username "#{username}" --password "#{password}" #{registry}), mask_secrets: password)
|
14
14
|
end
|
15
15
|
|
16
16
|
def pull(image, tag)
|
@@ -10,7 +10,7 @@ module Gitlab
|
|
10
10
|
@command = command
|
11
11
|
@output = []
|
12
12
|
|
13
|
-
puts "Docker shell command: `#{@command}`"
|
13
|
+
puts "Docker shell command: `#{@command.mask_secrets}`"
|
14
14
|
end
|
15
15
|
|
16
16
|
def execute!
|
@@ -28,7 +28,7 @@ module Gitlab
|
|
28
28
|
end
|
29
29
|
|
30
30
|
if wait.value.exited? && wait.value.exitstatus.nonzero?
|
31
|
-
raise StatusError, "Docker command `#{@command}` failed!"
|
31
|
+
raise StatusError, "Docker command `#{@command.mask_secrets}` failed!"
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
data/lib/gitlab/qa/release.rb
CHANGED
@@ -147,14 +147,15 @@ module Gitlab
|
|
147
147
|
registry: DEV_REGISTRY
|
148
148
|
}
|
149
149
|
elsif omnibus_mirror?
|
150
|
-
username, password = if Runtime::Env.ci_job_token
|
150
|
+
username, password = if Runtime::Env.ci_job_token && Runtime::Env.ci_pipeline_source == 'pipeline'
|
151
151
|
['gitlab-ci-token', Runtime::Env.ci_job_token]
|
152
|
+
elsif Runtime::Env.qa_container_registry_access_token
|
153
|
+
[Runtime::Env.gitlab_username, Runtime::Env.qa_container_registry_access_token]
|
152
154
|
else
|
153
155
|
Runtime::Env.require_qa_access_token!
|
154
156
|
|
155
157
|
[Runtime::Env.gitlab_username, Runtime::Env.qa_access_token]
|
156
158
|
end
|
157
|
-
|
158
159
|
{
|
159
160
|
username: username,
|
160
161
|
password: password,
|
@@ -38,6 +38,7 @@ module Gitlab
|
|
38
38
|
'SIGNUP_DISABLED' => :signup_disabled,
|
39
39
|
'QA_ADDITIONAL_REPOSITORY_STORAGE' => :qa_additional_repository_storage,
|
40
40
|
'QA_PRAEFECT_REPOSITORY_STORAGE' => :qa_praefect_repository_storage,
|
41
|
+
'QA_GITALY_NON_CLUSTER_STORAGE' => :qa_gitaly_non_cluster_storage,
|
41
42
|
'QA_COOKIES' => :qa_cookie,
|
42
43
|
'QA_DEBUG' => :qa_debug,
|
43
44
|
'QA_LOG_PATH' => :qa_log_path,
|
@@ -112,6 +113,10 @@ module Gitlab
|
|
112
113
|
ENV['CI_JOB_URL']
|
113
114
|
end
|
114
115
|
|
116
|
+
def ci_pipeline_source
|
117
|
+
ENV['CI_PIPELINE_SOURCE']
|
118
|
+
end
|
119
|
+
|
115
120
|
def ci_project_name
|
116
121
|
ENV['CI_PROJECT_NAME']
|
117
122
|
end
|
@@ -148,6 +153,10 @@ module Gitlab
|
|
148
153
|
ENV['GITLAB_QA_DEV_ACCESS_TOKEN']
|
149
154
|
end
|
150
155
|
|
156
|
+
def qa_container_registry_access_token
|
157
|
+
ENV['GITLAB_QA_CONTAINER_REGISTRY_ACCESS_TOKEN']
|
158
|
+
end
|
159
|
+
|
151
160
|
def host_artifacts_dir
|
152
161
|
@host_artifacts_dir ||= File.join(ENV['QA_ARTIFACTS_DIR'] || '/tmp/gitlab-qa', Runtime::Env.run_id)
|
153
162
|
end
|
@@ -27,13 +27,14 @@ module Gitlab
|
|
27
27
|
gitlab_rails['db_pool'] = 5;
|
28
28
|
gitlab_rails['geo_node_name'] = '#{primary.name}';
|
29
29
|
gitlab_rails['monitoring_whitelist'] = ['0.0.0.0/0'];
|
30
|
+
gitlab_rails['packages_enabled'] = true;
|
30
31
|
postgresql['listen_address'] = '0.0.0.0';
|
31
32
|
postgresql['max_replication_slots'] = 1;
|
32
33
|
postgresql['md5_auth_cidr_addresses'] = ['0.0.0.0/0'];
|
33
34
|
postgresql['sql_user_password'] = 'e1d1469ec5f533651918b4567a3ed1ae';
|
34
35
|
postgresql['trust_auth_cidr_addresses'] = ['0.0.0.0/0','0.0.0.0/0'];
|
35
36
|
sidekiq['concurrency'] = 2;
|
36
|
-
|
37
|
+
puma['worker_processes'] = 2;
|
37
38
|
OMNIBUS
|
38
39
|
primary.exec_commands = fast_ssh_key_lookup_commands + git_lfs_install_commands
|
39
40
|
|
@@ -50,11 +51,12 @@ module Gitlab
|
|
50
51
|
gitlab_rails['db_pool'] = 5;
|
51
52
|
gitlab_rails['geo_node_name'] = '#{secondary.name}';
|
52
53
|
gitlab_rails['monitoring_whitelist'] = ['0.0.0.0/0'];
|
54
|
+
gitlab_rails['packages_enabled'] = true;
|
53
55
|
postgresql['listen_address'] = '0.0.0.0';
|
54
56
|
postgresql['md5_auth_cidr_addresses'] = ['0.0.0.0/0'];
|
55
57
|
postgresql['sql_user_password'] = 'e1d1469ec5f533651918b4567a3ed1ae';
|
56
58
|
sidekiq['concurrency'] = 2;
|
57
|
-
|
59
|
+
puma['worker_processes'] = 2;
|
58
60
|
OMNIBUS
|
59
61
|
secondary.exec_commands = fast_ssh_key_lookup_commands + git_lfs_install_commands
|
60
62
|
|
@@ -0,0 +1,201 @@
|
|
1
|
+
module Gitlab
|
2
|
+
module QA
|
3
|
+
module Scenario
|
4
|
+
module Test
|
5
|
+
module Integration
|
6
|
+
class GitalyCluster < Scenario::Template
|
7
|
+
attr_reader :gitlab_name, :spec_suite
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@gitlab_name = 'gitlab-gitaly-ha'
|
11
|
+
@primary_node_name = 'gitaly1'
|
12
|
+
@secondary_node_name = 'gitaly2'
|
13
|
+
@tertiary_node_name = 'gitaly3'
|
14
|
+
@praefect_node_name = 'praefect'
|
15
|
+
@database = 'postgres'
|
16
|
+
@spec_suite = 'Test::Integration::GitalyHA'
|
17
|
+
@network = 'test'
|
18
|
+
end
|
19
|
+
|
20
|
+
# rubocop:disable Metrics/AbcSize
|
21
|
+
def perform(release, *rspec_args)
|
22
|
+
gitaly_primary_node = gitaly(@primary_node_name, release)
|
23
|
+
gitaly_secondary_node = gitaly(@secondary_node_name, release)
|
24
|
+
gitaly_tertiary_node = gitaly(@tertiary_node_name, release)
|
25
|
+
|
26
|
+
sql_node = Component::PostgreSQL.new.tap do |sql|
|
27
|
+
sql.name = @database
|
28
|
+
sql.network = @network
|
29
|
+
sql.instance_no_teardown do
|
30
|
+
sql.run_psql '-d template1 -c "CREATE DATABASE praefect_production OWNER postgres"'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
praefect_node = Component::Gitlab.new.tap do |praefect|
|
35
|
+
praefect.release = QA::Release.new(release)
|
36
|
+
praefect.name = @praefect_node_name
|
37
|
+
praefect.network = @network
|
38
|
+
praefect.skip_availability_check = true
|
39
|
+
|
40
|
+
praefect.omnibus_config = praefect_omnibus_configuration
|
41
|
+
|
42
|
+
praefect.instance_no_teardown
|
43
|
+
end
|
44
|
+
|
45
|
+
Component::Gitlab.perform do |gitlab|
|
46
|
+
gitlab.release = QA::Release.new(release)
|
47
|
+
gitlab.name = gitlab_name
|
48
|
+
gitlab.network = @network
|
49
|
+
|
50
|
+
gitlab.omnibus_config = gitlab_omnibus_configuration
|
51
|
+
gitlab.instance do
|
52
|
+
puts "Running Gitaly HA specs!"
|
53
|
+
|
54
|
+
Component::Specs.perform do |specs|
|
55
|
+
specs.suite = spec_suite
|
56
|
+
specs.release = gitlab.release
|
57
|
+
specs.network = gitlab.network
|
58
|
+
specs.args = [gitlab.address, *rspec_args]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
ensure
|
63
|
+
praefect_node&.teardown
|
64
|
+
sql_node&.teardown
|
65
|
+
gitaly_primary_node&.teardown
|
66
|
+
gitaly_secondary_node&.teardown
|
67
|
+
gitaly_tertiary_node&.teardown
|
68
|
+
end
|
69
|
+
# rubocop:enable Metrics/AbcSize
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def disable_other_services
|
74
|
+
<<~OMNIBUS
|
75
|
+
postgresql['enable'] = false;
|
76
|
+
redis['enable'] = false;
|
77
|
+
nginx['enable'] = false;
|
78
|
+
prometheus['enable'] = false;
|
79
|
+
grafana['enable'] = false;
|
80
|
+
puma['enable'] = false;
|
81
|
+
sidekiq['enable'] = false;
|
82
|
+
gitlab_workhorse['enable'] = false;
|
83
|
+
gitlab_rails['rake_cache_clear'] = false;
|
84
|
+
gitlab_rails['auto_migrate'] = false;
|
85
|
+
OMNIBUS
|
86
|
+
end
|
87
|
+
|
88
|
+
def praefect_omnibus_configuration
|
89
|
+
<<~OMNIBUS
|
90
|
+
#{disable_other_services}
|
91
|
+
gitaly['enable'] = false;
|
92
|
+
praefect['enable'] = true;
|
93
|
+
praefect['listen_addr'] = '0.0.0.0:2305';
|
94
|
+
praefect['prometheus_listen_addr'] = '0.0.0.0:9652';
|
95
|
+
praefect['auth_token'] = 'PRAEFECT_EXTERNAL_TOKEN';
|
96
|
+
praefect['database_host'] = '#{@database}.#{@network}';
|
97
|
+
praefect['database_user'] = 'postgres';
|
98
|
+
praefect['database_port'] = 5432;
|
99
|
+
praefect['database_password'] = 'SQL_PASSWORD';
|
100
|
+
praefect['database_dbname'] = 'praefect_production';
|
101
|
+
praefect['database_sslmode'] = 'disable';
|
102
|
+
praefect['postgres_queue_enabled'] = true;
|
103
|
+
praefect['failover_enabled'] = true;
|
104
|
+
praefect['virtual_storages'] = {
|
105
|
+
'default' => {
|
106
|
+
'#{@primary_node_name}' => {
|
107
|
+
'address' => 'tcp://#{@primary_node_name}.#{@network}:8075',
|
108
|
+
'token' => 'PRAEFECT_INTERNAL_TOKEN',
|
109
|
+
'primary' => true
|
110
|
+
},
|
111
|
+
'#{@secondary_node_name}' => {
|
112
|
+
'address' => 'tcp://#{@secondary_node_name}.#{@network}:8075',
|
113
|
+
'token' => 'PRAEFECT_INTERNAL_TOKEN'
|
114
|
+
},
|
115
|
+
'#{@tertiary_node_name}' => {
|
116
|
+
'address' => 'tcp://#{@tertiary_node_name}.#{@network}:8075',
|
117
|
+
'token' => 'PRAEFECT_INTERNAL_TOKEN'
|
118
|
+
}
|
119
|
+
}
|
120
|
+
};
|
121
|
+
OMNIBUS
|
122
|
+
end
|
123
|
+
|
124
|
+
def gitaly_omnibus_configuration
|
125
|
+
<<~OMNIBUS
|
126
|
+
#{disable_other_services}
|
127
|
+
prometheus['enable'] = true;
|
128
|
+
prometheus_monitoring['enable'] = false;
|
129
|
+
gitaly['enable'] = true;
|
130
|
+
gitaly['listen_addr'] = '0.0.0.0:8075';
|
131
|
+
gitaly['prometheus_listen_addr'] = '0.0.0.0:9236';
|
132
|
+
gitaly['auth_token'] = 'PRAEFECT_INTERNAL_TOKEN';
|
133
|
+
gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
|
134
|
+
gitlab_rails['internal_api_url'] = 'http://#{@gitlab_name}.#{@network}';
|
135
|
+
git_data_dirs({
|
136
|
+
'#{@primary_node_name}' => {
|
137
|
+
'path' => '/var/opt/gitlab/git-data'
|
138
|
+
},
|
139
|
+
'#{@secondary_node_name}' => {
|
140
|
+
'path' => '/var/opt/gitlab/git-data'
|
141
|
+
},
|
142
|
+
'#{@tertiary_node_name}' => {
|
143
|
+
'path' => '/var/opt/gitlab/git-data'
|
144
|
+
}
|
145
|
+
});
|
146
|
+
OMNIBUS
|
147
|
+
end
|
148
|
+
|
149
|
+
def gitlab_omnibus_configuration
|
150
|
+
<<~OMNIBUS
|
151
|
+
external_url 'http://#{@gitlab_name}.#{@network}';
|
152
|
+
|
153
|
+
git_data_dirs({
|
154
|
+
'default' => {
|
155
|
+
'gitaly_address' => 'tcp://#{@praefect_node_name}.#{@network}:2305',
|
156
|
+
'gitaly_token' => 'PRAEFECT_EXTERNAL_TOKEN'
|
157
|
+
}
|
158
|
+
});
|
159
|
+
gitaly['listen_addr'] = '0.0.0.0:8075';
|
160
|
+
gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
|
161
|
+
prometheus['scrape_configs'] = [
|
162
|
+
{
|
163
|
+
'job_name' => 'praefect',
|
164
|
+
'static_configs' => [
|
165
|
+
'targets' => [
|
166
|
+
'#{@praefect_node_name}.#{@network}:9652'
|
167
|
+
]
|
168
|
+
]
|
169
|
+
},
|
170
|
+
{
|
171
|
+
'job_name' => 'praefect-gitaly',
|
172
|
+
'static_configs' => [
|
173
|
+
'targets' => [
|
174
|
+
'#{@primary_node_name}.#{@network}:9236',
|
175
|
+
'#{@secondary_node_name}.#{@network}:9236',
|
176
|
+
'#{@tertiary_node_name}.#{@network}:9236'
|
177
|
+
]
|
178
|
+
]
|
179
|
+
}
|
180
|
+
];
|
181
|
+
grafana['disable_login_form'] = false;
|
182
|
+
grafana['admin_password'] = 'GRAFANA_ADMIN_PASSWORD';
|
183
|
+
OMNIBUS
|
184
|
+
end
|
185
|
+
|
186
|
+
def gitaly(name, release)
|
187
|
+
Component::Gitlab.new.tap do |gitaly|
|
188
|
+
gitaly.release = QA::Release.new(release)
|
189
|
+
gitaly.name = name
|
190
|
+
gitaly.network = @network
|
191
|
+
gitaly.skip_availability_check = true
|
192
|
+
gitaly.omnibus_config = gitaly_omnibus_configuration
|
193
|
+
gitaly.instance_no_teardown
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
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: 5.
|
4
|
+
version: 5.16.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-07-
|
11
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -284,7 +284,7 @@ files:
|
|
284
284
|
- lib/gitlab/qa/scenario/test/instance/staging_geo.rb
|
285
285
|
- lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
|
286
286
|
- lib/gitlab/qa/scenario/test/integration/geo.rb
|
287
|
-
- lib/gitlab/qa/scenario/test/integration/
|
287
|
+
- lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb
|
288
288
|
- lib/gitlab/qa/scenario/test/integration/group_saml.rb
|
289
289
|
- lib/gitlab/qa/scenario/test/integration/instance_saml.rb
|
290
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
|