gitlab-qa 6.13.0 → 6.15.3
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 +22 -26
- data/.gitlab/merge_request_templates/Release.md +1 -1
- data/docs/release_process.md +7 -6
- data/lib/gitlab/qa/report/generate_test_session.rb +34 -17
- data/lib/gitlab/qa/report/prepare_stage_reports.rb +4 -1
- data/lib/gitlab/qa/report/relate_failure_issue.rb +1 -1
- data/lib/gitlab/qa/report/report_as_issue.rb +5 -7
- data/lib/gitlab/qa/runtime/env.rb +8 -0
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c3d066c13bb7ff790bdfc0e7ed6f6cbe70f65c9ecfe2400c3c804c8fc91e6db1
|
|
4
|
+
data.tar.gz: 85e35e3017cac986d7ccec3927e1f3543164443e2806803e4020830dfe0eebb1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c4e9dffbbaff6dd23ee878b3601e6d3cfa13cb2928f5f360abeba0b75ec1841d45050fbd220c41960690c620da742c48862110857667c3c99566ed62aa80249
|
|
7
|
+
data.tar.gz: 8658c0b57a0693c335e515b07770b5bff1938fc307be9ad971724713a90b101cd9c1ec7b7c7b5527c9b5cc2c9d594a88ba88fcf6f5b4502801a243e7f754142c
|
data/.gitlab-ci.yml
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
stages:
|
|
2
2
|
- check
|
|
3
|
-
- release
|
|
4
3
|
- test
|
|
5
4
|
- report
|
|
5
|
+
- deploy
|
|
6
6
|
- notify
|
|
7
7
|
|
|
8
8
|
default:
|
|
@@ -35,13 +35,6 @@ workflow:
|
|
|
35
35
|
# For triggers from GitLab MR pipelines (and pipelines from other projects), create a pipeline
|
|
36
36
|
- if: '$CI_PIPELINE_SOURCE == "pipeline"'
|
|
37
37
|
|
|
38
|
-
.default-rules:
|
|
39
|
-
rules:
|
|
40
|
-
- if: '$CI_COMMIT_TAG || $RELEASE'
|
|
41
|
-
when: never
|
|
42
|
-
- if: '$RELEASE == null && $CI_JOB_NAME =~ /staging/'
|
|
43
|
-
when: manual
|
|
44
|
-
|
|
45
38
|
variables:
|
|
46
39
|
DOCKER_DRIVER: overlay2
|
|
47
40
|
DOCKER_HOST: tcp://docker:2375
|
|
@@ -65,21 +58,6 @@ rubocop:
|
|
|
65
58
|
rspec:
|
|
66
59
|
extends: .check-base
|
|
67
60
|
|
|
68
|
-
release:
|
|
69
|
-
stage: release
|
|
70
|
-
rules:
|
|
71
|
-
- if: '$CI_COMMIT_TAG'
|
|
72
|
-
script:
|
|
73
|
-
- gem update --system
|
|
74
|
-
- ruby --version
|
|
75
|
-
- gem env version
|
|
76
|
-
- gem build gitlab-qa.gemspec
|
|
77
|
-
- gem push gitlab-qa*.gem
|
|
78
|
-
artifacts:
|
|
79
|
-
paths:
|
|
80
|
-
- gitlab-qa*.gem
|
|
81
|
-
expire_in: 30 days
|
|
82
|
-
|
|
83
61
|
.test:
|
|
84
62
|
stage: test
|
|
85
63
|
services:
|
|
@@ -107,6 +85,10 @@ release:
|
|
|
107
85
|
variables:
|
|
108
86
|
DEFAULT_RELEASE: "CE"
|
|
109
87
|
rules:
|
|
88
|
+
# Don't run E2E jobs on release pipelines
|
|
89
|
+
- if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab-qa" && $RELEASE == null'
|
|
90
|
+
changes: ["lib/**/version.rb"]
|
|
91
|
+
when: never
|
|
110
92
|
- if: '$CI_COMMIT_TAG || $RELEASE =~ /gitlab-ee/'
|
|
111
93
|
when: never
|
|
112
94
|
- if: '$RELEASE == null && $CI_JOB_NAME =~ /quarantine|custom/'
|
|
@@ -121,6 +103,10 @@ release:
|
|
|
121
103
|
variables:
|
|
122
104
|
DEFAULT_RELEASE: "EE"
|
|
123
105
|
rules:
|
|
106
|
+
# Don't run E2E jobs on release pipelines
|
|
107
|
+
- if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab-qa" && $RELEASE == null'
|
|
108
|
+
changes: ["lib/**/version.rb"]
|
|
109
|
+
when: never
|
|
124
110
|
- if: '$CI_COMMIT_TAG || $RELEASE =~ /gitlab-ce/'
|
|
125
111
|
when: never
|
|
126
112
|
- if: '$RELEASE == null && $CI_JOB_NAME =~ /quarantine|custom/'
|
|
@@ -132,7 +118,15 @@ release:
|
|
|
132
118
|
- if: '$RELEASE == null || $RELEASE =~ /gitlab-ee/ || $CI_MERGE_REQUEST_ID || $CI_COMMIT_REF_NAME == "master"'
|
|
133
119
|
|
|
134
120
|
.only-qa:
|
|
135
|
-
|
|
121
|
+
rules:
|
|
122
|
+
# Don't run E2E jobs on release pipelines
|
|
123
|
+
- if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab-qa" && $RELEASE == null'
|
|
124
|
+
changes: ["lib/**/version.rb"]
|
|
125
|
+
when: never
|
|
126
|
+
- if: '$CI_COMMIT_TAG || $RELEASE'
|
|
127
|
+
when: never
|
|
128
|
+
- if: '$RELEASE == null && $CI_JOB_NAME =~ /staging/'
|
|
129
|
+
when: manual
|
|
136
130
|
|
|
137
131
|
.high-capacity:
|
|
138
132
|
tags:
|
|
@@ -474,7 +468,6 @@ ee:mattermost-quarantine:
|
|
|
474
468
|
ee:geo:
|
|
475
469
|
extends:
|
|
476
470
|
- .test
|
|
477
|
-
- .high-capacity
|
|
478
471
|
- .ee-qa
|
|
479
472
|
- .rspec-report-opts
|
|
480
473
|
variables:
|
|
@@ -483,7 +476,6 @@ ee:geo:
|
|
|
483
476
|
ee:geo-quarantine:
|
|
484
477
|
extends:
|
|
485
478
|
- .test
|
|
486
|
-
- .high-capacity
|
|
487
479
|
- .ee-qa
|
|
488
480
|
- .quarantine
|
|
489
481
|
- .rspec-report-opts
|
|
@@ -1012,3 +1004,7 @@ notify_slack:
|
|
|
1012
1004
|
- echo "CI_PIPELINE_URL is $CI_PIPELINE_URL"
|
|
1013
1005
|
- echo "TOP_UPSTREAM_SOURCE_JOB is $TOP_UPSTREAM_SOURCE_JOB"
|
|
1014
1006
|
- 'bin/slack $NOTIFY_CHANNEL "☠️ QA against $RELEASE failed! ☠️ See the test session report: $(cat REPORT_ISSUE_URL), and pipeline: $CI_PIPELINE_URL (triggered from $TOP_UPSTREAM_SOURCE_JOB)" ci_failing'
|
|
1007
|
+
|
|
1008
|
+
include:
|
|
1009
|
+
- project: 'gitlab-org/quality/pipeline-common'
|
|
1010
|
+
file: '/ci/gem-release.yml'
|
|
@@ -30,6 +30,6 @@ with the latest commit from https://gitlab.com/gitlab-org/gitlab-qa/commits/mast
|
|
|
30
30
|
- [ ] Release notes are accurate.
|
|
31
31
|
|
|
32
32
|
- Checklist after merging:
|
|
33
|
-
- [ ] [
|
|
33
|
+
- [ ] [Update the release notes for the newly created tag](docs/release_process.md#how-to).
|
|
34
34
|
|
|
35
35
|
/label ~Quality ~"feature::maintenance"
|
data/docs/release_process.md
CHANGED
|
@@ -24,12 +24,13 @@ when we make a change - no matter the size of the change.
|
|
|
24
24
|
- If not, update [`lib/gitlab/qa/version.rb`] to an appropriate [semantic version](https://semver.org) in a new merge request using the [release template](https://gitlab.com/gitlab-org/gitlab-qa/blob/master/.gitlab/merge_request_templates/Release.md)
|
|
25
25
|
and title the MR like `"Bump version to <version>"`.
|
|
26
26
|
- Merge the merge request.
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
* **Message**: Set it to "Version x.y.z", e.g. if the version is `4.7.1`, the message would be "Version 4.7.1".
|
|
27
|
+
- The new version should automatically be tagged and pushed to Rubygems by the `gem-release` job in the merge commit pipeline.
|
|
28
|
+
- Update the release notes for the newly created tag (https://gitlab.com/gitlab-org/gitlab-qa/-/tags):
|
|
30
29
|
* **Release notes**: Copy the release notes from the merge request.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
|
|
31
|
+
Note: The `gem-release` job uses:
|
|
32
|
+
|
|
33
|
+
- the `GITLAB_API_TOKEN` environment variable to authenticate against GitLab.com's API in order to create the tag
|
|
34
|
+
- the `GEM_HOST_API_KEY` environment variable to authenticate against Rubygems.org's API in order to release the gem
|
|
34
35
|
|
|
35
36
|
[`lib/gitlab/qa/version.rb`]: https://gitlab.com/gitlab-org/gitlab-qa/blob/master/lib/gitlab/qa/version.rb#L3
|
|
@@ -17,9 +17,9 @@ module Gitlab
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
issue = gitlab.create_issue(
|
|
20
|
-
title: "Test session report | #{
|
|
20
|
+
title: "Test session report | #{pipeline}",
|
|
21
21
|
description: generate_description(tests),
|
|
22
|
-
labels: ['Quality', 'QA', 'triage report',
|
|
22
|
+
labels: ['Quality', 'QA', 'triage report', pipeline_name_label]
|
|
23
23
|
)
|
|
24
24
|
|
|
25
25
|
File.write('REPORT_ISSUE_URL', issue.web_url)
|
|
@@ -27,20 +27,19 @@ module Gitlab
|
|
|
27
27
|
# rubocop:enable Metrics/AbcSize
|
|
28
28
|
|
|
29
29
|
def generate_description(tests)
|
|
30
|
-
<<~MARKDOWN
|
|
30
|
+
<<~MARKDOWN.rstrip
|
|
31
31
|
## Session summary
|
|
32
32
|
|
|
33
33
|
* Deploy version: #{Runtime::Env.deploy_version}
|
|
34
|
-
*
|
|
34
|
+
* Deploy environment: #{Runtime::Env.deploy_environment}
|
|
35
|
+
* Pipeline: #{Runtime::Env.pipeline_from_project_name} [#{Runtime::Env.ci_pipeline_id}](#{Runtime::Env.ci_pipeline_url})
|
|
35
36
|
#{generate_summary(tests: tests)}
|
|
36
37
|
|
|
37
38
|
#{generate_failed_jobs_listing}
|
|
38
39
|
|
|
39
40
|
#{generate_stages_listing(tests)}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* #{Runtime::Env.qa_issue_url}
|
|
42
|
+
#{generate_qa_issue_relation}
|
|
44
43
|
MARKDOWN
|
|
45
44
|
end
|
|
46
45
|
|
|
@@ -60,24 +59,30 @@ module Gitlab
|
|
|
60
59
|
end
|
|
61
60
|
|
|
62
61
|
def generate_failed_jobs_listing
|
|
62
|
+
failed_jobs = []
|
|
63
|
+
|
|
64
|
+
client = Gitlab.client(
|
|
65
|
+
endpoint: Runtime::Env.ci_api_v4_url,
|
|
66
|
+
private_token: Runtime::Env.gitlab_ci_api_token)
|
|
67
|
+
|
|
63
68
|
gitlab.handle_gitlab_client_exceptions do
|
|
64
|
-
failed_jobs =
|
|
69
|
+
failed_jobs = client.pipeline_jobs(
|
|
65
70
|
Runtime::Env.ci_project_id,
|
|
66
71
|
Runtime::Env.ci_pipeline_id,
|
|
67
72
|
scope: 'failed')
|
|
73
|
+
end
|
|
68
74
|
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
listings = failed_jobs.map do |job|
|
|
76
|
+
allowed_to_fail = ' (allowed to fail)' if job.allow_failure
|
|
71
77
|
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
"* [#{job.name}](#{job.web_url})#{allowed_to_fail}"
|
|
79
|
+
end.join("\n")
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
<<~MARKDOWN.chomp if failed_jobs.any?
|
|
82
|
+
## Failed jobs
|
|
77
83
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
end
|
|
84
|
+
#{listings}
|
|
85
|
+
MARKDOWN
|
|
81
86
|
end
|
|
82
87
|
|
|
83
88
|
def generate_stages_listing(tests)
|
|
@@ -222,6 +227,18 @@ module Gitlab
|
|
|
222
227
|
'-'
|
|
223
228
|
end
|
|
224
229
|
end
|
|
230
|
+
|
|
231
|
+
def generate_qa_issue_relation
|
|
232
|
+
return unless Runtime::Env.qa_issue_url
|
|
233
|
+
|
|
234
|
+
<<~MARKDOWN.chomp
|
|
235
|
+
## Release QA issue
|
|
236
|
+
|
|
237
|
+
* #{Runtime::Env.qa_issue_url}
|
|
238
|
+
|
|
239
|
+
/relate #{Runtime::Env.qa_issue_url}
|
|
240
|
+
MARKDOWN
|
|
241
|
+
end
|
|
225
242
|
end
|
|
226
243
|
end
|
|
227
244
|
end
|
|
@@ -34,7 +34,10 @@ module Gitlab
|
|
|
34
34
|
# /qa/specs/features/ee/api/<stage>
|
|
35
35
|
# /qa/specs/features/ee/browser_ui/<stage>
|
|
36
36
|
# For now we assume the Stage is whatever follows api/ or browser_ui/
|
|
37
|
-
|
|
37
|
+
test_path_match = test['file'].match(%r{(api|browser_ui)/([a-z0-9_]+)}i)
|
|
38
|
+
next unless test_path_match
|
|
39
|
+
|
|
40
|
+
stage = strip_number_prefix(test_path_match[2])
|
|
38
41
|
testcases[stage] = [] unless testcases.key?(stage)
|
|
39
42
|
testcases[stage] << test
|
|
40
43
|
end
|
|
@@ -104,20 +104,18 @@ module Gitlab
|
|
|
104
104
|
labels
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
-
def
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
case environment
|
|
107
|
+
def pipeline_name_label
|
|
108
|
+
case pipeline
|
|
111
109
|
when 'production'
|
|
112
110
|
'found:gitlab.com'
|
|
113
111
|
when 'canary', 'staging'
|
|
114
|
-
"found:#{
|
|
112
|
+
"found:#{pipeline}.gitlab.com"
|
|
115
113
|
when 'preprod'
|
|
116
114
|
'found:pre.gitlab.com'
|
|
117
115
|
when 'staging-orchestrated', 'nightly', 'master'
|
|
118
|
-
"found:#{
|
|
116
|
+
"found:#{pipeline}"
|
|
119
117
|
else
|
|
120
|
-
raise "No `found:*` label for the `#{
|
|
118
|
+
raise "No `found:*` label for the `#{pipeline}` pipeline!"
|
|
121
119
|
end
|
|
122
120
|
end
|
|
123
121
|
|
|
@@ -116,6 +116,14 @@ module Gitlab
|
|
|
116
116
|
ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
+
def gitlab_ci_api_token
|
|
120
|
+
ENV['GITLAB_CI_API_TOKEN']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def ci_api_v4_url
|
|
124
|
+
ENV['CI_API_V4_URL']
|
|
125
|
+
end
|
|
126
|
+
|
|
119
127
|
def ci_job_name
|
|
120
128
|
ENV['CI_JOB_NAME']
|
|
121
129
|
end
|
data/lib/gitlab/qa/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-qa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.15.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Grzegorz Bizon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-12-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|