gitlab-qa 7.19.0 → 7.22.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 +20 -4
- data/README.md +0 -1
- data/docs/what_tests_can_be_run.md +47 -5
- 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 +6 -14
- data/lib/gitlab/qa/scenario/test/integration/integrations.rb +32 -0
- data/lib/gitlab/qa/version.rb +1 -1
- data/lib/gitlab/qa.rb +2 -0
- metadata +4 -3
- data/docs/running_specific_orchestrated_tests.md +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 844c99c0251d384017a5276158c67476caba4da667ac93fd5c753641173a3c22
|
|
4
|
+
data.tar.gz: b67e5382bb0493a147dcaef6b6afa6e63591673b302c04dafb00a07da6e428c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a0342f9b71831a3f5d0924506e6f00d0f0621e0bc44096b285d2346afb23284bb56ade7778fc1613df5a3c3bc3f13e10ef58634f38e57eb95fbd45f99d1f776
|
|
7
|
+
data.tar.gz: 91a8a798f1b3f642954022124e8cb3ca07ec52b2579503979c973e880a5cea202447a15dc5b869aa6ac291745f6ed6f5075e527d10af6d84adc615321f7de5fb
|
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:
|
|
@@ -98,7 +95,11 @@ rspec:
|
|
|
98
95
|
.combined-gitlab-qa-options-script:
|
|
99
96
|
script:
|
|
100
97
|
- 'echo "Running: bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTIONS_COMBINED -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS"'
|
|
101
|
-
- bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTIONS_COMBINED -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS
|
|
98
|
+
- bundle exec exe/gitlab-qa ${QA_SCENARIO:=Test::Instance::Image} ${RELEASE:=$DEFAULT_RELEASE} $GITLAB_QA_OPTIONS_COMBINED -- $QA_TESTS $QA_RSPEC_TAGS $RSPEC_REPORT_OPTS || test_run_exit_code=$?
|
|
99
|
+
- bundle exec exe/gitlab-qa-report --update-screenshot-path "gitlab-qa-run-*/**/rspec-*.xml"
|
|
100
|
+
- export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
|
|
101
|
+
- if [ "$TOP_UPSTREAM_SOURCE_REF" == $TOP_UPSTREAM_DEFAULT_BRANCH ] || [[ "$TOP_UPSTREAM_SOURCE_JOB" == https://ops.gitlab.net* ]]; then exe/gitlab-qa-report --report-results "gitlab-qa-run-*/**/rspec-*.json" --test-case-project "$QA_TESTCASES_REPORTING_PROJECT" --results-issue-project "$QA_TEST_RESULTS_ISSUES_PROJECT" || true; fi
|
|
102
|
+
- exit $test_run_exit_code
|
|
102
103
|
|
|
103
104
|
# The Test::Omnibus::Update scenarios require the release to be specified twice, which can't be done dynamically using the `variables` parameter
|
|
104
105
|
# So instead we can use this script with two release variables
|
|
@@ -1189,6 +1190,21 @@ ee:jira-quarantine:
|
|
|
1189
1190
|
variables:
|
|
1190
1191
|
QA_SCENARIO: "Test::Integration::Jira"
|
|
1191
1192
|
|
|
1193
|
+
ce:integrations:
|
|
1194
|
+
extends:
|
|
1195
|
+
- .rules:ce-never-when-triggered-by-feature-flag-definition-change
|
|
1196
|
+
- .test
|
|
1197
|
+
- .high-capacity
|
|
1198
|
+
- .ce-variables
|
|
1199
|
+
- .rspec-report-opts
|
|
1200
|
+
variables:
|
|
1201
|
+
QA_SCENARIO: "Test::Integration::Integrations"
|
|
1202
|
+
|
|
1203
|
+
ce:integrations-quarantine:
|
|
1204
|
+
extends:
|
|
1205
|
+
- ce:integrations
|
|
1206
|
+
- .quarantine
|
|
1207
|
+
|
|
1192
1208
|
ce:large-setup:
|
|
1193
1209
|
extends:
|
|
1194
1210
|
- .rules:ce-never-when-triggered-by-feature-flag-definition-change
|
data/README.md
CHANGED
|
@@ -88,7 +88,6 @@ of tests.
|
|
|
88
88
|
- [How it works](docs/how_it_works.md)
|
|
89
89
|
- [Release process](docs/release_process.md)
|
|
90
90
|
- [Run QA tests against your GDK setup](docs/run_qa_against_gdk.md)
|
|
91
|
-
- [Running specific orchestrated tests](docs/running_specific_orchestrated_tests.md)
|
|
92
91
|
- [Trainings](docs/trainings.md)
|
|
93
92
|
- [Waits](docs/waits.md)
|
|
94
93
|
- [What tests can be run?](docs/what_tests_can_be_run.md)
|
|
@@ -95,6 +95,7 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
|
|
|
95
95
|
| `GITLAB_QA_USER_AGENT` |- | The browser user-agent to use instead of the default Chrome user-agent. | No|
|
|
96
96
|
| `GEO_FAILOVER` | `false` | Set to `true` when a Geo secondary site has been promoted to a Geo primary site. | No|
|
|
97
97
|
| `GITLAB_INITIAL_ROOT_PASSWORD` | `5iveL!fe` | Initial root password for Omnibus installations | No|
|
|
98
|
+
| `COLORIZED_LOGS` | `false` | Colors GitLab QA and test logs to improve readability | No|
|
|
98
99
|
|
|
99
100
|
## [Supported Remote Grid environment variables](./running_against_remote_grid.md)
|
|
100
101
|
|
|
@@ -664,6 +665,20 @@ Example:
|
|
|
664
665
|
$ gitlab-qa Test::Integration::Actioncable CE
|
|
665
666
|
```
|
|
666
667
|
|
|
668
|
+
### `Test::Integration::Integrations CE|<full image address>`
|
|
669
|
+
|
|
670
|
+
This scenario is intended to test the different integrations that a GitLab instance can offer, such as WebHooks to an external service, Jenkins, etc.
|
|
671
|
+
|
|
672
|
+
To run tests against the GitLab container, a GitLab QA (`gitlab/gitlab-qa`)
|
|
673
|
+
container is spun up and tests are run from it by running the
|
|
674
|
+
`Test::Integration::Integrations` scenario.
|
|
675
|
+
|
|
676
|
+
Example:
|
|
677
|
+
|
|
678
|
+
```
|
|
679
|
+
$ gitlab-qa Test::Integration::Integrations CE
|
|
680
|
+
```
|
|
681
|
+
|
|
667
682
|
### `Test::Instance::Any CE|EE|<full image address>:nightly|latest|any_tag http://your.instance.gitlab`
|
|
668
683
|
|
|
669
684
|
This tests that a live GitLab instance works as expected by running tests
|
|
@@ -877,12 +892,39 @@ $ gitlab-qa Test::Instance::Airgapped EE -- --tag smoke
|
|
|
877
892
|
|
|
878
893
|
### `Test::Instance::Image CE|EE|<full image address> --omnibus-config object_storage`
|
|
879
894
|
|
|
880
|
-
This orchestrated scenario runs tests from the test suite against a GitLab instance which has object storage configured instead of using local storage. The omnibus configuration `object_storage` ([configurator](configuring_omnibus.md)), uses Minio and `object_storage_aws` uses an AWS S3 account with credentials configured in the pipeline as CI Variables
|
|
895
|
+
This orchestrated scenario runs tests from the test suite against a GitLab instance which has object storage configured instead of using local storage. The omnibus configuration `object_storage` ([configurator](configuring_omnibus.md)), uses Minio and `object_storage_aws` uses an AWS S3 account with credentials configured in the pipeline as CI Variables. To use Google Cloud Storage pass `--omnibus-config object_storage_gcp`. According to the storage selected it requires:
|
|
896
|
+
|
|
897
|
+
| Scenario | Variable | Description |
|
|
898
|
+
|-----------------------|---------------------|--------------------------------------|
|
|
899
|
+
| AWS S3 Object Storage | AWS_S3_REGION | AWS region where bucket is created |
|
|
900
|
+
| AWS S3 Object Storage | AWS_S3_KEY_ID | AWS credentials |
|
|
901
|
+
| AWS S3 Object Storage | AWS_S3_ACCESS_KEY | AWS credentials |
|
|
902
|
+
| AWS S3 Object Storage | AWS_S3_BUCKET_NAME | Name of the bucket set in AWS |
|
|
903
|
+
| GCP Object Storage | GCS_BUCKET_NAME | Name of the bucket set in AWS |
|
|
904
|
+
| GCP Object Storage | GOOGLE_JSON_KEY | JSON key credential |
|
|
905
|
+
| GCP Object Storage | GOOGLE_CLIENT_EMAIL | Email address of the service account |
|
|
906
|
+
| GCP Object Storage | GOOGLE_PROJECT | GCP project name |
|
|
907
|
+
|
|
908
|
+
These variables are available at 1Password QA Vault.
|
|
909
|
+
|
|
910
|
+
### `Test::Integration::RegistryTLS EE`
|
|
911
|
+
|
|
912
|
+
It requires GitLab's TLS certificate found on the [`tls_certificates`](https://gitlab.com/gitlab-org/gitlab-qa/-/blob/master/tls_certificates/gitlab/gitlab.test.crt) folder
|
|
913
|
+
```
|
|
914
|
+
$ export GITLAB_TLS_CERTIFICATE=$(cat /path/to/certificate.crt)
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
To run a scenario with an insecure registry enabled use `Test::Integration::Registry EE` instead (it does not require the above certificate).
|
|
918
|
+
|
|
919
|
+
### Test::Integration::RegistryTLS EE --omnibus-config object_storage
|
|
920
|
+
|
|
921
|
+
This scenario is a composition of two orchestrated scenarios. It tests the container registry (TLS-enabled) integrated with an object storage backend.
|
|
922
|
+
|
|
923
|
+
An example would be to pass the option `--omnibus-config object_storage_aws` and the registry will be pulling and pushing images using AWS Cloud Storage as a storage backend.
|
|
881
924
|
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
* `AWS_S3_BUCKET_NAME` - The name of the bucket where objects are stored. After a bucket is created, the name of that bucket cannot be used by another AWS account in any AWS Region until the bucket is deleted.
|
|
925
|
+
```
|
|
926
|
+
GITLAB_TLS_CERTIFICATE=$(cat /path/to/certificate.crt) gitlab-qa Test::Integration::RegistryTLS EE --omnibus-config object_storage_aws
|
|
927
|
+
```
|
|
886
928
|
|
|
887
929
|
### `Test::Instance::Geo EE|<full image address>:nightly|latest|any_tag http://geo-primary.gitlab http://geo-secondary.gitlab`
|
|
888
930
|
|
|
@@ -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 = []
|
|
161
|
+
container_name_exclude = ["#{name}"]
|
|
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
|
+
All Environments:
|
|
74
|
+
<img src="https://dashboards.quality.gitlab.net/render/d-solo/cW0UMgv7k/spec-health?orgId=1&var-run_type=All&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
|
|
@@ -142,16 +142,12 @@ module Gitlab
|
|
|
142
142
|
end
|
|
143
143
|
|
|
144
144
|
def variables
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
ENV_VARIABLES.each do |name, attribute|
|
|
145
|
+
ENV_VARIABLES.each_with_object({}) do |(name, attribute), vars|
|
|
148
146
|
# Variables that are overridden in the environment take precedence
|
|
149
147
|
# over the defaults specified by the QA runtime.
|
|
150
148
|
value = env_var_name_if_defined(name) || send(attribute) # rubocop:disable GitlabSecurity/PublicSend
|
|
151
149
|
vars[name] = value if value
|
|
152
150
|
end
|
|
153
|
-
|
|
154
|
-
vars
|
|
155
151
|
end
|
|
156
152
|
|
|
157
153
|
def debug?
|
|
@@ -179,15 +175,7 @@ module Gitlab
|
|
|
179
175
|
end
|
|
180
176
|
|
|
181
177
|
def pipeline_from_project_name
|
|
182
|
-
|
|
183
|
-
if env_var_value_if_defined('TOP_UPSTREAM_SOURCE_JOB').to_s.start_with?('https://ops.gitlab.net')
|
|
184
|
-
'staging-orchestrated'
|
|
185
|
-
else
|
|
186
|
-
QA::Runtime::Env.default_branch
|
|
187
|
-
end
|
|
188
|
-
else
|
|
189
|
-
ci_project_name
|
|
190
|
-
end
|
|
178
|
+
ci_project_name.to_s.start_with?('gitlab-qa') ? QA::Runtime::Env.default_branch : ci_project_name
|
|
191
179
|
end
|
|
192
180
|
|
|
193
181
|
def run_id
|
|
@@ -314,6 +302,10 @@ module Gitlab
|
|
|
314
302
|
enabled?(env_var_value_if_defined('TEST_LICENSE_MODE'), default: false)
|
|
315
303
|
end
|
|
316
304
|
|
|
305
|
+
def qa_export_test_metrics?
|
|
306
|
+
enabled?(env_var_value_if_defined('QA_EXPORT_TEST_METRICS'), default: true)
|
|
307
|
+
end
|
|
308
|
+
|
|
317
309
|
private
|
|
318
310
|
|
|
319
311
|
def enabled?(value, default: true)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gitlab
|
|
4
|
+
module QA
|
|
5
|
+
module Scenario
|
|
6
|
+
module Test
|
|
7
|
+
module Integration
|
|
8
|
+
class Integrations < Scenario::Template
|
|
9
|
+
def perform(release, *rspec_args)
|
|
10
|
+
Component::Gitlab.perform do |gitlab|
|
|
11
|
+
gitlab.release = QA::Release.new(release)
|
|
12
|
+
gitlab.network = 'test'
|
|
13
|
+
gitlab.name = 'gitlab-integrations'
|
|
14
|
+
gitlab.instance do
|
|
15
|
+
Component::Specs.perform do |specs|
|
|
16
|
+
rspec_args << '--' unless rspec_args.include?('--')
|
|
17
|
+
rspec_args << %w[--tag integrations]
|
|
18
|
+
specs.suite = 'Test::Instance::All'
|
|
19
|
+
specs.hostname = "qa-e2e-specs.#{gitlab.network}"
|
|
20
|
+
specs.release = gitlab.release
|
|
21
|
+
specs.network = gitlab.network
|
|
22
|
+
specs.args = [gitlab.address, *rspec_args]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
data/lib/gitlab/qa/version.rb
CHANGED
data/lib/gitlab/qa.rb
CHANGED
|
@@ -74,6 +74,7 @@ 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 :Integrations, 'gitlab/qa/scenario/test/integration/integrations'
|
|
77
78
|
end
|
|
78
79
|
|
|
79
80
|
module Sanity
|
|
@@ -99,6 +100,7 @@ module Gitlab
|
|
|
99
100
|
autoload :MailHog, 'gitlab/qa/component/mail_hog'
|
|
100
101
|
autoload :Jira, 'gitlab/qa/component/jira'
|
|
101
102
|
autoload :PostgreSQL, 'gitlab/qa/component/postgresql'
|
|
103
|
+
autoload :Telegraf, 'gitlab/qa/component/telegraf'
|
|
102
104
|
end
|
|
103
105
|
|
|
104
106
|
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.22.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-02-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|
|
@@ -228,7 +228,6 @@ files:
|
|
|
228
228
|
- docs/release_process.md
|
|
229
229
|
- docs/run_qa_against_gdk.md
|
|
230
230
|
- docs/running_against_remote_grid.md
|
|
231
|
-
- docs/running_specific_orchestrated_tests.md
|
|
232
231
|
- docs/trainings.md
|
|
233
232
|
- docs/waits.md
|
|
234
233
|
- docs/what_tests_can_be_run.md
|
|
@@ -256,6 +255,7 @@ files:
|
|
|
256
255
|
- lib/gitlab/qa/component/specs.rb
|
|
257
256
|
- lib/gitlab/qa/component/staging.rb
|
|
258
257
|
- lib/gitlab/qa/component/staging_ref.rb
|
|
258
|
+
- lib/gitlab/qa/component/telegraf.rb
|
|
259
259
|
- lib/gitlab/qa/docker/command.rb
|
|
260
260
|
- lib/gitlab/qa/docker/engine.rb
|
|
261
261
|
- lib/gitlab/qa/docker/shellout.rb
|
|
@@ -315,6 +315,7 @@ files:
|
|
|
315
315
|
- lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb
|
|
316
316
|
- lib/gitlab/qa/scenario/test/integration/group_saml.rb
|
|
317
317
|
- lib/gitlab/qa/scenario/test/integration/instance_saml.rb
|
|
318
|
+
- lib/gitlab/qa/scenario/test/integration/integrations.rb
|
|
318
319
|
- lib/gitlab/qa/scenario/test/integration/jira.rb
|
|
319
320
|
- lib/gitlab/qa/scenario/test/integration/kubernetes.rb
|
|
320
321
|
- lib/gitlab/qa/scenario/test/integration/ldap.rb
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Running specific orchestrated tests
|
|
2
|
-
|
|
3
|
-
## Maven artifact spec
|
|
4
|
-
|
|
5
|
-
The [maven repository spec](https://gitlab.com/gitlab-org/gitlab/-/blob/master/qa/qa/specs/features/ee/browser_ui/5_package/maven_repository_spec.rb) creates a Maven artifact and links it to a GitLab project. The artifact is created within a [Maven docker image](https://gitlab.com/gitlab-org/gitlab/-/blob/master/qa/qa/service/docker_run/maven.rb#L8).
|
|
6
|
-
|
|
7
|
-
Using `gitlab-qa` to run these tests reduces the likelihood of network errors between the maven container and GitLab instance.
|
|
8
|
-
|
|
9
|
-
To run this with `gitlab-qa` you can use the `Test::Instance::Image` that is needed for your test. For example:
|
|
10
|
-
|
|
11
|
-
`gitlab-qa Test::Instance::Image registry.gitlab.com/gitlab-org/build/omnibus-gitlab-mirror/gitlab-ee:2cb9a85d2beadd51b926eaddb05005403bee0013 -- --tag orchestrated qa/specs/features/ee/browser_ui/5_package/maven_repository_spec.rb` - runs the test against a specific Omnibus GitLab image that was built through `package-and-qa`.
|