gitlab-qa 7.18.0 → 7.21.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 -7
- data/docs/what_tests_can_be_run.md +1 -0
- data/lib/gitlab/qa/component/gitlab.rb +13 -2
- data/lib/gitlab/qa/component/telegraf.rb +174 -0
- data/lib/gitlab/qa/report/generate_test_session.rb +2 -1
- data/lib/gitlab/qa/report/report_as_issue.rb +1 -1
- data/lib/gitlab/qa/report/results_in_issues.rb +4 -0
- data/lib/gitlab/qa/report/results_in_testcases.rb +24 -1
- data/lib/gitlab/qa/report/results_reporter_shared.rb +7 -2
- data/lib/gitlab/qa/runner.rb +16 -3
- data/lib/gitlab/qa/runtime/env.rb +11 -14
- data/lib/gitlab/qa/version.rb +1 -1
- data/lib/gitlab/qa.rb +1 -1
- metadata +3 -3
- data/lib/gitlab/qa/scenario/test/integration/cloud_activation.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: 7df136e02dc7640dd456d9e6f0f089cfdf105c7e8d4983ee41e487081eadb3eb
|
|
4
|
+
data.tar.gz: 9ab31d33024c1a2e6826213028e4a1f1c3ab69c8ece4d230be79a4f3b1f15108
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5420d4ffea08d120903f51fa9d590b20cfee1686ecdff384ac2ff931ba1ead170409a412e3c45cb96f6310359540d245624bf05fce654f106030550d68ff8928
|
|
7
|
+
data.tar.gz: 459ce3e23b1113bcb52b2413d6cae58dc9946976e7615833fd5fbe9d0b979d0894c964fc6565cb2a0e13e9953369c4073b6a5ec00510b24edec3cd4b2ad00a61
|
data/.gitlab-ci.yml
CHANGED
|
@@ -21,9 +21,6 @@ default:
|
|
|
21
21
|
- bundle version
|
|
22
22
|
- bundle config path vendor
|
|
23
23
|
- bundle install --jobs=$(nproc) --retry=3 --quiet && bundle check
|
|
24
|
-
- if [ -n "$TRIGGERED_USER" ] && [ -n "$TRIGGER_SOURCE" ]; then
|
|
25
|
-
echo "Pipeline triggered by $TRIGGERED_USER at $TRIGGER_SOURCE";
|
|
26
|
-
fi
|
|
27
24
|
- export LANG=C.UTF-8
|
|
28
25
|
|
|
29
26
|
workflow:
|
|
@@ -1212,7 +1209,6 @@ ee:large-setup:
|
|
|
1212
1209
|
ee:cloud-activation:
|
|
1213
1210
|
before_script:
|
|
1214
1211
|
- unset EE_LICENSE
|
|
1215
|
-
- unset GITLAB_QA_FORMLESS_LOGIN_TOKEN
|
|
1216
1212
|
- !reference [default, before_script]
|
|
1217
1213
|
extends:
|
|
1218
1214
|
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
|
@@ -1221,12 +1217,11 @@ ee:cloud-activation:
|
|
|
1221
1217
|
- .ee-variables
|
|
1222
1218
|
- .rspec-report-opts
|
|
1223
1219
|
variables:
|
|
1224
|
-
|
|
1220
|
+
QA_RSPEC_TAGS: "--tag cloud_activation"
|
|
1225
1221
|
|
|
1226
1222
|
ee:cloud-activation-quarantine:
|
|
1227
1223
|
before_script:
|
|
1228
1224
|
- unset EE_LICENSE
|
|
1229
|
-
- unset GITLAB_QA_FORMLESS_LOGIN_TOKEN
|
|
1230
1225
|
- !reference [default, before_script]
|
|
1231
1226
|
extends:
|
|
1232
1227
|
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
|
@@ -1236,7 +1231,7 @@ ee:cloud-activation-quarantine:
|
|
|
1236
1231
|
- .quarantine
|
|
1237
1232
|
- .rspec-report-opts
|
|
1238
1233
|
variables:
|
|
1239
|
-
|
|
1234
|
+
QA_RSPEC_TAGS: "--tag cloud_activation"
|
|
1240
1235
|
|
|
1241
1236
|
# This job requires the `GITLAB_QA_ACCESS_TOKEN` and `GITLAB_QA_DEV_ACCESS_TOKEN`
|
|
1242
1237
|
# variable to be passed when triggered.
|
|
@@ -59,6 +59,7 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
|
|
|
59
59
|
| `GITLAB_QA_ADMIN_ACCESS_TOKEN` |- | A valid personal access token with the `api` scope from a user with admin access. Used for API access as an admin during tests. | No|
|
|
60
60
|
| `GITLAB_QA_CONTAINER_REGISTRY_ACCESS_TOKEN` | - | A valid personal access token with the `read_registry` scope. Used to [access the container registry on `registry.gitlab.com` when tests run in a CI job that _is not_ triggered via another pipeline](https://gitlab.com/gitlab-org/gitlab-qa/-/blob/364addb83e7b136ff0f9d8719ca9553d290aa9ab/lib/gitlab/qa/release.rb#L152). For example, if you manually run a [new Staging pipeline](https://ops.gitlab.net/gitlab-org/quality/staging/-/pipelines/new), this token will be used. | No |
|
|
61
61
|
| `EE_LICENSE` |- | Enterprise Edition license. | No|
|
|
62
|
+
| `QA_EE_ACTIVATION_CODE` |- | Cloud activation code to enable Enterprise Edition features. | No|
|
|
62
63
|
| `QA_ARTIFACTS_DIR` |`/tmp/gitlab-qa`| Path to a directory where artifacts (logs and screenshots) for failing tests will be saved. | No|
|
|
63
64
|
| `DOCKER_HOST` |`http://localhost`| Docker host to run tests against. | No|
|
|
64
65
|
| `WEBDRIVER_HEADLESS` |- | When running locally, set to `false` to allow Chrome tests to be visible - watch your tests being run. | No|
|
|
@@ -12,7 +12,7 @@ module Gitlab
|
|
|
12
12
|
class Gitlab < Base
|
|
13
13
|
extend Forwardable
|
|
14
14
|
|
|
15
|
-
attr_reader :release, :omnibus_configuration
|
|
15
|
+
attr_reader :release, :omnibus_configuration, :omnibus_gitlab_rails_env
|
|
16
16
|
attr_accessor :tls, :skip_availability_check, :runner_network
|
|
17
17
|
attr_writer :name, :relative_path
|
|
18
18
|
|
|
@@ -29,6 +29,7 @@ module Gitlab
|
|
|
29
29
|
super
|
|
30
30
|
|
|
31
31
|
@skip_availability_check = false
|
|
32
|
+
@omnibus_gitlab_rails_env = {}
|
|
32
33
|
|
|
33
34
|
@volumes[GITLAB_CERTIFICATES_PATH] = SSL_PATH
|
|
34
35
|
@volumes[AUTHORITY_CERTIFICATES_PATH] = TRUSTED_PATH
|
|
@@ -41,7 +42,14 @@ module Gitlab
|
|
|
41
42
|
def set_formless_login_token
|
|
42
43
|
return if Runtime::Env.gitlab_qa_formless_login_token.to_s.strip.empty?
|
|
43
44
|
|
|
44
|
-
@
|
|
45
|
+
@omnibus_gitlab_rails_env['GITLAB_QA_FORMLESS_LOGIN_TOKEN'] = Runtime::Env.gitlab_qa_formless_login_token
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def set_license_mode
|
|
49
|
+
return unless Runtime::Env.test_license_mode?
|
|
50
|
+
|
|
51
|
+
@omnibus_gitlab_rails_env['GITLAB_LICENSE_MODE'] = 'test'
|
|
52
|
+
@omnibus_gitlab_rails_env['CUSTOMER_PORTAL_URL'] = 'https://customers.staging.gitlab.com'
|
|
45
53
|
end
|
|
46
54
|
|
|
47
55
|
def elastic_url=(url)
|
|
@@ -95,6 +103,9 @@ module Gitlab
|
|
|
95
103
|
|
|
96
104
|
def prepare_gitlab_omnibus_config
|
|
97
105
|
set_formless_login_token
|
|
106
|
+
set_license_mode
|
|
107
|
+
|
|
108
|
+
@omnibus_configuration << "gitlab_rails['env'] = #{@omnibus_gitlab_rails_env}" unless omnibus_gitlab_rails_env.empty?
|
|
98
109
|
end
|
|
99
110
|
|
|
100
111
|
def start # rubocop:disable Metrics/AbcSize
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'tempfile'
|
|
4
|
+
|
|
5
|
+
module Gitlab
|
|
6
|
+
module QA
|
|
7
|
+
module Component
|
|
8
|
+
# Component to collect docker metrics
|
|
9
|
+
#
|
|
10
|
+
class Telegraf < Base
|
|
11
|
+
DOCKER_IMAGE = 'telegraf'
|
|
12
|
+
DOCKER_IMAGE_TAG = '1.21-alpine'
|
|
13
|
+
LOG_DIR = '/etc/telegraf/log'
|
|
14
|
+
|
|
15
|
+
def initialize
|
|
16
|
+
super
|
|
17
|
+
|
|
18
|
+
@name = DOCKER_IMAGE
|
|
19
|
+
@host_log_dir = "#{Runtime::Env.host_artifacts_dir}/#{@name}"
|
|
20
|
+
@environment = Runtime::Env.variables.slice(
|
|
21
|
+
'QA_INFLUXDB_TOKEN',
|
|
22
|
+
'QA_INFLUXDB_URL',
|
|
23
|
+
'QA_RUN_TYPE',
|
|
24
|
+
'CI_JOB_NAME',
|
|
25
|
+
'CI_PIPELINE_ID'
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
attr_reader :name, :host_log_dir, :telegraf_config
|
|
30
|
+
|
|
31
|
+
# Start container
|
|
32
|
+
#
|
|
33
|
+
# @return [void]
|
|
34
|
+
def start
|
|
35
|
+
docker.run(image: image, tag: tag) do |command|
|
|
36
|
+
set_command_args(command)
|
|
37
|
+
set_volumes(command)
|
|
38
|
+
set_environment(command)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Run prepare commands
|
|
43
|
+
#
|
|
44
|
+
# @return [void]
|
|
45
|
+
def prepare
|
|
46
|
+
@telegraf_config = File.open("#{Dir.mktmpdir(nil, ENV['CI_BUILDS_DIR'])}/telegraf.conf", 'w') do |file|
|
|
47
|
+
file.write(config)
|
|
48
|
+
file.path
|
|
49
|
+
end
|
|
50
|
+
FileUtils.mkdir_p(host_log_dir)
|
|
51
|
+
|
|
52
|
+
prepare_docker_image
|
|
53
|
+
prepare_docker_container
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Run teardown
|
|
57
|
+
#
|
|
58
|
+
# @return [void]
|
|
59
|
+
def teardown
|
|
60
|
+
return unless run_telegraf?
|
|
61
|
+
|
|
62
|
+
super
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
private
|
|
66
|
+
|
|
67
|
+
# Set custom run command arguments
|
|
68
|
+
#
|
|
69
|
+
# @param [Docker::Command] command
|
|
70
|
+
# @return [void]
|
|
71
|
+
def set_command_args(command)
|
|
72
|
+
command << '-d'
|
|
73
|
+
command << "--name #{name}"
|
|
74
|
+
command << "--user root"
|
|
75
|
+
command << "--entrypoint telegraf"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Set volumes
|
|
79
|
+
#
|
|
80
|
+
# @param [Docker::Command] command
|
|
81
|
+
# @return [void]
|
|
82
|
+
def set_volumes(command)
|
|
83
|
+
command.volume(host_log_dir, LOG_DIR)
|
|
84
|
+
command.volume('/var/run/docker.sock', '/var/run/docker.sock')
|
|
85
|
+
command.volume(telegraf_config, '/etc/telegraf/telegraf.conf', :ro)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Set environment variables
|
|
89
|
+
#
|
|
90
|
+
# @param [Docker::Command] command
|
|
91
|
+
# @return [void]
|
|
92
|
+
def set_environment(command)
|
|
93
|
+
environment.each { |k, v| command.env(k, v) }
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Run main entrypoint
|
|
97
|
+
#
|
|
98
|
+
# @return [void]
|
|
99
|
+
def instance_no_teardown
|
|
100
|
+
if run_telegraf?
|
|
101
|
+
super
|
|
102
|
+
else
|
|
103
|
+
Runtime::Logger.debug("Skipping starting telegraf container!")
|
|
104
|
+
yield self if block_given?
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Should telegraf be started
|
|
109
|
+
#
|
|
110
|
+
# Run only on CI and skip if metrics explicitly disabled, run_type not set or influx params missing
|
|
111
|
+
#
|
|
112
|
+
# @return [Boolean]
|
|
113
|
+
def run_telegraf?
|
|
114
|
+
Runtime::Env.ci && Runtime::Env.qa_export_test_metrics? && Runtime::Env.qa_run_type && !missing_influx_config?
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Influxdb config params missing
|
|
118
|
+
#
|
|
119
|
+
# @return [Boolean]
|
|
120
|
+
def missing_influx_config?
|
|
121
|
+
environment.slice('QA_INFLUXDB_TOKEN', 'QA_INFLUXDB_URL').any? { |_k, v| v.blank? }
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Telegraf configuration
|
|
125
|
+
#
|
|
126
|
+
# @return [String]
|
|
127
|
+
def config
|
|
128
|
+
<<~CONFIG
|
|
129
|
+
[global_tags]
|
|
130
|
+
run_type = "${QA_RUN_TYPE}"
|
|
131
|
+
pipeline_id = "${CI_PIPELINE_ID}"
|
|
132
|
+
job_name = "${CI_JOB_NAME}"
|
|
133
|
+
|
|
134
|
+
[agent]
|
|
135
|
+
interval = "1s"
|
|
136
|
+
round_interval = true
|
|
137
|
+
metric_batch_size = 1000
|
|
138
|
+
metric_buffer_limit = 10000
|
|
139
|
+
collection_jitter = "0s"
|
|
140
|
+
flush_interval = "10s"
|
|
141
|
+
flush_jitter = "0s"
|
|
142
|
+
precision = ""
|
|
143
|
+
debug = true
|
|
144
|
+
logtarget = "file"
|
|
145
|
+
logfile = "#{LOG_DIR}/telegraf.log"
|
|
146
|
+
hostname = ""
|
|
147
|
+
omit_hostname = false
|
|
148
|
+
|
|
149
|
+
[[outputs.influxdb_v2]]
|
|
150
|
+
urls = ["${QA_INFLUXDB_URL}"]
|
|
151
|
+
token = "${QA_INFLUXDB_TOKEN}"
|
|
152
|
+
organization = "gitlab-qa"
|
|
153
|
+
bucket = "test-env-stats"
|
|
154
|
+
|
|
155
|
+
[[inputs.docker]]
|
|
156
|
+
endpoint = "unix:///var/run/docker.sock"
|
|
157
|
+
gather_services = false
|
|
158
|
+
container_names = []
|
|
159
|
+
source_tag = false
|
|
160
|
+
container_name_include = ["gitlab-{ce,ee}-*", "gitlab-{ce,ee}-qa-*"]
|
|
161
|
+
container_name_exclude = []
|
|
162
|
+
timeout = "5s"
|
|
163
|
+
perdevice = false
|
|
164
|
+
perdevice_include = []
|
|
165
|
+
total = true
|
|
166
|
+
total_include = ["cpu", "blkio", "network"]
|
|
167
|
+
docker_label_include = []
|
|
168
|
+
docker_label_exclude = []
|
|
169
|
+
CONFIG
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'erb'
|
|
4
|
+
require 'date'
|
|
4
5
|
|
|
5
6
|
module Gitlab
|
|
6
7
|
module QA
|
|
@@ -24,7 +25,7 @@ module Gitlab
|
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
issue = gitlab.create_issue(
|
|
27
|
-
title: "Test session report | #{pipeline}",
|
|
28
|
+
title: "#{Time.now.strftime('%Y-%m-%d')} Test session report | #{pipeline}",
|
|
28
29
|
description: generate_description(tests),
|
|
29
30
|
labels: ['Quality', 'QA', 'triage report', pipeline_name_label]
|
|
30
31
|
)
|
|
@@ -122,7 +122,7 @@ module Gitlab
|
|
|
122
122
|
"found:canary.staging.gitlab.com"
|
|
123
123
|
when 'preprod'
|
|
124
124
|
'found:pre.gitlab.com'
|
|
125
|
-
when '
|
|
125
|
+
when 'nightly', QA::Runtime::Env.default_branch, 'staging-ref', 'release'
|
|
126
126
|
"found:#{pipeline}"
|
|
127
127
|
else
|
|
128
128
|
raise "No `found:*` label for the `#{pipeline}` pipeline!"
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'erb'
|
|
4
|
+
|
|
3
5
|
module Gitlab
|
|
4
6
|
module QA
|
|
5
7
|
module Report
|
|
@@ -59,7 +61,28 @@ module Gitlab
|
|
|
59
61
|
end
|
|
60
62
|
|
|
61
63
|
def new_issue_description(test)
|
|
62
|
-
"#{super}#{
|
|
64
|
+
"#{super}\n\n#{execution_graph_section(test)}"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def execution_graph_section(test)
|
|
68
|
+
formatted_title = ERB::Util.url_encode(test.name)
|
|
69
|
+
|
|
70
|
+
<<~MKDOWN.strip
|
|
71
|
+
### Executions
|
|
72
|
+
|
|
73
|
+
package-and-qa:
|
|
74
|
+
<img src="https://dashboards.quality.gitlab.net/render/d-solo/cW0UMgv7k/spec-health?orgId=1&var-run_type=package-and-qa&var-name=#{formatted_title}&panelId=4&width=1000&height=500" />
|
|
75
|
+
MKDOWN
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def updated_description(testcase, test)
|
|
79
|
+
historical_results_section = testcase.description.match(/### DO NOT EDIT BELOW THIS LINE[\s\S]+/)
|
|
80
|
+
|
|
81
|
+
"#{new_issue_description(test)}\n\n#{historical_results_section}"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def issue_title_needs_updating?(testcase, test)
|
|
85
|
+
super || !testcase.description.include?(execution_graph_section(test)) && !%w[canary production preprod release].include?(pipeline)
|
|
63
86
|
end
|
|
64
87
|
end
|
|
65
88
|
end
|
|
@@ -47,9 +47,14 @@ module Gitlab
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def update_issue_title(issue, test)
|
|
50
|
-
|
|
50
|
+
old_title = issue.title.strip
|
|
51
|
+
new_title = title_from_test(test)
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
warn(%(#{issue_type} title needs to be updated from '#{old_title}' to '#{new_title}'))
|
|
54
|
+
|
|
55
|
+
new_description = updated_description(issue, test)
|
|
56
|
+
|
|
57
|
+
gitlab.edit_issue(iid: issue.iid, options: { title: new_title, description: new_description })
|
|
53
58
|
end
|
|
54
59
|
|
|
55
60
|
private
|
data/lib/gitlab/qa/runner.rb
CHANGED
|
@@ -62,16 +62,17 @@ module Gitlab
|
|
|
62
62
|
args = remove_gitlab_qa_args(args)
|
|
63
63
|
|
|
64
64
|
if args.size >= 1
|
|
65
|
+
scenario = Scenario.const_get(args.shift)
|
|
66
|
+
|
|
65
67
|
load_omnibus_configurations
|
|
68
|
+
load_telegraf(scenario)
|
|
66
69
|
|
|
67
70
|
begin
|
|
68
71
|
@active_configurators.compact.each do |configurator|
|
|
69
72
|
configurator.instance(skip_teardown: true)
|
|
70
73
|
end
|
|
71
74
|
|
|
72
|
-
|
|
73
|
-
.const_get(args.shift)
|
|
74
|
-
.perform(*args)
|
|
75
|
+
scenario.perform(*args)
|
|
75
76
|
ensure
|
|
76
77
|
@active_configurators.compact.each(&:teardown)
|
|
77
78
|
end
|
|
@@ -100,6 +101,18 @@ module Gitlab
|
|
|
100
101
|
end.compact
|
|
101
102
|
end
|
|
102
103
|
|
|
104
|
+
# Start telegraf agent for metrics collection
|
|
105
|
+
#
|
|
106
|
+
# Do not load when running against external instance
|
|
107
|
+
#
|
|
108
|
+
# @param [Class] scenario
|
|
109
|
+
# @return [void]
|
|
110
|
+
def self.load_telegraf(scenario)
|
|
111
|
+
return if scenario <= Scenario::Test::Instance::DeploymentBase || scenario == Scenario::Test::Instance::Any
|
|
112
|
+
|
|
113
|
+
@active_configurators << Component::Telegraf.new
|
|
114
|
+
end
|
|
115
|
+
|
|
103
116
|
def self.load_omnibus_configurations
|
|
104
117
|
# OmnibusConfiguration::Test => --test
|
|
105
118
|
# OmnibusConfiguration::HelloThere => --hello_there
|
|
@@ -36,6 +36,7 @@ module Gitlab
|
|
|
36
36
|
'QA_SLOW_CONNECTION_LATENCY_MS' => :qa_slow_connection_latency_ms,
|
|
37
37
|
'QA_SLOW_CONNECTION_THROUGHPUT_KBPS' => :qa_slow_connection_throughput_kbps,
|
|
38
38
|
'QA_GENERATE_ALLURE_REPORT' => :generate_allure_report,
|
|
39
|
+
'QA_EE_ACTIVATION_CODE' => :ee_activation_code,
|
|
39
40
|
'QA_EXPORT_TEST_METRICS' => :qa_export_test_metrics,
|
|
40
41
|
'QA_INFLUXDB_URL' => :qa_influxdb_url,
|
|
41
42
|
'QA_INFLUXDB_TOKEN' => :qa_influxdb_token,
|
|
@@ -141,16 +142,12 @@ module Gitlab
|
|
|
141
142
|
end
|
|
142
143
|
|
|
143
144
|
def variables
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
ENV_VARIABLES.each do |name, attribute|
|
|
145
|
+
ENV_VARIABLES.each_with_object({}) do |(name, attribute), vars|
|
|
147
146
|
# Variables that are overridden in the environment take precedence
|
|
148
147
|
# over the defaults specified by the QA runtime.
|
|
149
148
|
value = env_var_name_if_defined(name) || send(attribute) # rubocop:disable GitlabSecurity/PublicSend
|
|
150
149
|
vars[name] = value if value
|
|
151
150
|
end
|
|
152
|
-
|
|
153
|
-
vars
|
|
154
151
|
end
|
|
155
152
|
|
|
156
153
|
def debug?
|
|
@@ -178,15 +175,7 @@ module Gitlab
|
|
|
178
175
|
end
|
|
179
176
|
|
|
180
177
|
def pipeline_from_project_name
|
|
181
|
-
|
|
182
|
-
if env_var_value_if_defined('TOP_UPSTREAM_SOURCE_JOB').to_s.start_with?('https://ops.gitlab.net')
|
|
183
|
-
'staging-orchestrated'
|
|
184
|
-
else
|
|
185
|
-
QA::Runtime::Env.default_branch
|
|
186
|
-
end
|
|
187
|
-
else
|
|
188
|
-
ci_project_name
|
|
189
|
-
end
|
|
178
|
+
ci_project_name.to_s.start_with?('gitlab-qa') ? QA::Runtime::Env.default_branch : ci_project_name
|
|
190
179
|
end
|
|
191
180
|
|
|
192
181
|
def run_id
|
|
@@ -309,6 +298,14 @@ module Gitlab
|
|
|
309
298
|
enabled?(env_var_value_if_defined('GEO_FAILOVER'), default: false)
|
|
310
299
|
end
|
|
311
300
|
|
|
301
|
+
def test_license_mode?
|
|
302
|
+
enabled?(env_var_value_if_defined('TEST_LICENSE_MODE'), default: false)
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
def qa_export_test_metrics?
|
|
306
|
+
enabled?(env_var_value_if_defined('QA_EXPORT_TEST_METRICS'), default: true)
|
|
307
|
+
end
|
|
308
|
+
|
|
312
309
|
private
|
|
313
310
|
|
|
314
311
|
def enabled?(value, default: true)
|
data/lib/gitlab/qa/version.rb
CHANGED
data/lib/gitlab/qa.rb
CHANGED
|
@@ -74,7 +74,6 @@ module Gitlab
|
|
|
74
74
|
autoload :Registry, 'gitlab/qa/scenario/test/integration/registry'
|
|
75
75
|
autoload :RegistryTLS, 'gitlab/qa/scenario/test/integration/registry_tls'
|
|
76
76
|
autoload :ServicePingDisabled, 'gitlab/qa/scenario/test/integration/service_ping_disabled'
|
|
77
|
-
autoload :CloudActivation, 'gitlab/qa/scenario/test/integration/cloud_activation'
|
|
78
77
|
end
|
|
79
78
|
|
|
80
79
|
module Sanity
|
|
@@ -100,6 +99,7 @@ module Gitlab
|
|
|
100
99
|
autoload :MailHog, 'gitlab/qa/component/mail_hog'
|
|
101
100
|
autoload :Jira, 'gitlab/qa/component/jira'
|
|
102
101
|
autoload :PostgreSQL, 'gitlab/qa/component/postgresql'
|
|
102
|
+
autoload :Telegraf, 'gitlab/qa/component/telegraf'
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
module Support
|
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: 7.
|
|
4
|
+
version: 7.21.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-01-
|
|
11
|
+
date: 2022-01-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|
|
@@ -256,6 +256,7 @@ files:
|
|
|
256
256
|
- lib/gitlab/qa/component/specs.rb
|
|
257
257
|
- lib/gitlab/qa/component/staging.rb
|
|
258
258
|
- lib/gitlab/qa/component/staging_ref.rb
|
|
259
|
+
- lib/gitlab/qa/component/telegraf.rb
|
|
259
260
|
- lib/gitlab/qa/docker/command.rb
|
|
260
261
|
- lib/gitlab/qa/docker/engine.rb
|
|
261
262
|
- lib/gitlab/qa/docker/shellout.rb
|
|
@@ -310,7 +311,6 @@ files:
|
|
|
310
311
|
- lib/gitlab/qa/scenario/test/instance/staging_ref.rb
|
|
311
312
|
- lib/gitlab/qa/scenario/test/integration/actioncable.rb
|
|
312
313
|
- lib/gitlab/qa/scenario/test/integration/client_ssl.rb
|
|
313
|
-
- lib/gitlab/qa/scenario/test/integration/cloud_activation.rb
|
|
314
314
|
- lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
|
|
315
315
|
- lib/gitlab/qa/scenario/test/integration/geo.rb
|
|
316
316
|
- lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb
|
|
@@ -1,36 +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 CloudActivation < Scenario::Template
|
|
9
|
-
def perform(release, *rspec_args)
|
|
10
|
-
Component::Gitlab.perform do |gitlab|
|
|
11
|
-
gitlab.release = release
|
|
12
|
-
gitlab.network = 'test'
|
|
13
|
-
|
|
14
|
-
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
15
|
-
gitlab_rails['env'] = { 'GITLAB_LICENSE_MODE' => 'test', 'CUSTOMER_PORTAL_URL' => 'https://customers.staging.gitlab.com' }
|
|
16
|
-
OMNIBUS
|
|
17
|
-
|
|
18
|
-
gitlab.instance do
|
|
19
|
-
rspec_args << "--" unless rspec_args.include?('--')
|
|
20
|
-
rspec_args << %w[--tag cloud_activation]
|
|
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
|