gitlab-qa 6.20.1 → 6.21.4

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: c136a0788938d35b97aa2ead0aeb2c1cf49a3d4b88234b84bdc63fca74077f9c
4
- data.tar.gz: 3af3761d7ec9c0b454f213a3adaba033d72f9eefa96551a7027d858a6a022c50
3
+ metadata.gz: b9760fa09e36771aae86f79908388d235ce9ec597e551d7458f8f2f9840f2456
4
+ data.tar.gz: e1c8574a9f3471e21017d32e9d92a0ff79ff057c71d0c9878fe04000ef5c781a
5
5
  SHA512:
6
- metadata.gz: 73fefa1d944152d2792b353ee133846d077ffdae97f706fe20011d6327e82a9a627b301933b814eb214f5206566855c5a212af2bb7b56cee8a845fd3943e29c4
7
- data.tar.gz: a4375e5f172c5c578f5fd389d1f3012247688c76b33465e44459581e2b126805a3d85bc851c70755bb4c850e26b3df186d97868a2d7ad37987e822608a412f99
6
+ metadata.gz: 361ad4bf805c10df590d8b7fb2bfce2a3d0af472c9d3dc92b648f44d44e779558171df44101ec952e6127848aa566f1d6ef4f50ce56e77a6d6cfdd0795f97313
7
+ data.tar.gz: b5ddd7de265e676f4078a10978d8931fb555a45fe9c559af9926debf620a9848ac6f503ee54689c7df04b4fa6d499765359a05c1909ef66445fe8794f39d3d66
@@ -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,14 +143,14 @@ 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
 
145
150
  def wait_until_ready
146
151
  return if skip_availability_check
147
152
 
148
- if Availability.new(name, relative_path: relative_path, scheme: scheme, protocol_port: port.to_i).check(300)
153
+ if Availability.new(name, relative_path: relative_path, scheme: scheme, protocol_port: port.to_i).check(Runtime::Env.gitlab_availability_timeout)
149
154
  sleep 12 # TODO, handle that better
150
155
  puts ' -> GitLab is available.'
151
156
  else
@@ -153,7 +153,7 @@ module Gitlab
153
153
  <<~MARKDOWN.chomp
154
154
  <details><summary>Passed tests:</summary>
155
155
 
156
- #{generate_testcase_listing(passed_tests)}
156
+ #{generate_testcase_listing(passed_tests, passed: true)}
157
157
 
158
158
  </details>
159
159
  MARKDOWN
@@ -169,11 +169,11 @@ module Gitlab
169
169
  MARKDOWN
170
170
  end
171
171
 
172
- def generate_testcase_listing(tests)
172
+ def generate_testcase_listing(tests, passed: false)
173
173
  body = tests.group_by(&:testcase).map do |testcase, tests_with_same_testcase|
174
174
  tests_with_same_testcase.sort_by!(&:name)
175
175
  [
176
- generate_test_text(testcase, tests_with_same_testcase),
176
+ generate_test_text(testcase, tests_with_same_testcase, passed),
177
177
  generate_test_job(tests_with_same_testcase),
178
178
  generate_test_status(tests_with_same_testcase),
179
179
  generate_test_actions(tests_with_same_testcase)
@@ -187,10 +187,10 @@ module Gitlab
187
187
  MARKDOWN
188
188
  end
189
189
 
190
- def generate_test_text(testcase, tests_with_same_testcase)
190
+ def generate_test_text(testcase, tests_with_same_testcase, passed)
191
191
  text = tests_with_same_testcase.map(&:name).uniq.join(', ')
192
192
 
193
- if testcase
193
+ if testcase && !passed
194
194
  "[#{text}](#{testcase})"
195
195
  else
196
196
  text
@@ -106,6 +106,10 @@ module Gitlab
106
106
  ENV['QA_DEFAULT_BRANCH'] || 'master'
107
107
  end
108
108
 
109
+ def gitlab_availability_timeout
110
+ ENV.fetch('GITLAB_QA_AVAILABILITY_TIMEOUT', 360).to_i
111
+ end
112
+
109
113
  def gitlab_username
110
114
  ENV['GITLAB_USERNAME'] || 'gitlab-qa'
111
115
  end
@@ -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.1'.freeze
3
+ VERSION = '6.21.4'.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.1
4
+ version: 6.21.4
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-21 00:00:00.000000000 Z
11
+ date: 2021-02-16 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