gitlab-qa 8.4.2 → 8.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +0 -12
- data/Gemfile.lock +1 -1
- data/exe/gitlab-qa +1 -1
- data/lib/gitlab/qa/component/base.rb +2 -2
- data/lib/gitlab/qa/component/gitlab.rb +1 -1
- data/lib/gitlab/qa/component/staging.rb +17 -35
- data/lib/gitlab/qa/component/suggested_reviewer.rb +47 -0
- data/lib/gitlab/qa/docker/command.rb +3 -14
- data/lib/gitlab/qa/docker/engine.rb +1 -1
- data/lib/gitlab/qa/release.rb +6 -2
- data/lib/gitlab/qa/report/find_set_dri.rb +43 -0
- data/lib/gitlab/qa/report/gitlab_issue_client.rb +7 -0
- data/lib/gitlab/qa/report/relate_failure_issue.rb +16 -0
- data/lib/gitlab/qa/report/results_reporter_shared.rb +1 -1
- data/lib/gitlab/qa/report/test_result.rb +8 -0
- data/lib/gitlab/qa/runtime/env.rb +5 -14
- data/lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb +62 -0
- data/lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb +1 -1
- data/lib/gitlab/qa/service/cluster_provider/base.rb +33 -0
- data/lib/gitlab/qa/service/cluster_provider/k3d.rb +141 -0
- data/lib/gitlab/qa/service/kubernetes_cluster.rb +62 -0
- data/lib/gitlab/qa/support/shell_command.rb +98 -0
- data/lib/gitlab/qa/support/shellout.rb +16 -0
- data/lib/gitlab/qa/version.rb +1 -1
- data/lib/gitlab/qa.rb +0 -1
- data/support/manifests/suggested_reviewer/authenticator.yaml +41 -0
- data/support/manifests/suggested_reviewer/postgres.yaml +84 -0
- data/support/manifests/suggested_reviewer/pubsub.yaml +41 -0
- data/support/manifests/suggested_reviewer/recommender-bot.yaml +242 -0
- data/support/manifests/suggested_reviewer/recommender.yaml +52 -0
- metadata +15 -7
- data/lib/gitlab/qa/component/internet_tunnel.rb +0 -76
- data/lib/gitlab/qa/docker/shellout.rb +0 -77
- data/lib/gitlab/qa/scenario/test/integration/kubernetes.rb +0 -56
- data/lib/gitlab/qa/scenario/test/integration/ssh_tunnel.rb +0 -56
- data/lib/gitlab/qa/support/dev_ee_qa_image.rb +0 -54
@@ -0,0 +1,242 @@
|
|
1
|
+
---
|
2
|
+
apiVersion: v1
|
3
|
+
kind: Secret
|
4
|
+
metadata:
|
5
|
+
name: gcp-credentials
|
6
|
+
type: Opaque
|
7
|
+
data:
|
8
|
+
gcp_json: "ewogICJjbGllbnRfaWQiOiAiMTIzNDU2Nzg5YWJjZGVmZy5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsCiAgImNsaWVudF9zZWNyZXQiOiAiZC1GTHlld3VxeWV1cXciLAogICJxdW90YV9wcm9qZWN0X2lkIjogInN1Z2dlc3RlZC1yZXZpZXdlci0xNTA0MDBlNiIsCiAgInJlZnJlc2hfdG9rZW4iOiAiMS8vMTIzNDU2NzhhYmNkZWZnIiwKICAidHlwZSI6ICJhdXRob3JpemVkX3VzZXIiCn0K"
|
9
|
+
|
10
|
+
---
|
11
|
+
apiVersion: v1
|
12
|
+
kind: ConfigMap
|
13
|
+
metadata:
|
14
|
+
name: recommender-bot-envoy-sidecar-config
|
15
|
+
labels:
|
16
|
+
app: recommender-bot
|
17
|
+
data:
|
18
|
+
envoy.yaml: |
|
19
|
+
static_resources:
|
20
|
+
listeners:
|
21
|
+
- name: "recommender-bot-http-listener"
|
22
|
+
address:
|
23
|
+
socket_address: { address: "0.0.0.0", port_value: 8282 }
|
24
|
+
filter_chains:
|
25
|
+
- filters:
|
26
|
+
- name: "envoy.filters.network.http_connection_manager"
|
27
|
+
typed_config:
|
28
|
+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
|
29
|
+
stat_prefix: "grpc_json"
|
30
|
+
codec_type: "AUTO"
|
31
|
+
route_config:
|
32
|
+
name: "local_route"
|
33
|
+
virtual_hosts:
|
34
|
+
- name: "local_service"
|
35
|
+
domains: [ "*" ]
|
36
|
+
routes:
|
37
|
+
- match: { prefix: "/", grpc: {} }
|
38
|
+
route: { cluster: "recommender-bot", timeout: 60s }
|
39
|
+
http_filters:
|
40
|
+
- name: "envoy.filters.http.grpc_json_transcoder"
|
41
|
+
typed_config:
|
42
|
+
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
|
43
|
+
proto_descriptor: "/data/protos/recommender-bot.protoset.pb"
|
44
|
+
services: [ "bot.RecommenderService" ]
|
45
|
+
print_options:
|
46
|
+
add_whitespace: true
|
47
|
+
always_print_primitive_fields: true
|
48
|
+
always_print_enums_as_ints: false
|
49
|
+
preserve_proto_field_names: false
|
50
|
+
convert_grpc_status: true
|
51
|
+
request_validation_options:
|
52
|
+
reject_unknown_method: true
|
53
|
+
reject_unknown_query_parameters: true
|
54
|
+
- name: "envoy.filters.http.router"
|
55
|
+
- name: "recommender-bot-http-auth-listener"
|
56
|
+
address:
|
57
|
+
socket_address: { address: "0.0.0.0", port_value: 8484 }
|
58
|
+
filter_chains:
|
59
|
+
- filters:
|
60
|
+
- name: "envoy.filters.network.http_connection_manager"
|
61
|
+
typed_config:
|
62
|
+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
|
63
|
+
stat_prefix: "grpc_json"
|
64
|
+
codec_type: "AUTO"
|
65
|
+
route_config:
|
66
|
+
name: "local_route"
|
67
|
+
virtual_hosts:
|
68
|
+
- name: "local_service"
|
69
|
+
domains: [ "*" ]
|
70
|
+
routes:
|
71
|
+
- match: { prefix: "/", grpc: {} }
|
72
|
+
route: { cluster: "recommender-bot", timeout: 60s }
|
73
|
+
http_filters:
|
74
|
+
- name: "envoy.filters.http.grpc_json_transcoder"
|
75
|
+
typed_config:
|
76
|
+
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
|
77
|
+
proto_descriptor: "/data/protos/recommender-bot.protoset.pb"
|
78
|
+
services: [ "bot.RecommenderService" ]
|
79
|
+
print_options:
|
80
|
+
add_whitespace: true
|
81
|
+
always_print_primitive_fields: true
|
82
|
+
always_print_enums_as_ints: false
|
83
|
+
preserve_proto_field_names: false
|
84
|
+
convert_grpc_status: true
|
85
|
+
request_validation_options:
|
86
|
+
reject_unknown_method: true
|
87
|
+
reject_unknown_query_parameters: true
|
88
|
+
- name: "envoy.filters.http.ext_authz"
|
89
|
+
typed_config:
|
90
|
+
"@type": type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz
|
91
|
+
http_service:
|
92
|
+
server_uri:
|
93
|
+
uri: "http://authenticator-service:8080"
|
94
|
+
cluster: "ext-auth"
|
95
|
+
timeout: 60s
|
96
|
+
authorization_request:
|
97
|
+
allowed_headers:
|
98
|
+
patterns:
|
99
|
+
- { exact: "Job-Token", ignore_case: true }
|
100
|
+
- { exact: "Project-Id", ignore_case: true }
|
101
|
+
failure_mode_allow: false
|
102
|
+
- name: "envoy.filters.http.router"
|
103
|
+
|
104
|
+
clusters:
|
105
|
+
- name: "recommender-bot"
|
106
|
+
connect_timeout: "1.25s"
|
107
|
+
type: "STATIC"
|
108
|
+
lb_policy: "ROUND_ROBIN"
|
109
|
+
dns_lookup_family: V4_ONLY
|
110
|
+
typed_extension_protocol_options:
|
111
|
+
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
|
112
|
+
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
|
113
|
+
explicit_http_config:
|
114
|
+
http2_protocol_options: { }
|
115
|
+
load_assignment:
|
116
|
+
cluster_name: "recommender-bot"
|
117
|
+
endpoints:
|
118
|
+
- lb_endpoints:
|
119
|
+
- endpoint:
|
120
|
+
address:
|
121
|
+
socket_address:
|
122
|
+
address: "127.0.0.1"
|
123
|
+
port_value: 8080
|
124
|
+
- name: "ext-auth"
|
125
|
+
connect_timeout: "1.25s"
|
126
|
+
type: "LOGICAL_DNS"
|
127
|
+
lb_policy: "ROUND_ROBIN"
|
128
|
+
load_assignment:
|
129
|
+
cluster_name: "ext-auth"
|
130
|
+
endpoints:
|
131
|
+
- lb_endpoints:
|
132
|
+
- endpoint:
|
133
|
+
address:
|
134
|
+
socket_address:
|
135
|
+
address: "authenticator-service"
|
136
|
+
port_value: 8080
|
137
|
+
|
138
|
+
---
|
139
|
+
apiVersion: apps/v1
|
140
|
+
kind: Deployment
|
141
|
+
metadata:
|
142
|
+
name: recommender-bot-deployment
|
143
|
+
labels:
|
144
|
+
app: recommender-bot
|
145
|
+
spec:
|
146
|
+
replicas: 1
|
147
|
+
selector:
|
148
|
+
matchLabels:
|
149
|
+
app: recommender-bot
|
150
|
+
template:
|
151
|
+
metadata:
|
152
|
+
labels:
|
153
|
+
app: recommender-bot
|
154
|
+
spec:
|
155
|
+
initContainers:
|
156
|
+
- name: protosets
|
157
|
+
image: recommender-bot-service:dev
|
158
|
+
imagePullPolicy: Never
|
159
|
+
command: [sh, -c]
|
160
|
+
args: [cp /app/recommender-bot.protoset.pb /data/protos]
|
161
|
+
volumeMounts:
|
162
|
+
- name: grpc-protosets
|
163
|
+
mountPath: /data/protos
|
164
|
+
containers:
|
165
|
+
- name: recommender-bot-envoy-sidecar
|
166
|
+
image: envoyproxy/envoy-alpine:v1.19-latest
|
167
|
+
imagePullPolicy: IfNotPresent
|
168
|
+
ports:
|
169
|
+
- containerPort: 8282
|
170
|
+
- containerPort: 8484
|
171
|
+
volumeMounts:
|
172
|
+
- name: recommender-bot-envoy-sidecar-config
|
173
|
+
mountPath: /etc/envoy
|
174
|
+
- name: grpc-protosets
|
175
|
+
mountPath: /data/protos
|
176
|
+
readOnly: true
|
177
|
+
- name: recommender-bot
|
178
|
+
image: recommender-bot-service:dev
|
179
|
+
imagePullPolicy: Never
|
180
|
+
ports:
|
181
|
+
- containerPort: 8080
|
182
|
+
env:
|
183
|
+
- name: RECOMMENDER_BOT_SERVICE_PORT
|
184
|
+
value: "8080"
|
185
|
+
- name: RECOMMENDER_BOT_GITLAB_TOKEN
|
186
|
+
valueFrom:
|
187
|
+
secretKeyRef:
|
188
|
+
name: recommender-bot-gitlab-token
|
189
|
+
key: token
|
190
|
+
- name: RECOMMENDER_BOT_GRPC_SERVICE_URL
|
191
|
+
value: recommender-service:8080
|
192
|
+
- name: RECOMMENDER_BOT_PG_CONN_STRING
|
193
|
+
valueFrom:
|
194
|
+
secretKeyRef:
|
195
|
+
name: recommender-bot-pg-conn-string
|
196
|
+
key: pg-conn
|
197
|
+
- name: PUBSUB_EMULATOR_HOST
|
198
|
+
value: pubsub:8432
|
199
|
+
- name: GOOGLE_APPLICATION_CREDENTIALS
|
200
|
+
value: /data/gcp/gcp_credentials.json
|
201
|
+
- name: RECOMMENDER_BOT_PUBSUB_PROJECT_ID
|
202
|
+
value: project-test
|
203
|
+
- name: RECOMMENDER_BOT_PUBSUB_TOPIC_RECOMMENDATIONS
|
204
|
+
value: gitlab.merge-request-recommendations-test.1
|
205
|
+
volumeMounts:
|
206
|
+
- name: gcp-secrets
|
207
|
+
mountPath: /data/gcp
|
208
|
+
readOnly: true
|
209
|
+
volumes:
|
210
|
+
- name: grpc-protosets
|
211
|
+
emptyDir: {}
|
212
|
+
- name: recommender-bot-envoy-sidecar-config
|
213
|
+
configMap:
|
214
|
+
name: recommender-bot-envoy-sidecar-config
|
215
|
+
- name: gcp-secrets
|
216
|
+
secret:
|
217
|
+
secretName: gcp-credentials
|
218
|
+
items:
|
219
|
+
- key: gcp_json
|
220
|
+
path: gcp_credentials.json
|
221
|
+
|
222
|
+
---
|
223
|
+
apiVersion: v1
|
224
|
+
kind: Service
|
225
|
+
metadata:
|
226
|
+
name: recommender-bot-service
|
227
|
+
labels:
|
228
|
+
app: recommender-bot
|
229
|
+
spec:
|
230
|
+
type: NodePort
|
231
|
+
ports:
|
232
|
+
- name: http-plain
|
233
|
+
port: 8282
|
234
|
+
targetPort: 8282
|
235
|
+
- name: http-auth
|
236
|
+
port: 8484
|
237
|
+
targetPort: 8484
|
238
|
+
- name: grpc
|
239
|
+
port: 8080
|
240
|
+
targetPort: 8080
|
241
|
+
selector:
|
242
|
+
app: recommender-bot
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
apiVersion: apps/v1
|
3
|
+
kind: Deployment
|
4
|
+
metadata:
|
5
|
+
name: recommender-deployment
|
6
|
+
labels:
|
7
|
+
app: recommender
|
8
|
+
spec:
|
9
|
+
replicas: 1
|
10
|
+
selector:
|
11
|
+
matchLabels:
|
12
|
+
app: recommender
|
13
|
+
template:
|
14
|
+
metadata:
|
15
|
+
labels:
|
16
|
+
app: recommender
|
17
|
+
spec:
|
18
|
+
containers:
|
19
|
+
- name: recommender
|
20
|
+
image: recommender-service:dev
|
21
|
+
imagePullPolicy: Never
|
22
|
+
ports:
|
23
|
+
- containerPort: 8080
|
24
|
+
volumeMounts:
|
25
|
+
- name: models-mount
|
26
|
+
mountPath: /app/data/models
|
27
|
+
env:
|
28
|
+
- name: RECOMMENDER_SERVICE_PORT
|
29
|
+
value: "8080"
|
30
|
+
- name: RECOMMENDER_MODELS_STORAGE
|
31
|
+
value: local
|
32
|
+
- name: GRPC_VERBOSITY
|
33
|
+
value: debug
|
34
|
+
volumes:
|
35
|
+
- name: models-mount
|
36
|
+
hostPath:
|
37
|
+
path: /tmp/gitlab-qa/suggested_reviewer/data/models
|
38
|
+
|
39
|
+
---
|
40
|
+
apiVersion: v1
|
41
|
+
kind: Service
|
42
|
+
metadata:
|
43
|
+
name: recommender-service
|
44
|
+
labels:
|
45
|
+
app: recommender
|
46
|
+
spec:
|
47
|
+
type: ClusterIP
|
48
|
+
ports:
|
49
|
+
- port: 8080
|
50
|
+
targetPort: 8080
|
51
|
+
selector:
|
52
|
+
app: recommender
|
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: 8.
|
4
|
+
version: 8.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab Quality
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -313,7 +313,6 @@ files:
|
|
313
313
|
- lib/gitlab/qa/component/base.rb
|
314
314
|
- lib/gitlab/qa/component/elasticsearch.rb
|
315
315
|
- lib/gitlab/qa/component/gitlab.rb
|
316
|
-
- lib/gitlab/qa/component/internet_tunnel.rb
|
317
316
|
- lib/gitlab/qa/component/jira.rb
|
318
317
|
- lib/gitlab/qa/component/ldap.rb
|
319
318
|
- lib/gitlab/qa/component/mail_hog.rb
|
@@ -327,13 +326,14 @@ files:
|
|
327
326
|
- lib/gitlab/qa/component/specs.rb
|
328
327
|
- lib/gitlab/qa/component/staging.rb
|
329
328
|
- lib/gitlab/qa/component/staging_ref.rb
|
329
|
+
- lib/gitlab/qa/component/suggested_reviewer.rb
|
330
330
|
- lib/gitlab/qa/component/telegraf.rb
|
331
331
|
- lib/gitlab/qa/docker/command.rb
|
332
332
|
- lib/gitlab/qa/docker/engine.rb
|
333
|
-
- lib/gitlab/qa/docker/shellout.rb
|
334
333
|
- lib/gitlab/qa/docker/volumes.rb
|
335
334
|
- lib/gitlab/qa/release.rb
|
336
335
|
- lib/gitlab/qa/report/base_test_results.rb
|
336
|
+
- lib/gitlab/qa/report/find_set_dri.rb
|
337
337
|
- lib/gitlab/qa/report/generate_test_session.rb
|
338
338
|
- lib/gitlab/qa/report/gitlab_issue_client.rb
|
339
339
|
- lib/gitlab/qa/report/gitlab_issue_dry_client.rb
|
@@ -391,7 +391,6 @@ files:
|
|
391
391
|
- lib/gitlab/qa/scenario/test/integration/instance_saml.rb
|
392
392
|
- lib/gitlab/qa/scenario/test/integration/integrations.rb
|
393
393
|
- lib/gitlab/qa/scenario/test/integration/jira.rb
|
394
|
-
- lib/gitlab/qa/scenario/test/integration/kubernetes.rb
|
395
394
|
- lib/gitlab/qa/scenario/test/integration/ldap.rb
|
396
395
|
- lib/gitlab/qa/scenario/test/integration/ldap_no_server.rb
|
397
396
|
- lib/gitlab/qa/scenario/test/integration/ldap_no_tls.rb
|
@@ -407,24 +406,33 @@ files:
|
|
407
406
|
- lib/gitlab/qa/scenario/test/integration/saml.rb
|
408
407
|
- lib/gitlab/qa/scenario/test/integration/service_ping_disabled.rb
|
409
408
|
- lib/gitlab/qa/scenario/test/integration/smtp.rb
|
410
|
-
- lib/gitlab/qa/scenario/test/integration/
|
409
|
+
- lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
|
411
410
|
- lib/gitlab/qa/scenario/test/omnibus/image.rb
|
412
411
|
- lib/gitlab/qa/scenario/test/omnibus/update.rb
|
413
412
|
- lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb
|
414
413
|
- lib/gitlab/qa/scenario/test/omnibus/upgrade.rb
|
415
414
|
- lib/gitlab/qa/scenario/test/sanity/version.rb
|
415
|
+
- lib/gitlab/qa/service/cluster_provider/base.rb
|
416
|
+
- lib/gitlab/qa/service/cluster_provider/k3d.rb
|
417
|
+
- lib/gitlab/qa/service/kubernetes_cluster.rb
|
416
418
|
- lib/gitlab/qa/slack/post_to_slack.rb
|
417
|
-
- lib/gitlab/qa/support/dev_ee_qa_image.rb
|
418
419
|
- lib/gitlab/qa/support/get_request.rb
|
419
420
|
- lib/gitlab/qa/support/gitlab_upgrade_path.rb
|
420
421
|
- lib/gitlab/qa/support/gitlab_version_info.rb
|
421
422
|
- lib/gitlab/qa/support/http_request.rb
|
422
423
|
- lib/gitlab/qa/support/invalid_response_error.rb
|
424
|
+
- lib/gitlab/qa/support/shell_command.rb
|
425
|
+
- lib/gitlab/qa/support/shellout.rb
|
423
426
|
- lib/gitlab/qa/test_logger.rb
|
424
427
|
- lib/gitlab/qa/version.rb
|
425
428
|
- scripts/generate-qa-jobs.rb
|
426
429
|
- support/data/admin_access_token_seed.rb
|
427
430
|
- support/data/license_usage_seed.rb
|
431
|
+
- support/manifests/suggested_reviewer/authenticator.yaml
|
432
|
+
- support/manifests/suggested_reviewer/postgres.yaml
|
433
|
+
- support/manifests/suggested_reviewer/pubsub.yaml
|
434
|
+
- support/manifests/suggested_reviewer/recommender-bot.yaml
|
435
|
+
- support/manifests/suggested_reviewer/recommender.yaml
|
428
436
|
- tls_certificates/authority/ca.crt
|
429
437
|
- tls_certificates/authority/ca.key
|
430
438
|
- tls_certificates/authority/ca.pem
|
@@ -1,76 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'tempfile'
|
4
|
-
|
5
|
-
module Gitlab
|
6
|
-
module QA
|
7
|
-
module Component
|
8
|
-
class InternetTunnel < Base
|
9
|
-
DOCKER_IMAGE = 'gitlab/ssh-tunnel'
|
10
|
-
DOCKER_IMAGE_TAG = '1.0.0'
|
11
|
-
|
12
|
-
attr_writer :gitlab_hostname
|
13
|
-
|
14
|
-
def initialize
|
15
|
-
super
|
16
|
-
|
17
|
-
key_dir = ENV['CI_PROJECT_DIR'] || Dir.tmpdir
|
18
|
-
@ssh_key = Tempfile.new('tunnel-ssh-private-key', key_dir)
|
19
|
-
@ssh_key.write(ENV.fetch('TUNNEL_SSH_PRIVATE_KEY'))
|
20
|
-
@ssh_key.close
|
21
|
-
|
22
|
-
File.chmod(0o600, @ssh_key.path)
|
23
|
-
|
24
|
-
@volumes['/root/.ssh/id_rsa'] = @ssh_key.path
|
25
|
-
end
|
26
|
-
|
27
|
-
def instance
|
28
|
-
raise 'Please provide a block!' unless block_given?
|
29
|
-
|
30
|
-
super
|
31
|
-
end
|
32
|
-
|
33
|
-
def url
|
34
|
-
"https://#{subdomain}.#{tunnel_server_hostname}"
|
35
|
-
end
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
def name
|
40
|
-
@name ||= "ssh-tunnel-#{SecureRandom.hex(4)}"
|
41
|
-
end
|
42
|
-
|
43
|
-
def tunnel_server_hostname
|
44
|
-
ENV.fetch("TUNNEL_SERVER_HOSTNAME")
|
45
|
-
end
|
46
|
-
|
47
|
-
def subdomain
|
48
|
-
@subdomain ||= rand(30_000..49_000)
|
49
|
-
end
|
50
|
-
|
51
|
-
def start
|
52
|
-
raise "Must set gitlab_hostname" unless @gitlab_hostname
|
53
|
-
|
54
|
-
@docker.run(
|
55
|
-
image: DOCKER_IMAGE,
|
56
|
-
tag: DOCKER_IMAGE_TAG,
|
57
|
-
args: ["-o StrictHostKeyChecking=no -N -R #{subdomain}:#{@gitlab_hostname}:80 #{ENV.fetch('TUNNEL_SSH_USER')}@#{tunnel_server_hostname}"]) do |command|
|
58
|
-
command << '-d '
|
59
|
-
command << "--name #{name}"
|
60
|
-
command << "--net #{network}"
|
61
|
-
|
62
|
-
@volumes.to_h.each do |to, from|
|
63
|
-
command.volume(from, to, 'Z')
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def teardown
|
69
|
-
super
|
70
|
-
|
71
|
-
@ssh_key.unlink
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'open3'
|
4
|
-
require 'active_support/core_ext/string/filters'
|
5
|
-
|
6
|
-
module Gitlab
|
7
|
-
module QA
|
8
|
-
module Docker
|
9
|
-
class Shellout
|
10
|
-
using Rainbow
|
11
|
-
|
12
|
-
StatusError = Class.new(StandardError)
|
13
|
-
|
14
|
-
def initialize(command)
|
15
|
-
@command = command
|
16
|
-
@output = []
|
17
|
-
@logger = Runtime::Logger.logger
|
18
|
-
end
|
19
|
-
|
20
|
-
attr_reader :command, :output
|
21
|
-
|
22
|
-
def execute! # rubocop:disable Metrics/AbcSize
|
23
|
-
raise StatusError, 'Command already executed' if output.any?
|
24
|
-
|
25
|
-
logger.info("Docker shell command: `#{command.mask_secrets.cyan}`")
|
26
|
-
|
27
|
-
Open3.popen2e(@command.to_s) do |_in, out, wait|
|
28
|
-
out.each do |line|
|
29
|
-
output.push(line)
|
30
|
-
|
31
|
-
if stream_progress
|
32
|
-
print "."
|
33
|
-
elsif command.stream_output
|
34
|
-
puts line
|
35
|
-
end
|
36
|
-
|
37
|
-
yield line, wait if block_given?
|
38
|
-
end
|
39
|
-
puts if stream_progress && !output.empty?
|
40
|
-
|
41
|
-
fail! if wait.value.exited? && wait.value.exitstatus.nonzero?
|
42
|
-
|
43
|
-
logger.debug("Docker shell command output:\n#{string_output}") unless command.stream_output || output.empty?
|
44
|
-
end
|
45
|
-
|
46
|
-
string_output
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
|
-
|
51
|
-
attr_reader :logger
|
52
|
-
|
53
|
-
# Raise error and print output to error log level
|
54
|
-
#
|
55
|
-
# @return [void]
|
56
|
-
def fail!
|
57
|
-
logger.error("Docker shell command output:\n#{string_output}") unless command.stream_output
|
58
|
-
raise StatusError, "Docker command `#{command.mask_secrets.truncate(100)}` failed! " + "✘".red
|
59
|
-
end
|
60
|
-
|
61
|
-
# Stream only command execution progress and log output when command finished
|
62
|
-
#
|
63
|
-
# @return [Boolean]
|
64
|
-
def stream_progress
|
65
|
-
!(Runtime::Env.ci || command.stream_output)
|
66
|
-
end
|
67
|
-
|
68
|
-
# Stringified command output
|
69
|
-
#
|
70
|
-
# @return [String]
|
71
|
-
def string_output
|
72
|
-
output.join.chomp
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
|
5
|
-
module Gitlab
|
6
|
-
module QA
|
7
|
-
module Scenario
|
8
|
-
module Test
|
9
|
-
module Integration
|
10
|
-
class Kubernetes < Scenario::Template
|
11
|
-
def perform(release, *rspec_args)
|
12
|
-
Runtime::Env.require_kubernetes_environment!
|
13
|
-
|
14
|
-
Component::Gitlab.perform do |gitlab|
|
15
|
-
gitlab.release = release
|
16
|
-
gitlab.network = 'test'
|
17
|
-
|
18
|
-
Component::InternetTunnel.perform do |tunnel_gitlab|
|
19
|
-
Component::InternetTunnel.perform do |tunnel_registry|
|
20
|
-
tunnel_gitlab.gitlab_hostname = gitlab.hostname
|
21
|
-
tunnel_gitlab.network = 'test'
|
22
|
-
tunnel_registry.gitlab_hostname = gitlab.hostname
|
23
|
-
tunnel_registry.network = 'test'
|
24
|
-
|
25
|
-
gitlab.omnibus_configuration << <<~OMNIBUS
|
26
|
-
external_url '#{tunnel_gitlab.url}';
|
27
|
-
nginx['listen_port'] = 80;
|
28
|
-
nginx['listen_https'] = false;
|
29
|
-
|
30
|
-
registry_external_url '#{tunnel_registry.url}';
|
31
|
-
registry_nginx['listen_port'] = 80;
|
32
|
-
registry_nginx['listen_https'] = false;
|
33
|
-
OMNIBUS
|
34
|
-
|
35
|
-
tunnel_gitlab.instance do
|
36
|
-
tunnel_registry.instance do
|
37
|
-
gitlab.instance do
|
38
|
-
Component::Specs.perform do |specs|
|
39
|
-
specs.suite = 'Test::Integration::Kubernetes'
|
40
|
-
specs.release = gitlab.release
|
41
|
-
specs.network = gitlab.network
|
42
|
-
specs.args = [tunnel_gitlab.url, *rspec_args]
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Gitlab
|
4
|
-
module QA
|
5
|
-
module Scenario
|
6
|
-
module Test
|
7
|
-
module Integration
|
8
|
-
class SSHTunnel < Scenario::Template
|
9
|
-
def perform(release, *rspec_args)
|
10
|
-
Runtime::Env.override_default_password!
|
11
|
-
Runtime::Env.require_ssh_tunnel!
|
12
|
-
|
13
|
-
Component::Gitlab.perform do |gitlab|
|
14
|
-
gitlab.release = release
|
15
|
-
gitlab.network = 'test'
|
16
|
-
|
17
|
-
Component::InternetTunnel.perform do |tunnel_gitlab|
|
18
|
-
Component::InternetTunnel.perform do |tunnel_registry|
|
19
|
-
tunnel_gitlab.gitlab_hostname = gitlab.hostname
|
20
|
-
tunnel_gitlab.network = 'test'
|
21
|
-
tunnel_registry.gitlab_hostname = gitlab.hostname
|
22
|
-
tunnel_registry.network = 'test'
|
23
|
-
|
24
|
-
gitlab.omnibus_configuration << <<~OMNIBUS
|
25
|
-
external_url '#{tunnel_gitlab.url}';
|
26
|
-
nginx['listen_port'] = 80;
|
27
|
-
nginx['listen_https'] = false;
|
28
|
-
gitlab_rails['initial_root_password'] = '#{Runtime::Env.require_initial_password!}';
|
29
|
-
|
30
|
-
registry_external_url '#{tunnel_registry.url}';
|
31
|
-
registry_nginx['listen_port'] = 80;
|
32
|
-
registry_nginx['listen_https'] = false;
|
33
|
-
OMNIBUS
|
34
|
-
|
35
|
-
tunnel_gitlab.instance do
|
36
|
-
tunnel_registry.instance do
|
37
|
-
gitlab.instance do
|
38
|
-
Component::Specs.perform do |specs|
|
39
|
-
specs.suite = 'Test::Integration::SSHTunnel'
|
40
|
-
specs.release = gitlab.release
|
41
|
-
specs.network = gitlab.network
|
42
|
-
specs.args = [tunnel_gitlab.url, *rspec_args]
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|