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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5417b9ef6d77d1792479873ba808d93da9fce65bed5ebc13203a1eaf8ac4e6d4
4
- data.tar.gz: 024dcea062a32731702635adfac6abf282c42b4487fff269c0a469556230222a
3
+ metadata.gz: 5b108747b63e44e62bb63b71823e9612f8e32d652713bea427495a2139b61033
4
+ data.tar.gz: 75b2b9a6ea4ead609c242046b621d4360d192bb9bd8b4da50df8e90a62b38adf
5
5
  SHA512:
6
- metadata.gz: 942c05b8dbdf34fd1e34509460b701e4454abf85c70ac677a78975ae27788f0f0a95afa2e43695e87c2dd818099c3ae28962ea64d890b7dc87ecf06ce78a5cba
7
- data.tar.gz: d2f5083521dd998c7b482985dd3f5b4f1b15c79d6b80eae21c102861d11254bd6a95082b57cab825a8409a4eebe5caf562220e2d283e9b1c9936100d7b083775
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
- Process.kill('INT', wait.pid) if line =~ /gitlab Reconfigured!/
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
- gitlab.create_issue_note(
27
- iid: issue.iid,
28
- note: "/relate #{Runtime::Env.qa_issue_url}")
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
- # documentation: https://docs.gitlab.com/omnibus/settings/database.html#seed-the-database-fresh-installs-only
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 `HOURS_AGO`. We perform a single API call,
12
- # so `COMMITS` needs to be a large enough value that we expect all
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
- HOURS_AGO = 24
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 = recent_commits(project).find { |c| c['id'] == version }
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 recent_commits(project)
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
- uri = URI(url)
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
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '6.20.0'.freeze
3
+ VERSION = '6.21.3'.freeze
4
4
  end
5
5
  end
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.20.0
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-01-20 00:00:00.000000000 Z
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
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.12.5