gitlab-qa 6.21.1 → 6.21.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f8a36d980bf03f5cc9921cf6f53417c3af1af1d9302d715c94ea018dcd38a0a
4
- data.tar.gz: 07e3a718fde1037351f7e29cf6fabb9d35f757c50117f308881fb9474ede00eb
3
+ metadata.gz: c989cb7d8d8a3c9eb94835b3a7c274a4632827f3a32998b8f09a4c450a171917
4
+ data.tar.gz: 130448315ffff85c9be03face027934d3fbd35f1f2d7039c8188622bed464acc
5
5
  SHA512:
6
- metadata.gz: 77847c2c836aedb6f8e84c7424d8b124b7387d3c23bc658cf87b1a588217d33b6f81bdee77cb3302cfc937f2768a426f4a39315a57f66330c5e221e8f225243e
7
- data.tar.gz: 797673f38b45c0b209cd49388fddb04cad19d7fce1af3105ed173e72469ab39de04a98962de905de93653426cd67e1a65c858ada146366291ceb394b8e8be1ff
6
+ metadata.gz: 4d1471f8093cb11cb9a47ce450b46ea2bf358365a89e3bb4ec0831f10f489a4034b36eea079c6e8ea05876834e039c8ce429298340e2934974932eb5ee483b97
7
+ data.tar.gz: 06b4bd542227007156a4bd7f16dc5f263ae0054ad985348b256faa9e4412943995351a5ffb4dda78c0b650a9e30579b1b7efbc0cbcc5a36c1fe645daa7d0a091
@@ -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.21.1'.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.21.1
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-02-04 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