gitlab-qa 6.23.0 → 7.0.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 +2 -1
- data/docs/configuring_omnibus.md +208 -0
- data/gitlab-qa.gemspec +1 -1
- data/lib/gitlab/qa.rb +7 -0
- data/lib/gitlab/qa/component/gitlab.rb +34 -23
- data/lib/gitlab/qa/component/minio.rb +2 -10
- data/lib/gitlab/qa/docker/engine.rb +26 -1
- data/lib/gitlab/qa/runner.rb +52 -5
- data/lib/gitlab/qa/runtime/env.rb +1 -0
- data/lib/gitlab/qa/runtime/omnibus_configuration.rb +69 -0
- data/lib/gitlab/qa/runtime/omnibus_configurations/default.rb +25 -0
- data/lib/gitlab/qa/runtime/omnibus_configurations/object_storage.rb +48 -0
- data/lib/gitlab/qa/runtime/omnibus_configurations/packages.rb +17 -0
- data/lib/gitlab/qa/scenario/cli_commands.rb +3 -3
- data/lib/gitlab/qa/scenario/test/instance/relative_url.rb +1 -3
- data/lib/gitlab/qa/scenario/test/instance/repository_storage.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/actioncable.rb +1 -3
- data/lib/gitlab/qa/scenario/test/integration/geo.rb +4 -5
- data/lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb +3 -3
- data/lib/gitlab/qa/scenario/test/integration/group_saml.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/instance_saml.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/kubernetes.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/ldap_no_server.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/ldap_no_tls.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/ldap_tls.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/mattermost.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/mtls.rb +2 -2
- data/lib/gitlab/qa/scenario/test/integration/smtp.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/ssh_tunnel.rb +1 -1
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +9 -6
- data/lib/gitlab/qa/scenario/test/integration/object_storage.rb +0 -64
- data/lib/gitlab/qa/scenario/test/integration/packages.rb +0 -36
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce83d37d177260e577ff1ffbc8e606eab4bc449953d8fc9de669404371433014
|
|
4
|
+
data.tar.gz: ef2a8ba114e9799c4d8b4cc71f3c098ac708b79e8573486305b9802d6bdf1826
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22d88835fee7158e9e5829e5d5e415abfa85d157148514c21eb904eecf69a8e8c4a49dc6e3aaae0e35824fc8f3a2be2d0c983f2f8057c915bcd0332a2fbea41f
|
|
7
|
+
data.tar.gz: 6e8007813c6258741ba516b011b8a5fc7efa1ee1ada5c385580477a18b02c35ac8e232370a80395fd3259f98058abaaffe11941c7ec9f8108a19dd36aafa4df3
|
data/.gitlab-ci.yml
CHANGED
|
@@ -18,7 +18,8 @@ default:
|
|
|
18
18
|
- vendor/ruby
|
|
19
19
|
before_script:
|
|
20
20
|
- bundle version
|
|
21
|
-
- bundle
|
|
21
|
+
- bundle config path vendor
|
|
22
|
+
- bundle install --jobs=$(nproc) --retry=3 --quiet && bundle check
|
|
22
23
|
- if [ -n "$TRIGGERED_USER" ] && [ -n "$TRIGGER_SOURCE" ]; then
|
|
23
24
|
echo "Pipeline triggered by $TRIGGERED_USER at $TRIGGER_SOURCE";
|
|
24
25
|
fi
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Configuring Omnibus
|
|
2
|
+
|
|
3
|
+
Omnibus will, by default, contain the configuration specified in `Gitlab::QA::Runtime::OmnibusConfigurations::Default`.
|
|
4
|
+
|
|
5
|
+
Omnibus can be configured from two places:
|
|
6
|
+
|
|
7
|
+
1. Within a custom `Scenario::Template`.
|
|
8
|
+
1. Represented as a `Gitlab::QA::Runtime::OmnibusConfiguration` class.
|
|
9
|
+
|
|
10
|
+
## Adding an Omnibus Configurator
|
|
11
|
+
|
|
12
|
+
All configurators are held within `Gitlab::QA::Runtime::OmnibusConfigurations` and represented as separate classes.
|
|
13
|
+
|
|
14
|
+
Notes:
|
|
15
|
+
|
|
16
|
+
- If it is required that more than one GitLab instance is configured,
|
|
17
|
+
you may skip adding an Omnibus Configurator. In this case, it should be handled by a separate `Scenario::Template`.
|
|
18
|
+
An example of this would be a Geo Primary and Secondary.
|
|
19
|
+
- All classes should be a type of `Runtime::OmnibusConfiguration`.
|
|
20
|
+
|
|
21
|
+
### Add the Configurator Class
|
|
22
|
+
|
|
23
|
+
Create a new file in `lib/gitlab/qa/runtime/omnibus_configurations` called `registry.rb`.
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
# frozen_string_literal: true
|
|
27
|
+
|
|
28
|
+
module Gitlab
|
|
29
|
+
module QA
|
|
30
|
+
module Runtime
|
|
31
|
+
module OmnibusConfigurations
|
|
32
|
+
class Registry < Default
|
|
33
|
+
def configuration
|
|
34
|
+
<<~OMNIBUS
|
|
35
|
+
gitlab_rails['registry_enabled'] = true
|
|
36
|
+
OMNIBUS
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Notes:
|
|
46
|
+
|
|
47
|
+
- Refrain from adding unnecessary statement terminations (`;`).
|
|
48
|
+
|
|
49
|
+
### Prepare Sidecar Container
|
|
50
|
+
|
|
51
|
+
If the tests require an additional container to be spun up adjacent to GitLab, you may override the `prepare` method.
|
|
52
|
+
|
|
53
|
+
```ruby
|
|
54
|
+
#=> lib/gitlab/qa/runtime/omnibus_configurations/registry.rb
|
|
55
|
+
|
|
56
|
+
# frozen_string_literal: true
|
|
57
|
+
|
|
58
|
+
module Gitlab
|
|
59
|
+
module QA
|
|
60
|
+
module Runtime
|
|
61
|
+
module OmnibusConfigurations
|
|
62
|
+
class Registry < Default
|
|
63
|
+
def configuration
|
|
64
|
+
<<~OMNIBUS
|
|
65
|
+
gitlab_rails['registry_enabled'] = true
|
|
66
|
+
OMNIBUS
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def prepare
|
|
70
|
+
Component::Sidecar.new
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Notes:
|
|
80
|
+
|
|
81
|
+
- `prepare` **must** return an instance of `Component::Base`.
|
|
82
|
+
- The sidecar container will be prepared before the test runs, and will run the tests after it is running.
|
|
83
|
+
- Extending the class from `Default` is only a nicety that adds a singleton method called `Registry.configuration` and returns the configuration.
|
|
84
|
+
It is recommended to extend from `Default`, but you may also extend from any other Omnibus Configuration class, including `Runtime::OmnibusConfiguration`.
|
|
85
|
+
|
|
86
|
+
## Running tests with Omnibus Configured
|
|
87
|
+
|
|
88
|
+
All Omnibus Configurators can be called by passing arguments into the `gitlab-qa` executable.
|
|
89
|
+
|
|
90
|
+
```shell
|
|
91
|
+
exe/gitlab-qa Test::Instance::Image EE --omnibus-config registry
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Notes:
|
|
95
|
+
|
|
96
|
+
- `--omnibus-config registry` must match the name of the Omnibus Configurator Class name (`Runtime::OmnibusConfigurations::Registry`), but lowercase.
|
|
97
|
+
- If the Configurator Class name contains several words, the argument will be named the same, but snake cased. E.g. `--omnibus-config some_class` matches `SomeClass`, `--omnibus-config some_other_class` matches `SomeOtherClass`.
|
|
98
|
+
- The Omnibus GitLab Instance will have the configuration from `Default` and `Registry` (in that order) put into `/etc/gitlab/gitlab.rb` and GitLab QA will proceed to run the tests.
|
|
99
|
+
- If a specified Omnibus Configuration does not exist, GitLab QA will raise an error and fail immediately.
|
|
100
|
+
|
|
101
|
+
## Further reading
|
|
102
|
+
|
|
103
|
+
### Multiple Configurators
|
|
104
|
+
|
|
105
|
+
Multiple Configurators may be specified and the order will be preserved in which the arguments were passed.
|
|
106
|
+
|
|
107
|
+
E.g., given the arguments:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
exe/gitlab-qa Test::Instance::Image EE --omnibus-config packages,registry
|
|
111
|
+
# or
|
|
112
|
+
exe/gitlab-qa Test::Instance::Image EE --omnibus-config packages --omnibus-config registry
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Omnibus will be configured in the order they appear.
|
|
116
|
+
|
|
117
|
+
```ruby
|
|
118
|
+
# /etc/gitlab/gitlab.rb
|
|
119
|
+
#=> Runtime::OmnibusConfiguration::Default#configuration
|
|
120
|
+
#=> Runtime::OmnibusConfiguration::Packages#configuration
|
|
121
|
+
#=> Runtime::OmnibusConfiguration::Registry#configuration
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The order is also preserved for Sidecar containers. If the `Packages` and `Registry` Configurators each prepare a sidecar container, they will be spun up in order from first to last.
|
|
125
|
+
|
|
126
|
+
### Adding one-off configurations
|
|
127
|
+
|
|
128
|
+
#### From a new Scenario::Template
|
|
129
|
+
|
|
130
|
+
If it is required to create a new `Scenario::Template`, you may add new Configurations to the respective GitLab Instances by invoking `omnibus_configuration#<<`
|
|
131
|
+
|
|
132
|
+
```ruby
|
|
133
|
+
# Geo example
|
|
134
|
+
|
|
135
|
+
Component::Gitlab.perform do |primary|
|
|
136
|
+
primary.omnibus_configuration << <<~OMNIBUS
|
|
137
|
+
geo_primary_role['enable'] = true
|
|
138
|
+
OMNIBUS
|
|
139
|
+
|
|
140
|
+
primary.instance do
|
|
141
|
+
Component::Gitlab.perform do |secondary|
|
|
142
|
+
secondary.omnibus_configuration << <<~OMNIBUS
|
|
143
|
+
geo_secondary_role['enable'] = true
|
|
144
|
+
OMNIBUS
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Notes:
|
|
151
|
+
|
|
152
|
+
- The `primary` instance will be configured using the `Runtime::OmnibusConfigurations::Default` configuration, *then* `geo_primary_role['enable'] = true` will be affixed afterwards.
|
|
153
|
+
- The `secondary` instance will be configured using the `Runtime::OmnibusConfigurations::Default` configuration, *then* `geo_secondary_role['enable'] = true` will be affixed afterwards.
|
|
154
|
+
|
|
155
|
+
#### From Component::Gitlab
|
|
156
|
+
|
|
157
|
+
Any additional one-off configurations needing to be added may be directly appended to `@omnibus_configuration` as such:
|
|
158
|
+
|
|
159
|
+
```ruby
|
|
160
|
+
disable_animations = true
|
|
161
|
+
|
|
162
|
+
@omnibus_configuration << "gitlab_rails['gitlab_disable_animations'] = true" if disable_animations
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
This will add the specified configuration **after** what has already been specified beforehand (Configurators or Default configurations).
|
|
166
|
+
|
|
167
|
+
Note:
|
|
168
|
+
|
|
169
|
+
- If there is no issue appending this configuration to the **rest** of the GitLab Instances that might be spun up, you can add this
|
|
170
|
+
to the global Omnibus Configuration. E.g., use `Runtime::Scenario.omnibus_configuration << ...` instead of `@omnibus_configuration << ...`
|
|
171
|
+
|
|
172
|
+
#### Difference between Runtime::Scenario.omnibus_configuration and Gitlab#omnibus_configuration
|
|
173
|
+
|
|
174
|
+
Generally, while running GitLab QA, only one GitLab instance is necessary. `Runtime::Scenario.omnibus_configuration` contains all of the global
|
|
175
|
+
Omnibus configurations required for this one environment. This also contains the configuration for any other GitLab instance.
|
|
176
|
+
|
|
177
|
+
When multiple GitLab Instances are required, `@omnibus_configuration#<<` is preferred over `Runtime::Scenario.omnibus_configuration#<<` since the First Instance might require
|
|
178
|
+
one Omnibus configuration that might be unneccesary or Invalid for the Second Instance.
|
|
179
|
+
|
|
180
|
+
#### Load order and precedence
|
|
181
|
+
|
|
182
|
+
1. `Runtime::OmnibusConfigurations::Default`
|
|
183
|
+
1. `Runtime::OmnibusConfigurations::[A,B,...]` where `A` and `B` are Configurators specified through the positional arguments `--a --b`
|
|
184
|
+
1. Custom written `Scenario::Template` (such as `Test::Integation::Geo`)
|
|
185
|
+
1. `lib/gitlab/qa/component/gitlab.rb`
|
|
186
|
+
|
|
187
|
+
From top to bottom, configurations will be loaded and any configurations that are superceded, will take precedence over the one before it, and so on.
|
|
188
|
+
|
|
189
|
+
### Executing arbitrary shell commands within the GitLab Instance
|
|
190
|
+
|
|
191
|
+
Sometimes it's necessary to execute arbitrary commands within the GitLab instance before the tests start.
|
|
192
|
+
|
|
193
|
+
You may specify these commands by overriding the `exec_commands` method within the Configurator.
|
|
194
|
+
|
|
195
|
+
```ruby
|
|
196
|
+
class Registry < Default
|
|
197
|
+
def configuration
|
|
198
|
+
# configuration
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def exec_commands
|
|
202
|
+
[
|
|
203
|
+
'cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab.bak.rb',
|
|
204
|
+
'rm /etc/gitlab/gitlab.bak.rb'
|
|
205
|
+
]
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
```
|
data/gitlab-qa.gemspec
CHANGED
|
@@ -31,5 +31,5 @@ Gem::Specification.new do |spec|
|
|
|
31
31
|
spec.add_runtime_dependency 'gitlab', '~> 4.16.1'
|
|
32
32
|
spec.add_runtime_dependency 'http', '4.3.0'
|
|
33
33
|
spec.add_runtime_dependency 'nokogiri', '~> 1.10'
|
|
34
|
-
spec.add_runtime_dependency 'table_print', '1.5.
|
|
34
|
+
spec.add_runtime_dependency 'table_print', '1.5.7'
|
|
35
35
|
end
|
data/lib/gitlab/qa.rb
CHANGED
|
@@ -8,6 +8,13 @@ module Gitlab
|
|
|
8
8
|
autoload :Env, 'gitlab/qa/runtime/env'
|
|
9
9
|
autoload :Scenario, 'gitlab/qa/runtime/scenario'
|
|
10
10
|
autoload :TokenFinder, 'gitlab/qa/runtime/token_finder'
|
|
11
|
+
autoload :OmnibusConfiguration, 'gitlab/qa/runtime/omnibus_configuration'
|
|
12
|
+
|
|
13
|
+
module OmnibusConfigurations
|
|
14
|
+
autoload :Default, 'gitlab/qa/runtime/omnibus_configurations/default'
|
|
15
|
+
autoload :Packages, 'gitlab/qa/runtime/omnibus_configurations/packages'
|
|
16
|
+
autoload :ObjectStorage, 'gitlab/qa/runtime/omnibus_configurations/object_storage'
|
|
17
|
+
end
|
|
11
18
|
end
|
|
12
19
|
|
|
13
20
|
module Scenario
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'securerandom'
|
|
2
4
|
require 'net/http'
|
|
3
5
|
require 'uri'
|
|
@@ -10,39 +12,36 @@ module Gitlab
|
|
|
10
12
|
class Gitlab < Base
|
|
11
13
|
extend Forwardable
|
|
12
14
|
|
|
13
|
-
attr_reader :release
|
|
14
|
-
attr_accessor :tls, :
|
|
15
|
+
attr_reader :release, :omnibus_configuration
|
|
16
|
+
attr_accessor :tls, :skip_availability_check, :runner_network
|
|
15
17
|
attr_writer :name, :relative_path
|
|
16
18
|
|
|
17
19
|
def_delegators :release, :tag, :image, :edition
|
|
18
20
|
|
|
19
|
-
AUTHORITY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/authority'
|
|
20
|
-
GITLAB_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitlab'
|
|
21
|
-
GITALY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitaly'
|
|
21
|
+
AUTHORITY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/authority', __dir__)
|
|
22
|
+
GITLAB_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitlab', __dir__)
|
|
23
|
+
GITALY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitaly', __dir__)
|
|
22
24
|
|
|
23
|
-
SSL_PATH = '/etc/gitlab/ssl'
|
|
24
|
-
TRUSTED_PATH = '/etc/gitlab/trusted-certs'
|
|
25
|
+
SSL_PATH = '/etc/gitlab/ssl'
|
|
26
|
+
TRUSTED_PATH = '/etc/gitlab/trusted-certs'
|
|
25
27
|
|
|
26
28
|
def initialize
|
|
27
29
|
super
|
|
28
30
|
|
|
29
|
-
@disable_animations = true
|
|
30
31
|
@skip_availability_check = false
|
|
31
32
|
|
|
32
33
|
@volumes[GITLAB_CERTIFICATES_PATH] = SSL_PATH
|
|
33
34
|
@volumes[AUTHORITY_CERTIFICATES_PATH] = TRUSTED_PATH
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
end
|
|
36
|
+
@omnibus_configuration ||= OmnibusConfiguration.new
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
@environment['GITLAB_OMNIBUS_CONFIG'] = config.tr("\n", ' ')
|
|
38
|
+
self.release = 'CE'
|
|
40
39
|
end
|
|
41
40
|
|
|
42
41
|
def set_formless_login_token
|
|
43
42
|
return if Runtime::Env.gitlab_qa_formless_login_token.to_s.strip.empty?
|
|
44
43
|
|
|
45
|
-
@
|
|
44
|
+
@omnibus_configuration << "gitlab_rails['env'] = { 'GITLAB_QA_FORMLESS_LOGIN_TOKEN' => '#{Runtime::Env.gitlab_qa_formless_login_token}' }"
|
|
46
45
|
end
|
|
47
46
|
|
|
48
47
|
def elastic_url=(url)
|
|
@@ -95,17 +94,7 @@ module Gitlab
|
|
|
95
94
|
end
|
|
96
95
|
|
|
97
96
|
def prepare_gitlab_omnibus_config
|
|
98
|
-
setup_disable_animations if disable_animations
|
|
99
97
|
set_formless_login_token
|
|
100
|
-
setup_application_settings_cache_expiry
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
def setup_disable_animations
|
|
104
|
-
@environment['GITLAB_OMNIBUS_CONFIG'] = "gitlab_rails['gitlab_disable_animations'] = true; #{@environment['GITLAB_OMNIBUS_CONFIG'] || ''}"
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
def setup_application_settings_cache_expiry
|
|
108
|
-
@environment['GITLAB_OMNIBUS_CONFIG'] = "gitlab_rails['application_settings_cache_seconds'] = 0; #{@environment['GITLAB_OMNIBUS_CONFIG'] || ''}"
|
|
109
98
|
end
|
|
110
99
|
|
|
111
100
|
def start # rubocop:disable Metrics/AbcSize
|
|
@@ -135,6 +124,8 @@ module Gitlab
|
|
|
135
124
|
end
|
|
136
125
|
|
|
137
126
|
def reconfigure
|
|
127
|
+
setup_omnibus
|
|
128
|
+
|
|
138
129
|
@docker.attach(name) do |line, wait|
|
|
139
130
|
puts line
|
|
140
131
|
# TODO, workaround which allows to detach from the container
|
|
@@ -170,6 +161,12 @@ module Gitlab
|
|
|
170
161
|
raise 'Please configure an instance first!' unless [name, release, network].all?
|
|
171
162
|
end
|
|
172
163
|
|
|
164
|
+
def setup_omnibus
|
|
165
|
+
@docker.write_files(name) do |f|
|
|
166
|
+
f.write('/etc/gitlab/gitlab.rb', @omnibus_configuration.to_s)
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
173
170
|
class Availability
|
|
174
171
|
def initialize(name, relative_path: '', scheme: 'http', protocol_port: 80)
|
|
175
172
|
@docker = Docker::Engine.new
|
|
@@ -209,6 +206,20 @@ module Gitlab
|
|
|
209
206
|
@uri.scheme == 'https' ? { use_ssl: true, verify_mode: OpenSSL::SSL::VERIFY_NONE } : {}
|
|
210
207
|
end
|
|
211
208
|
end
|
|
209
|
+
|
|
210
|
+
class OmnibusConfiguration
|
|
211
|
+
def initialize
|
|
212
|
+
@config = Runtime::Scenario.attributes[:omnibus_configuration] || []
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def <<(configuration)
|
|
216
|
+
@config << configuration
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
def to_s
|
|
220
|
+
@config.to_s
|
|
221
|
+
end
|
|
222
|
+
end
|
|
212
223
|
end
|
|
213
224
|
end
|
|
214
225
|
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'securerandom'
|
|
2
2
|
require 'fileutils'
|
|
3
|
+
require 'yaml'
|
|
3
4
|
|
|
4
5
|
# This component sets up the Minio (https://hub.docker.com/r/minio/minio)
|
|
5
6
|
# image with the proper configuration for GitLab users to use object storage.
|
|
@@ -23,18 +24,12 @@ module Gitlab
|
|
|
23
24
|
@buckets = []
|
|
24
25
|
end
|
|
25
26
|
|
|
26
|
-
def instance
|
|
27
|
-
raise 'Please provide a block!' unless block_given?
|
|
28
|
-
|
|
29
|
-
super
|
|
30
|
-
end
|
|
31
|
-
|
|
32
27
|
def add_bucket(name)
|
|
33
28
|
@buckets << name
|
|
34
29
|
end
|
|
35
30
|
|
|
36
31
|
def to_config
|
|
37
|
-
|
|
32
|
+
YAML.safe_load <<~CFG
|
|
38
33
|
provider: AWS
|
|
39
34
|
aws_access_key_id: #{AWS_ACCESS_KEY}
|
|
40
35
|
aws_secret_access_key: #{AWS_SECRET_KEY}
|
|
@@ -43,9 +38,6 @@ module Gitlab
|
|
|
43
38
|
endpoint: http://#{hostname}:#{port}
|
|
44
39
|
path_style: true
|
|
45
40
|
CFG
|
|
46
|
-
|
|
47
|
-
# Quotes get eaten up when the string is set in the environment
|
|
48
|
-
config.to_s.gsub('"', '\\"')
|
|
49
41
|
end
|
|
50
42
|
|
|
51
43
|
private
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Gitlab
|
|
2
4
|
module QA
|
|
3
5
|
module Docker
|
|
@@ -36,10 +38,33 @@ module Gitlab
|
|
|
36
38
|
false
|
|
37
39
|
end
|
|
38
40
|
|
|
41
|
+
# Write to file(s) in the Docker container specified by @param name
|
|
42
|
+
# @param name The name of the Docker Container
|
|
43
|
+
# @example
|
|
44
|
+
# engine.write_files('gitlab-abc123') do |files|
|
|
45
|
+
# files.append('/etc/hosts', '127.0.0.1 localhost')
|
|
46
|
+
# files.write('/opt/other', <<~TEXT
|
|
47
|
+
# This is content
|
|
48
|
+
# That goes within /opt/other
|
|
49
|
+
# TEXT)
|
|
50
|
+
def write_files(name)
|
|
51
|
+
exec(name, yield(
|
|
52
|
+
Class.new do
|
|
53
|
+
def self.write(file, contents)
|
|
54
|
+
%(echo "#{contents}" > #{file};)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def self.append(file, contents)
|
|
58
|
+
%(echo "#{contents}" >> #{file};)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
))
|
|
62
|
+
end
|
|
63
|
+
|
|
39
64
|
def exec(name, command)
|
|
40
65
|
cmd = ['exec']
|
|
41
66
|
cmd << '--privileged' if privileged_command?(command)
|
|
42
|
-
Docker::Command.execute(
|
|
67
|
+
Docker::Command.execute(%(#{cmd.join(' ')} #{name} bash -c "#{command.gsub('"', '\\"')}"))
|
|
43
68
|
end
|
|
44
69
|
|
|
45
70
|
def read_file(image, tag, path, &block)
|
data/lib/gitlab/qa/runner.rb
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'optparse'
|
|
4
|
+
require 'active_support/inflector'
|
|
2
5
|
|
|
3
6
|
module Gitlab
|
|
4
7
|
module QA
|
|
@@ -8,6 +11,11 @@ module Gitlab
|
|
|
8
11
|
Runtime::Scenario.define(:teardown, true)
|
|
9
12
|
Runtime::Scenario.define(:run_tests, true)
|
|
10
13
|
Runtime::Scenario.define(:qa_image, Runtime::Env.qa_image) if Runtime::Env.qa_image
|
|
14
|
+
Runtime::Scenario.define(:omnibus_configuration, Runtime::OmnibusConfiguration.new)
|
|
15
|
+
|
|
16
|
+
# Omnibus Configurators specified by flags
|
|
17
|
+
@active_configurators = []
|
|
18
|
+
@omnibus_configurations = %w[default] # always load default configuration
|
|
11
19
|
|
|
12
20
|
@options = OptionParser.new do |opts|
|
|
13
21
|
opts.banner = 'Usage: gitlab-qa [options] Scenario URL [[--] path] [rspec_options]'
|
|
@@ -31,6 +39,12 @@ module Gitlab
|
|
|
31
39
|
exit
|
|
32
40
|
end
|
|
33
41
|
|
|
42
|
+
opts.on('--omnibus-config config1[,config2,...]', 'Use Omnibus Configuration package') do |configuration|
|
|
43
|
+
configuration.split(',').map do |config|
|
|
44
|
+
@omnibus_configurations << config
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
34
48
|
opts.on_tail('-h', '--help', 'Show the usage') do
|
|
35
49
|
puts opts
|
|
36
50
|
exit
|
|
@@ -44,21 +58,54 @@ module Gitlab
|
|
|
44
58
|
end
|
|
45
59
|
|
|
46
60
|
args.reject! { |arg| gitlab_qa_options.include?(arg) }
|
|
47
|
-
|
|
48
61
|
if args.size >= 1
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
load_omnibus_configurations
|
|
63
|
+
|
|
64
|
+
begin
|
|
65
|
+
@active_configurators.compact.each do |configurator|
|
|
66
|
+
configurator.instance(skip_teardown: true)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
Scenario
|
|
70
|
+
.const_get(args.shift)
|
|
71
|
+
.perform(*args)
|
|
72
|
+
ensure
|
|
73
|
+
@active_configurators.compact.each(&:teardown)
|
|
74
|
+
end
|
|
52
75
|
else
|
|
53
76
|
puts @options
|
|
54
77
|
exit 1
|
|
55
78
|
end
|
|
56
79
|
end
|
|
57
|
-
# rubocop:enable Metrics/AbcSize
|
|
58
80
|
|
|
59
81
|
def self.gitlab_qa_options
|
|
60
82
|
@gitlab_qa_options ||= @options.top.list.map(&:long).flatten
|
|
61
83
|
end
|
|
84
|
+
|
|
85
|
+
def self.load_omnibus_configurations
|
|
86
|
+
# OmnibusConfiguration::Test => --test
|
|
87
|
+
# OmnibusConfiguration::HelloThere => --hello_there
|
|
88
|
+
@omnibus_configurations.uniq.each do |config|
|
|
89
|
+
Runtime::OmnibusConfigurations.const_get(config.camelize).new.tap do |configurator|
|
|
90
|
+
@active_configurators << configurator.prepare
|
|
91
|
+
|
|
92
|
+
# */etc/gitlab/gitlab.rb*
|
|
93
|
+
# -----------------------
|
|
94
|
+
# # Runtime::OmnibusConfiguration::Packages
|
|
95
|
+
# gitlab_rails['packages_enabled'] = true
|
|
96
|
+
Runtime::Scenario.omnibus_configuration << "# #{configurator.class.name}"
|
|
97
|
+
|
|
98
|
+
# Load the configuration
|
|
99
|
+
configurator.configuration.split("\n").each { |c| Runtime::Scenario.omnibus_configuration << c }
|
|
100
|
+
end
|
|
101
|
+
rescue NameError
|
|
102
|
+
raise <<~ERROR
|
|
103
|
+
Invalid Omnibus Configuration `#{config}`.
|
|
104
|
+
Possible configurations: #{Runtime::OmnibusConfigurations.constants.map { |c| c.to_s.underscore }.join(',')}"
|
|
105
|
+
ERROR
|
|
106
|
+
end
|
|
107
|
+
end
|
|
62
108
|
end
|
|
109
|
+
# rubocop:enable Metrics/AbcSize
|
|
63
110
|
end
|
|
64
111
|
end
|
|
@@ -65,6 +65,7 @@ module Gitlab
|
|
|
65
65
|
'KNAPSACK_TEST_FILE_PATTERN' => :knapsack_test_file_pattern,
|
|
66
66
|
'KNAPSACK_TEST_DIR' => :knapsack_test_dir,
|
|
67
67
|
'CI' => :ci,
|
|
68
|
+
'CI_JOB_NAME' => :ci_job_name,
|
|
68
69
|
'CI_JOB_URL' => :ci_job_url,
|
|
69
70
|
'CI_RUNNER_ID' => :ci_runner_id,
|
|
70
71
|
'CI_SERVER_HOST' => :ci_server_host,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'active_support/core_ext/object/blank'
|
|
4
|
+
|
|
5
|
+
module Gitlab
|
|
6
|
+
module QA
|
|
7
|
+
module Runtime
|
|
8
|
+
class OmnibusConfiguration
|
|
9
|
+
def initialize
|
|
10
|
+
@config = ["# Generated by GitLab QA Omnibus Configurator at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def to_s
|
|
14
|
+
sanitize!.join("\n")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def configuration
|
|
18
|
+
raise NotImplementedError
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Before hook for any additional configuration
|
|
22
|
+
# This would usually be a container that needs to be running
|
|
23
|
+
# @return Any instance of [Gitlab::QA::Component::Base]
|
|
24
|
+
def prepare; end
|
|
25
|
+
|
|
26
|
+
# Commands to execute before GitLab boots
|
|
27
|
+
def exec_commands
|
|
28
|
+
[]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Ensures no duplicate entries
|
|
32
|
+
# @raise RuntimeError if competing configurations exist
|
|
33
|
+
# rubocop:disable Metrics/AbcSize
|
|
34
|
+
def sanitize!
|
|
35
|
+
sanitized = @config.map do |config|
|
|
36
|
+
next config if config.start_with?('#') # allow for comment
|
|
37
|
+
|
|
38
|
+
# sometimes "=" is part of a Hash. Only split based on the first "="
|
|
39
|
+
k, v = config.split("=", 2)
|
|
40
|
+
# make sure each config is well-formed
|
|
41
|
+
# e.g., gitlab_rails['packages_enabled'] = true
|
|
42
|
+
# NOT gitlab_rails['packages_enabled']=true
|
|
43
|
+
"#{k.strip} = #{v.strip.tr('"', "'")}".strip
|
|
44
|
+
end.uniq
|
|
45
|
+
|
|
46
|
+
errors = []
|
|
47
|
+
|
|
48
|
+
# check for duplicates
|
|
49
|
+
duplicate_keys = []
|
|
50
|
+
duplicates = sanitized.reject do |n|
|
|
51
|
+
key = n.split('=').first
|
|
52
|
+
duplicate_keys << key unless duplicate_keys.include?(key)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
duplicates.each { |duplicate| errors << "Duplicate entry found: `#{duplicate}`" }
|
|
56
|
+
|
|
57
|
+
raise "Errors exist within the Omnibus Configuration!\n#{errors.join(',')}" if errors.any?
|
|
58
|
+
|
|
59
|
+
@config = sanitized
|
|
60
|
+
end
|
|
61
|
+
# rubocop:enable Metrics/AbcSize
|
|
62
|
+
|
|
63
|
+
def <<(config)
|
|
64
|
+
@config << config.strip unless config.strip.empty?
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gitlab
|
|
4
|
+
module QA
|
|
5
|
+
module Runtime
|
|
6
|
+
module OmnibusConfigurations
|
|
7
|
+
# Default Configuration for Omnibus
|
|
8
|
+
# All runs will include this configuration
|
|
9
|
+
class Default < Runtime::OmnibusConfiguration
|
|
10
|
+
def configuration
|
|
11
|
+
<<~OMNIBUS
|
|
12
|
+
gitlab_rails['gitlab_default_theme'] = 10 # Light Red Theme
|
|
13
|
+
gitlab_rails['gitlab_disable_animations'] = true # Disable animations
|
|
14
|
+
gitlab_rails['application_settings_cache_seconds'] = 0 # Settings cache expiry
|
|
15
|
+
OMNIBUS
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.configuration
|
|
19
|
+
new.configuration
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gitlab
|
|
4
|
+
module QA
|
|
5
|
+
module Runtime
|
|
6
|
+
module OmnibusConfigurations
|
|
7
|
+
class ObjectStorage < Default
|
|
8
|
+
TYPES = %w[artifacts external_diffs lfs uploads packages dependency_proxy].freeze
|
|
9
|
+
|
|
10
|
+
def configuration
|
|
11
|
+
TYPES.each_with_object(+'') do |object_type, omnibus|
|
|
12
|
+
omnibus << <<~OMNIBUS
|
|
13
|
+
gitlab_rails['#{object_type}_enabled'] = true
|
|
14
|
+
gitlab_rails['#{object_type}_storage_path'] = '/var/opt/gitlab/gitlab-rails/shared/#{object_type}'
|
|
15
|
+
gitlab_rails['#{object_type}_object_store_enabled'] = true
|
|
16
|
+
gitlab_rails['#{object_type}_object_store_remote_directory'] = '#{object_type}-bucket'
|
|
17
|
+
gitlab_rails['#{object_type}_object_store_background_upload'] = false
|
|
18
|
+
gitlab_rails['#{object_type}_object_store_direct_upload'] = true
|
|
19
|
+
gitlab_rails['#{object_type}_object_store_proxy_download'] = true
|
|
20
|
+
gitlab_rails['#{object_type}_object_store_connection'] = #{minio.to_config}
|
|
21
|
+
OMNIBUS
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def prepare
|
|
26
|
+
minio.network = 'test'
|
|
27
|
+
|
|
28
|
+
TYPES.each do |bucket_name|
|
|
29
|
+
minio.add_bucket("#{bucket_name}-bucket")
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
minio
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def exec_commands
|
|
36
|
+
QA::Scenario::CLICommands.git_lfs_install_commands
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
def minio
|
|
42
|
+
@minio ||= Component::Minio.new
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gitlab
|
|
4
|
+
module QA
|
|
5
|
+
module Runtime
|
|
6
|
+
module OmnibusConfigurations
|
|
7
|
+
class Packages < Default
|
|
8
|
+
def configuration
|
|
9
|
+
<<~OMNIBUS
|
|
10
|
+
gitlab_rails['packages_enabled'] = true
|
|
11
|
+
OMNIBUS
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -4,11 +4,11 @@ module Gitlab
|
|
|
4
4
|
module CLICommands
|
|
5
5
|
GIT_LFS_VERSION = '2.8.0'.freeze
|
|
6
6
|
|
|
7
|
-
def git_lfs_install_commands
|
|
8
|
-
|
|
7
|
+
def self.git_lfs_install_commands
|
|
8
|
+
[
|
|
9
9
|
"cd /tmp ; curl -qsL https://github.com/git-lfs/git-lfs/releases/download/v#{GIT_LFS_VERSION}/git-lfs-linux-amd64-v#{GIT_LFS_VERSION}.tar.gz | tar xzvf -",
|
|
10
10
|
'cp /tmp/git-lfs /usr/local/bin'
|
|
11
|
-
]
|
|
11
|
+
].freeze
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
end
|
|
@@ -10,9 +10,7 @@ module Gitlab
|
|
|
10
10
|
gitlab.network = 'test'
|
|
11
11
|
gitlab.relative_path = '/relative'
|
|
12
12
|
|
|
13
|
-
gitlab.
|
|
14
|
-
external_url '#{gitlab.address}';
|
|
15
|
-
OMNIBUS
|
|
13
|
+
gitlab.omnibus_configuration << "external_url '#{gitlab.address}'"
|
|
16
14
|
|
|
17
15
|
gitlab.instance do
|
|
18
16
|
Component::Specs.perform do |specs|
|
|
@@ -9,7 +9,7 @@ module Gitlab
|
|
|
9
9
|
gitlab.release = QA::Release.new(release)
|
|
10
10
|
gitlab.name = 'gitlab'
|
|
11
11
|
gitlab.network = 'test'
|
|
12
|
-
gitlab.
|
|
12
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
13
13
|
git_data_dirs({
|
|
14
14
|
'default' => {
|
|
15
15
|
'path' => '/var/opt/gitlab/git-data/repositories/default'
|
|
@@ -9,9 +9,7 @@ module Gitlab
|
|
|
9
9
|
gitlab.release = QA::Release.new(release)
|
|
10
10
|
gitlab.name = 'gitlab-actioncable'
|
|
11
11
|
gitlab.network = 'test'
|
|
12
|
-
gitlab.
|
|
13
|
-
actioncable['enable'] = true;
|
|
14
|
-
OMNIBUS
|
|
12
|
+
gitlab.omnibus_configuration << "actioncable['enable'] = true"
|
|
15
13
|
|
|
16
14
|
gitlab.instance do
|
|
17
15
|
puts "Running actioncable specs!"
|
|
@@ -4,7 +4,6 @@ module Gitlab
|
|
|
4
4
|
module Test
|
|
5
5
|
module Integration
|
|
6
6
|
class Geo < Scenario::Template
|
|
7
|
-
include Scenario::CLICommands
|
|
8
7
|
##
|
|
9
8
|
# rubocop:disable Lint/MissingCopEnableDirective
|
|
10
9
|
# rubocop:disable Metrics/AbcSize
|
|
@@ -20,7 +19,7 @@ module Gitlab
|
|
|
20
19
|
primary.release = release
|
|
21
20
|
primary.name = 'gitlab-primary'
|
|
22
21
|
primary.network = 'geo'
|
|
23
|
-
primary.
|
|
22
|
+
primary.omnibus_configuration << <<~OMNIBUS
|
|
24
23
|
gitlab_rails['db_key_base'] = '4dd58204865eb41bca93bd38131d51cc';
|
|
25
24
|
geo_primary_role['enable'] = true;
|
|
26
25
|
gitlab_rails['db_password'] = 'mypass';
|
|
@@ -36,14 +35,14 @@ module Gitlab
|
|
|
36
35
|
sidekiq['concurrency'] = 2;
|
|
37
36
|
puma['worker_processes'] = 2;
|
|
38
37
|
OMNIBUS
|
|
39
|
-
primary.exec_commands = fast_ssh_key_lookup_commands + git_lfs_install_commands
|
|
38
|
+
primary.exec_commands = fast_ssh_key_lookup_commands + QA::Scenario::CLICommands.git_lfs_install_commands
|
|
40
39
|
|
|
41
40
|
primary.instance do
|
|
42
41
|
Component::Gitlab.perform do |secondary|
|
|
43
42
|
secondary.release = release
|
|
44
43
|
secondary.name = 'gitlab-secondary'
|
|
45
44
|
secondary.network = 'geo'
|
|
46
|
-
secondary.
|
|
45
|
+
secondary.omnibus_configuration << <<~OMNIBUS
|
|
47
46
|
geo_secondary['db_fdw'] = true;
|
|
48
47
|
geo_secondary_role['enable'] = true;
|
|
49
48
|
gitlab_rails['db_key_base'] = '4dd58204865eb41bca93bd38131d51cc';
|
|
@@ -58,7 +57,7 @@ module Gitlab
|
|
|
58
57
|
sidekiq['concurrency'] = 2;
|
|
59
58
|
puma['worker_processes'] = 2;
|
|
60
59
|
OMNIBUS
|
|
61
|
-
secondary.exec_commands = fast_ssh_key_lookup_commands + git_lfs_install_commands
|
|
60
|
+
secondary.exec_commands = fast_ssh_key_lookup_commands + QA::Scenario::CLICommands.git_lfs_install_commands
|
|
62
61
|
|
|
63
62
|
secondary.act do
|
|
64
63
|
# TODO, we do not wait for secondary to start because of
|
|
@@ -39,7 +39,7 @@ module Gitlab
|
|
|
39
39
|
praefect.network = @network
|
|
40
40
|
praefect.skip_availability_check = true
|
|
41
41
|
|
|
42
|
-
praefect.
|
|
42
|
+
praefect.omnibus_configuration << praefect_omnibus_configuration
|
|
43
43
|
|
|
44
44
|
praefect.instance(skip_teardown: true)
|
|
45
45
|
end
|
|
@@ -49,7 +49,7 @@ module Gitlab
|
|
|
49
49
|
gitlab.name = gitlab_name
|
|
50
50
|
gitlab.network = @network
|
|
51
51
|
|
|
52
|
-
gitlab.
|
|
52
|
+
gitlab.omnibus_configuration << gitlab_omnibus_configuration
|
|
53
53
|
gitlab.instance do
|
|
54
54
|
puts "Running Gitaly Cluster specs!"
|
|
55
55
|
|
|
@@ -197,7 +197,7 @@ module Gitlab
|
|
|
197
197
|
gitaly.name = name
|
|
198
198
|
gitaly.network = @network
|
|
199
199
|
gitaly.skip_availability_check = true
|
|
200
|
-
gitaly.
|
|
200
|
+
gitaly.omnibus_configuration << gitaly_omnibus_configuration
|
|
201
201
|
gitaly.instance(skip_teardown: true)
|
|
202
202
|
end
|
|
203
203
|
end
|
|
@@ -17,7 +17,7 @@ module Gitlab
|
|
|
17
17
|
saml.set_assertion_consumer_service("#{gitlab.address}/users/auth/saml/callback")
|
|
18
18
|
saml.set_simple_saml_hostname
|
|
19
19
|
|
|
20
|
-
gitlab.
|
|
20
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
21
21
|
gitlab_rails['omniauth_enabled'] = true;
|
|
22
22
|
gitlab_rails['omniauth_allow_single_sign_on'] = ['saml'];
|
|
23
23
|
gitlab_rails['omniauth_block_auto_created_users'] = false;
|
|
@@ -21,7 +21,7 @@ module Gitlab
|
|
|
21
21
|
tunnel_registry.gitlab_hostname = gitlab.hostname
|
|
22
22
|
tunnel_registry.network = 'test'
|
|
23
23
|
|
|
24
|
-
gitlab.
|
|
24
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
25
25
|
external_url '#{tunnel_gitlab.url}';
|
|
26
26
|
nginx['listen_port'] = 80;
|
|
27
27
|
nginx['listen_https'] = false;
|
|
@@ -12,7 +12,7 @@ module Gitlab
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def configure_omnibus(gitlab)
|
|
15
|
-
gitlab.
|
|
15
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
16
16
|
gitlab_rails['ldap_enabled'] = true;
|
|
17
17
|
gitlab_rails['ldap_servers'] = #{ldap_servers_omnibus_config};
|
|
18
18
|
gitlab_rails['ldap_sync_worker_cron'] = '* * * * *';
|
|
@@ -15,7 +15,7 @@ module Gitlab
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def configure_omnibus(gitlab)
|
|
18
|
-
gitlab.
|
|
18
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
19
19
|
gitlab_rails['ldap_enabled'] = true;
|
|
20
20
|
gitlab_rails['ldap_servers'] = #{ldap_servers_omnibus_config};
|
|
21
21
|
gitlab_rails['ldap_sync_worker_cron'] = '* * * * *';
|
|
@@ -15,7 +15,7 @@ module Gitlab
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def configure_omnibus(gitlab)
|
|
18
|
-
gitlab.
|
|
18
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
19
19
|
gitlab_rails['ldap_enabled'] = true;
|
|
20
20
|
gitlab_rails['ldap_servers'] = #{ldap_servers_omnibus_config};
|
|
21
21
|
letsencrypt['enable'] = false;
|
|
@@ -13,7 +13,7 @@ module Gitlab
|
|
|
13
13
|
mattermost_external_url = "http://#{mattermost_hostname}"
|
|
14
14
|
|
|
15
15
|
gitlab.add_network_alias(mattermost_hostname)
|
|
16
|
-
gitlab.
|
|
16
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
17
17
|
mattermost_external_url '#{mattermost_external_url}';
|
|
18
18
|
OMNIBUS
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ module Gitlab
|
|
|
21
21
|
gitaly.network = @network
|
|
22
22
|
gitaly.skip_availability_check = true
|
|
23
23
|
|
|
24
|
-
gitaly.
|
|
24
|
+
gitaly.omnibus_configuration << gitaly_omnibus
|
|
25
25
|
gitaly.gitaly_tls
|
|
26
26
|
|
|
27
27
|
gitaly.instance do
|
|
@@ -30,7 +30,7 @@ module Gitlab
|
|
|
30
30
|
gitlab.name = @gitlab_name
|
|
31
31
|
gitlab.network = @network
|
|
32
32
|
|
|
33
|
-
gitlab.
|
|
33
|
+
gitlab.omnibus_configuration << gitlab_omnibus
|
|
34
34
|
gitlab.tls = true
|
|
35
35
|
|
|
36
36
|
gitlab.instance do
|
|
@@ -14,7 +14,7 @@ module Gitlab
|
|
|
14
14
|
attr_reader :gitlab_name, :spec_suite
|
|
15
15
|
|
|
16
16
|
def configure_omnibus(gitlab, mail_hog)
|
|
17
|
-
gitlab.
|
|
17
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
18
18
|
gitlab_rails['smtp_enable'] = true;
|
|
19
19
|
gitlab_rails['smtp_address'] = '#{mail_hog.hostname}';
|
|
20
20
|
gitlab_rails['smtp_port'] = 1025;
|
|
@@ -22,7 +22,7 @@ module Gitlab
|
|
|
22
22
|
tunnel_registry.gitlab_hostname = gitlab.hostname
|
|
23
23
|
tunnel_registry.network = 'test'
|
|
24
24
|
|
|
25
|
-
gitlab.
|
|
25
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
26
26
|
external_url '#{tunnel_gitlab.url}';
|
|
27
27
|
nginx['listen_port'] = 80;
|
|
28
28
|
nginx['listen_https'] = false;
|
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:
|
|
4
|
+
version: 7.0.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: 2021-03-
|
|
11
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|
|
@@ -184,14 +184,14 @@ dependencies:
|
|
|
184
184
|
requirements:
|
|
185
185
|
- - '='
|
|
186
186
|
- !ruby/object:Gem::Version
|
|
187
|
-
version: 1.5.
|
|
187
|
+
version: 1.5.7
|
|
188
188
|
type: :runtime
|
|
189
189
|
prerelease: false
|
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
|
191
191
|
requirements:
|
|
192
192
|
- - '='
|
|
193
193
|
- !ruby/object:Gem::Version
|
|
194
|
-
version: 1.5.
|
|
194
|
+
version: 1.5.7
|
|
195
195
|
description:
|
|
196
196
|
email:
|
|
197
197
|
- grzesiek.bizon@gmail.com
|
|
@@ -221,6 +221,7 @@ files:
|
|
|
221
221
|
- bin/slack
|
|
222
222
|
- docs/README.md
|
|
223
223
|
- docs/architecture.md
|
|
224
|
+
- docs/configuring_omnibus.md
|
|
224
225
|
- docs/how_it_works.md
|
|
225
226
|
- docs/release_process.md
|
|
226
227
|
- docs/run_qa_against_gdk.md
|
|
@@ -273,6 +274,10 @@ files:
|
|
|
273
274
|
- lib/gitlab/qa/reporter.rb
|
|
274
275
|
- lib/gitlab/qa/runner.rb
|
|
275
276
|
- lib/gitlab/qa/runtime/env.rb
|
|
277
|
+
- lib/gitlab/qa/runtime/omnibus_configuration.rb
|
|
278
|
+
- lib/gitlab/qa/runtime/omnibus_configurations/default.rb
|
|
279
|
+
- lib/gitlab/qa/runtime/omnibus_configurations/object_storage.rb
|
|
280
|
+
- lib/gitlab/qa/runtime/omnibus_configurations/packages.rb
|
|
276
281
|
- lib/gitlab/qa/runtime/scenario.rb
|
|
277
282
|
- lib/gitlab/qa/runtime/token_finder.rb
|
|
278
283
|
- lib/gitlab/qa/scenario/actable.rb
|
|
@@ -305,8 +310,6 @@ files:
|
|
|
305
310
|
- lib/gitlab/qa/scenario/test/integration/ldap_tls.rb
|
|
306
311
|
- lib/gitlab/qa/scenario/test/integration/mattermost.rb
|
|
307
312
|
- lib/gitlab/qa/scenario/test/integration/mtls.rb
|
|
308
|
-
- lib/gitlab/qa/scenario/test/integration/object_storage.rb
|
|
309
|
-
- lib/gitlab/qa/scenario/test/integration/packages.rb
|
|
310
313
|
- lib/gitlab/qa/scenario/test/integration/praefect.rb
|
|
311
314
|
- lib/gitlab/qa/scenario/test/integration/saml.rb
|
|
312
315
|
- lib/gitlab/qa/scenario/test/integration/smtp.rb
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
require 'yaml'
|
|
2
|
-
|
|
3
|
-
module Gitlab
|
|
4
|
-
module QA
|
|
5
|
-
module Scenario
|
|
6
|
-
module Test
|
|
7
|
-
module Integration
|
|
8
|
-
class ObjectStorage < Scenario::Template
|
|
9
|
-
include Scenario::CLICommands
|
|
10
|
-
|
|
11
|
-
TYPES = %w[artifacts external_diffs lfs uploads packages dependency_proxy].freeze
|
|
12
|
-
|
|
13
|
-
def perform(release, *rspec_args)
|
|
14
|
-
Component::Gitlab.perform do |gitlab|
|
|
15
|
-
gitlab.release = release
|
|
16
|
-
gitlab.name = 'gitlab-object-storage'
|
|
17
|
-
gitlab.network = 'test'
|
|
18
|
-
|
|
19
|
-
Component::Minio.perform do |minio|
|
|
20
|
-
minio.network = 'test'
|
|
21
|
-
|
|
22
|
-
TYPES.each do |bucket_name|
|
|
23
|
-
minio.add_bucket("#{bucket_name}-bucket")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
gitlab.omnibus_config = object_storage_config(minio)
|
|
27
|
-
gitlab.exec_commands = git_lfs_install_commands
|
|
28
|
-
|
|
29
|
-
minio.instance do
|
|
30
|
-
gitlab.instance do
|
|
31
|
-
puts 'Running object storage specs!'
|
|
32
|
-
|
|
33
|
-
Component::Specs.perform do |specs|
|
|
34
|
-
specs.suite = 'Test::Integration::ObjectStorage'
|
|
35
|
-
specs.release = gitlab.release
|
|
36
|
-
specs.network = gitlab.network
|
|
37
|
-
specs.args = [gitlab.address, *rspec_args]
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def object_storage_config(minio)
|
|
46
|
-
TYPES.map do |object_type|
|
|
47
|
-
<<~OMNIBUS
|
|
48
|
-
gitlab_rails['#{object_type}_enabled'] = true;
|
|
49
|
-
gitlab_rails['#{object_type}_storage_path'] = '/var/opt/gitlab/gitlab-rails/shared/#{object_type}';
|
|
50
|
-
gitlab_rails['#{object_type}_object_store_enabled'] = true;
|
|
51
|
-
gitlab_rails['#{object_type}_object_store_remote_directory'] = '#{object_type}-bucket';
|
|
52
|
-
gitlab_rails['#{object_type}_object_store_background_upload'] = false;
|
|
53
|
-
gitlab_rails['#{object_type}_object_store_direct_upload'] = true;
|
|
54
|
-
gitlab_rails['#{object_type}_object_store_proxy_download'] = true;
|
|
55
|
-
gitlab_rails['#{object_type}_object_store_connection'] = #{minio.to_config};
|
|
56
|
-
OMNIBUS
|
|
57
|
-
end.join("\n")
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
module Gitlab
|
|
2
|
-
module QA
|
|
3
|
-
module Scenario
|
|
4
|
-
module Test
|
|
5
|
-
module Integration
|
|
6
|
-
class Packages < Scenario::Template
|
|
7
|
-
def perform(release, *rspec_args)
|
|
8
|
-
Component::Gitlab.perform do |gitlab|
|
|
9
|
-
gitlab.release = QA::Release.new(release)
|
|
10
|
-
gitlab.name = 'gitlab-packages'
|
|
11
|
-
gitlab.network = 'test'
|
|
12
|
-
gitlab.omnibus_config = <<~OMNIBUS
|
|
13
|
-
gitlab_rails['packages_enabled'] = true;
|
|
14
|
-
OMNIBUS
|
|
15
|
-
|
|
16
|
-
gitlab.instance do
|
|
17
|
-
puts "Running packages specs!"
|
|
18
|
-
|
|
19
|
-
rspec_args << "--" unless rspec_args.include?('--')
|
|
20
|
-
rspec_args << %w[--tag packages]
|
|
21
|
-
|
|
22
|
-
Component::Specs.perform do |specs|
|
|
23
|
-
specs.suite = 'Test::Instance::All'
|
|
24
|
-
specs.release = gitlab.release
|
|
25
|
-
specs.network = gitlab.network
|
|
26
|
-
specs.args = [gitlab.address, *rspec_args]
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|