gitlab-qa 6.19.0 → 6.21.2

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: 981a6afe2aef7aa49d6ea19d627947fa58f24ad84d4443268c582d16ff60a15c
4
- data.tar.gz: 2ff55255b8cb84ff2fe4368846da3f1818a069c389afc22e937d49eb2034bc35
3
+ metadata.gz: c989cb7d8d8a3c9eb94835b3a7c274a4632827f3a32998b8f09a4c450a171917
4
+ data.tar.gz: 130448315ffff85c9be03face027934d3fbd35f1f2d7039c8188622bed464acc
5
5
  SHA512:
6
- metadata.gz: 115a7e9805ff2723ffe4d0f41b92315778fc5846481542eafff3f321e0ef23750ef8abeaf620dfcfd8effab56a159b3ac0bf1bed9e07771dc4ea4a3b48f29c2f
7
- data.tar.gz: 985e57c53830587cf92d4a9087cd9537382a4247c479b4aec23227d2f703bdf02e58013c60c6d2096e92942af000d5d12855d54a43553ff76c3fb780e4c48dc5
6
+ metadata.gz: 4d1471f8093cb11cb9a47ce450b46ea2bf358365a89e3bb4ec0831f10f489a4034b36eea079c6e8ea05876834e039c8ce429298340e2934974932eb5ee483b97
7
+ data.tar.gz: 06b4bd542227007156a4bd7f16dc5f263ae0054ad985348b256faa9e4412943995351a5ffb4dda78c0b650a9e30579b1b7efbc0cbcc5a36c1fe645daa7d0a091
data/.gitlab-ci.yml CHANGED
@@ -1023,7 +1023,7 @@ relate_test_failures:
1023
1023
  when: always
1024
1024
  variables:
1025
1025
  QA_FAILURES_REPORTING_PROJECT: "gitlab-org/gitlab"
1026
- QA_FAILURES_MAX_DIFF_RATIO: "0.05"
1026
+ QA_FAILURES_MAX_DIFF_RATIO: "0.15"
1027
1027
  # The --dry-run can be set to modify the behavior of `exe/gitlab-qa-report --relate-failure-issue` without releasing a new gem version.
1028
1028
  QA_FAILURES_REPORTER_OPTIONS: ""
1029
1029
  script:
@@ -84,6 +84,8 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
84
84
  | `CACHE_NAMESPACE_NAME` | `true` | Cache namespace name for groups. | No|
85
85
  | `DEPLOY_VERSION` |- | The version of GitLab being tested against. | No|
86
86
  | `GITLAB_QA_USER_AGENT` |- | The browser user-agent to use instead of the default Chrome user-agent. | No|
87
+ | `GEO_FAILOVER` | `false` | Set to `true` when a Geo secondary site has been promoted to a Geo primary site. | No|
88
+
87
89
 
88
90
  ## [Supported Remote Grid environment variables](./running_against_remote_grid.md)
89
91
 
@@ -165,6 +167,21 @@ And the following would run all Create API tests as well as UI tests:
165
167
  $ gitlab-qa Test::Instance::Image EE -- qa/specs/features/browser_ui/3_create qa/specs/features/api/3_create
166
168
  ```
167
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
+
168
185
  ## Examples
169
186
 
170
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
@@ -87,7 +87,8 @@ module Gitlab
87
87
  'JIRA_ADMIN_PASSWORD' => :jira_admin_password,
88
88
  'CACHE_NAMESPACE_NAME' => :cache_namespace_name,
89
89
  'DEPLOY_VERSION' => :deploy_version,
90
- 'GITLAB_QA_USER_AGENT' => :gitlab_qa_user_agent
90
+ 'GITLAB_QA_USER_AGENT' => :gitlab_qa_user_agent,
91
+ 'GEO_FAILOVER' => :geo_failover
91
92
  }.freeze
92
93
 
93
94
  ENV_VARIABLES.each do |env_name, method_name|
@@ -283,6 +284,10 @@ module Gitlab
283
284
  enabled?(ENV['QA_SKIP_PULL'], default: false)
284
285
  end
285
286
 
287
+ def geo_failover?
288
+ enabled?(ENV['GEO_FAILOVER'], default: false)
289
+ end
290
+
286
291
  private
287
292
 
288
293
  def enabled?(value, default: true)
@@ -4,12 +4,20 @@ module Gitlab
4
4
  module Test
5
5
  module Instance
6
6
  ##
7
- # Run test suite against staging.gitlab.com
7
+ # Run test suite against staging.gitlab.com (or geo.staging.gitlab.com during failover)
8
8
  #
9
9
  class Staging < DeploymentBase
10
10
  def deployment_component
11
11
  Component::Staging
12
12
  end
13
+
14
+ def non_rspec_args
15
+ if Runtime::Env.geo_failover?
16
+ [deployment_component::GEO_SECONDARY_ADDRESS]
17
+ else
18
+ [deployment_component::ADDRESS]
19
+ end
20
+ end
13
21
  end
14
22
  end
15
23
  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.19.0'.freeze
3
+ VERSION = '6.21.2'.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.19.0
4
+ version: 6.21.2
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-14 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