gitlab-qa 6.20.0 → 6.21.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/what_tests_can_be_run.md +15 -0
- data/lib/gitlab/qa/component/gitlab.rb +6 -1
- data/lib/gitlab/qa/report/generate_test_session.rb +10 -8
- data/lib/gitlab/qa/scenario/test/integration/ssh_tunnel.rb +1 -2
- data/lib/gitlab/qa/scenario/test/sanity/version.rb +26 -15
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +2 -3
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b108747b63e44e62bb63b71823e9612f8e32d652713bea427495a2139b61033
|
4
|
+
data.tar.gz: 75b2b9a6ea4ead609c242046b621d4360d192bb9bd8b4da50df8e90a62b38adf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83abd37be38747a36a6c96b23af631df6b878ccc70ac1d2a496acd04dfdef8eb99fd8afc148935269b86b6ba937037b58003f0f53fd979404df76343f15f3d1d
|
7
|
+
data.tar.gz: 996f450bafb008395fbbb6f46afc9d12f6a7ac07d4451a039c57959e983c6eb6b77230144be052e16064990105611af713e2e166f69aa2392eccb3b048e32ed7
|
@@ -167,6 +167,21 @@ And the following would run all Create API tests as well as UI tests:
|
|
167
167
|
$ gitlab-qa Test::Instance::Image EE -- qa/specs/features/browser_ui/3_create qa/specs/features/api/3_create
|
168
168
|
```
|
169
169
|
|
170
|
+
### Running tests for transient bugs
|
171
|
+
|
172
|
+
A suite of tests have been written to test for [transient bugs](https://about.gitlab.com/handbook/engineering/quality/issue-triage/#transient-bugs).
|
173
|
+
Those tests are tagged `:transient` and therefore can be run via:
|
174
|
+
|
175
|
+
```shell
|
176
|
+
$ gitlab-qa Test::Instance::Image EE -- --tag transient
|
177
|
+
```
|
178
|
+
|
179
|
+
If you would like to run the transient bug tests against a specific GitLab instance such as your GDK, you can use the following command:
|
180
|
+
|
181
|
+
```shell
|
182
|
+
$ gitlab-qa Test::Instance::Any EE https://your.instance.gitlab -- --tag transient
|
183
|
+
```
|
184
|
+
|
170
185
|
## Examples
|
171
186
|
|
172
187
|
### `Test::Instance::Image CE|EE|<full image address>`
|
@@ -101,12 +101,17 @@ module Gitlab
|
|
101
101
|
def prepare_gitlab_omnibus_config
|
102
102
|
setup_disable_animations if disable_animations
|
103
103
|
set_formless_login_token
|
104
|
+
setup_application_settings_cache_expiry
|
104
105
|
end
|
105
106
|
|
106
107
|
def setup_disable_animations
|
107
108
|
@environment['GITLAB_OMNIBUS_CONFIG'] = "gitlab_rails['gitlab_disable_animations'] = true; #{@environment['GITLAB_OMNIBUS_CONFIG'] || ''}"
|
108
109
|
end
|
109
110
|
|
111
|
+
def setup_application_settings_cache_expiry
|
112
|
+
@environment['GITLAB_OMNIBUS_CONFIG'] = "gitlab_rails['application_settings_cache_seconds'] = 0; #{@environment['GITLAB_OMNIBUS_CONFIG'] || ''}"
|
113
|
+
end
|
114
|
+
|
110
115
|
def start # rubocop:disable Metrics/AbcSize
|
111
116
|
ensure_configured!
|
112
117
|
|
@@ -138,7 +143,7 @@ module Gitlab
|
|
138
143
|
puts line
|
139
144
|
# TODO, workaround which allows to detach from the container
|
140
145
|
#
|
141
|
-
|
146
|
+
break if line =~ /gitlab Reconfigured!/
|
142
147
|
end
|
143
148
|
end
|
144
149
|
|
@@ -23,9 +23,11 @@ module Gitlab
|
|
23
23
|
)
|
24
24
|
|
25
25
|
# Workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/295493
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
unless Runtime::Env.qa_issue_url.to_s.empty?
|
27
|
+
gitlab.create_issue_note(
|
28
|
+
iid: issue.iid,
|
29
|
+
note: "/relate #{Runtime::Env.qa_issue_url}")
|
30
|
+
end
|
29
31
|
|
30
32
|
File.write('REPORT_ISSUE_URL', issue.web_url)
|
31
33
|
end
|
@@ -151,7 +153,7 @@ module Gitlab
|
|
151
153
|
<<~MARKDOWN.chomp
|
152
154
|
<details><summary>Passed tests:</summary>
|
153
155
|
|
154
|
-
#{generate_testcase_listing(passed_tests)}
|
156
|
+
#{generate_testcase_listing(passed_tests, passed: true)}
|
155
157
|
|
156
158
|
</details>
|
157
159
|
MARKDOWN
|
@@ -167,11 +169,11 @@ module Gitlab
|
|
167
169
|
MARKDOWN
|
168
170
|
end
|
169
171
|
|
170
|
-
def generate_testcase_listing(tests)
|
172
|
+
def generate_testcase_listing(tests, passed: false)
|
171
173
|
body = tests.group_by(&:testcase).map do |testcase, tests_with_same_testcase|
|
172
174
|
tests_with_same_testcase.sort_by!(&:name)
|
173
175
|
[
|
174
|
-
generate_test_text(testcase, tests_with_same_testcase),
|
176
|
+
generate_test_text(testcase, tests_with_same_testcase, passed),
|
175
177
|
generate_test_job(tests_with_same_testcase),
|
176
178
|
generate_test_status(tests_with_same_testcase),
|
177
179
|
generate_test_actions(tests_with_same_testcase)
|
@@ -185,10 +187,10 @@ module Gitlab
|
|
185
187
|
MARKDOWN
|
186
188
|
end
|
187
189
|
|
188
|
-
def generate_test_text(testcase, tests_with_same_testcase)
|
190
|
+
def generate_test_text(testcase, tests_with_same_testcase, passed)
|
189
191
|
text = tests_with_same_testcase.map(&:name).uniq.join(', ')
|
190
192
|
|
191
|
-
if testcase
|
193
|
+
if testcase && !passed
|
192
194
|
"[#{text}](#{testcase})"
|
193
195
|
else
|
194
196
|
text
|
@@ -26,8 +26,7 @@ module Gitlab
|
|
26
26
|
external_url '#{tunnel_gitlab.url}';
|
27
27
|
nginx['listen_port'] = 80;
|
28
28
|
nginx['listen_https'] = false;
|
29
|
-
|
30
|
-
gitlab_rails['initial_root_password'] = '#{Runtime::Env.require_initial_password!}'
|
29
|
+
gitlab_rails['initial_root_password'] = '#{Runtime::Env.require_initial_password!}';
|
31
30
|
|
32
31
|
registry_external_url '#{tunnel_registry.url}';
|
33
32
|
registry_nginx['listen_port'] = 80;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'net/http'
|
3
3
|
require 'cgi'
|
4
|
+
require 'time'
|
4
5
|
|
5
6
|
module Gitlab
|
6
7
|
module QA
|
@@ -8,14 +9,10 @@ module Gitlab
|
|
8
9
|
module Test
|
9
10
|
module Sanity
|
10
11
|
# This test checks that the sha_version of a GitLab was authored in
|
11
|
-
# the window defined by `
|
12
|
-
#
|
13
|
-
# the commits in the time window will fit.
|
12
|
+
# the window defined by the `weekday_hours` method.
|
13
|
+
# We perform a single API call to get the commit
|
14
14
|
class Version < Scenario::Template
|
15
|
-
|
16
|
-
COMMITS = 10_000
|
17
|
-
|
18
|
-
def perform(release)
|
15
|
+
def perform(release = 'ce')
|
19
16
|
version = Component::Gitlab.perform do |gitlab|
|
20
17
|
gitlab.release = release
|
21
18
|
gitlab.act do
|
@@ -25,9 +22,9 @@ module Gitlab
|
|
25
22
|
end
|
26
23
|
|
27
24
|
project = "gitlab-org/#{QA::Release.new(release).api_project_name}"
|
28
|
-
commit =
|
25
|
+
commit = api_commit_detail(project, version)
|
29
26
|
|
30
|
-
if commit
|
27
|
+
if commit_within_hours?(commit['created_at'], weekday_hours(commit['created_at']))
|
31
28
|
puts "Found commit #{version} in recent history of #{project}"
|
32
29
|
else
|
33
30
|
puts "Did not find #{version} in recent history of #{project}"
|
@@ -37,14 +34,28 @@ module Gitlab
|
|
37
34
|
|
38
35
|
private
|
39
36
|
|
40
|
-
def
|
37
|
+
def weekday_hours(date_string)
|
38
|
+
case Date.parse(date_string).wday
|
39
|
+
# Sunday
|
40
|
+
when 0
|
41
|
+
48
|
42
|
+
# Monday
|
43
|
+
when 1
|
44
|
+
72
|
45
|
+
else
|
46
|
+
24
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def commit_within_hours?(commit_time_string, hours)
|
51
|
+
Time.at(Time.parse(commit_time_string).utc).to_datetime > Time.at((Time.now - hours * 60 * 60).utc).to_datetime
|
52
|
+
end
|
53
|
+
|
54
|
+
def api_commit_detail(project, commit_id)
|
41
55
|
api = 'https://gitlab.com/api/v4'
|
42
|
-
url = "#{api}/projects/#{CGI.escape(project)}/repository/commits"
|
43
|
-
since = (Time.now - HOURS_AGO * 60 * 60).strftime('%FT%T')
|
56
|
+
url = "#{api}/projects/#{CGI.escape(project)}/repository/commits/#{commit_id}"
|
44
57
|
|
45
|
-
|
46
|
-
uri.query = URI.encode_www_form(since: since, per_page: COMMITS)
|
47
|
-
JSON.parse(Net::HTTP.get(uri))
|
58
|
+
JSON.parse(Net::HTTP.get(URI(url)))
|
48
59
|
end
|
49
60
|
end
|
50
61
|
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.21.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: 2021-
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -208,7 +208,6 @@ files:
|
|
208
208
|
- ".rspec"
|
209
209
|
- ".rubocop.yml"
|
210
210
|
- ".rubocop_todo.yml"
|
211
|
-
- ".travis.yml"
|
212
211
|
- CONTRIBUTING.md
|
213
212
|
- Gemfile
|
214
213
|
- LICENSE
|