ci-queue 0.46.0 → 0.48.0

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: ea479767ef84b35f96de1e28bd5e4a79027bb90e7a6d06c101056f6486a63e8b
4
- data.tar.gz: c932bac995769751c422790553a063685f4690aa5f7ceffb07ce04174e88bfe2
3
+ metadata.gz: afd20dadd29a542f0876168e23d79e5360f893d780fbe9b4774e5de1a46445da
4
+ data.tar.gz: 00bdb8f74d38573f2fecea1ee6ce15122e04ecc82642b76f8439d189b0474be3
5
5
  SHA512:
6
- metadata.gz: bf13fd4ee60aeff7024e2af393986b19315b0b006a233b00c6468758ada80242344c405b0954bd0ecd3b17f9511048b3fe49049ac342d2b9f3743963348c84f9
7
- data.tar.gz: f0e9933fd3ccff6fb536717cd249cad212d53deaa4c72681fe36ea54247f015c8c9b960870f8b9fd3a1f318e103ae67aeb380c8151c1a3ea121ed7ec49a96b47
6
+ metadata.gz: 79aaeb1f29291026f8fdf36101b7105fc76845b0e8142eb3cf3400e7905235f8cedc2f71be6819a1c7adbe6b08898e14db0e490214f62cee65f03b8d70e9dac4
7
+ data.tar.gz: f140a713fbb4f4ad6c2772143e97409f093a1829e6ac86a429036db3d5bc7f8a291e7d304e7314fcadb86d54ff449dfacf486b8318faf2e1b0074556459475c8
data/.gitignore CHANGED
@@ -4,7 +4,6 @@ test/fixtures/log/test_data.json
4
4
  /.byebug_history
5
5
  /.bundle/
6
6
  /.yardoc
7
- /Gemfile.lock
8
7
  /_yardoc/
9
8
  /coverage/
10
9
  /doc/
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.0
data/Gemfile.lock ADDED
@@ -0,0 +1,111 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ci-queue (0.48.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ activesupport (7.1.3.2)
10
+ base64
11
+ bigdecimal
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ connection_pool (>= 2.2.5)
14
+ drb
15
+ i18n (>= 1.6, < 2)
16
+ minitest (>= 5.1)
17
+ mutex_m
18
+ tzinfo (~> 2.0)
19
+ ansi (1.5.0)
20
+ ast (2.4.2)
21
+ base64 (0.2.0)
22
+ bigdecimal (3.1.7)
23
+ builder (3.2.4)
24
+ concurrent-ruby (1.2.3)
25
+ connection_pool (2.4.1)
26
+ diff-lcs (1.5.1)
27
+ docile (1.4.0)
28
+ drb (2.2.1)
29
+ i18n (1.14.4)
30
+ concurrent-ruby (~> 1.0)
31
+ json (2.7.1)
32
+ language_server-protocol (3.17.0.3)
33
+ minitest (5.22.3)
34
+ minitest-reporters (1.6.1)
35
+ ansi
36
+ builder
37
+ minitest (>= 5.0)
38
+ ruby-progressbar
39
+ msgpack (1.7.2)
40
+ mutex_m (0.2.0)
41
+ parallel (1.24.0)
42
+ parser (3.3.0.5)
43
+ ast (~> 2.4.1)
44
+ racc
45
+ racc (1.7.3)
46
+ rainbow (3.1.1)
47
+ rake (13.1.0)
48
+ redis (5.1.0)
49
+ redis-client (>= 0.17.0)
50
+ redis-client (0.21.1)
51
+ connection_pool
52
+ regexp_parser (2.9.0)
53
+ rexml (3.2.6)
54
+ rspec (3.13.0)
55
+ rspec-core (~> 3.13.0)
56
+ rspec-expectations (~> 3.13.0)
57
+ rspec-mocks (~> 3.13.0)
58
+ rspec-core (3.13.0)
59
+ rspec-support (~> 3.13.0)
60
+ rspec-expectations (3.13.0)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.13.0)
63
+ rspec-mocks (3.13.0)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-support (3.13.1)
67
+ rubocop (1.62.1)
68
+ json (~> 2.3)
69
+ language_server-protocol (>= 3.17.0)
70
+ parallel (~> 1.10)
71
+ parser (>= 3.3.0.2)
72
+ rainbow (>= 2.2.2, < 4.0)
73
+ regexp_parser (>= 1.8, < 3.0)
74
+ rexml (>= 3.2.5, < 4.0)
75
+ rubocop-ast (>= 1.31.1, < 2.0)
76
+ ruby-progressbar (~> 1.7)
77
+ unicode-display_width (>= 2.4.0, < 3.0)
78
+ rubocop-ast (1.31.2)
79
+ parser (>= 3.3.0.4)
80
+ ruby-progressbar (1.13.0)
81
+ simplecov (0.22.0)
82
+ docile (~> 1.1)
83
+ simplecov-html (~> 0.11)
84
+ simplecov_json_formatter (~> 0.1)
85
+ simplecov-html (0.12.3)
86
+ simplecov_json_formatter (0.1.4)
87
+ snappy (0.4.0)
88
+ tzinfo (2.0.6)
89
+ concurrent-ruby (~> 1.0)
90
+ unicode-display_width (2.5.0)
91
+
92
+ PLATFORMS
93
+ arm64-darwin-23
94
+ ruby
95
+
96
+ DEPENDENCIES
97
+ activesupport
98
+ bundler
99
+ ci-queue!
100
+ minitest (~> 5.11)
101
+ minitest-reporters (~> 1.1)
102
+ msgpack
103
+ rake
104
+ redis
105
+ rspec (~> 3.10)
106
+ rubocop
107
+ simplecov (~> 0.12)
108
+ snappy
109
+
110
+ BUNDLED WITH
111
+ 2.5.3
data/ci-queue.gemspec CHANGED
@@ -19,6 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.homepage = 'https://github.com/Shopify/ci-queue'
20
20
  spec.license = 'MIT'
21
21
 
22
+ spec.required_ruby_version = '>= 2.7'
23
+
22
24
  spec.files = lua_scripts + `git ls-files -z`.split("\x0").reject do |f|
23
25
  f.match(%r{^(test|spec|features)/})
24
26
  end
data/dev.yml CHANGED
@@ -3,7 +3,7 @@
3
3
  name: ci-queue
4
4
 
5
5
  up:
6
- - ruby: 3.3.0
6
+ - ruby
7
7
  - bundler
8
8
  - redis
9
9
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module CI
3
4
  module Queue
4
5
  module Redis
@@ -17,11 +18,13 @@ module CI
17
18
  end
18
19
 
19
20
  def wait_for_workers
20
- wait_for_master(timeout: config.queue_init_timeout)
21
+ duration = measure do
22
+ wait_for_master(timeout: config.queue_init_timeout)
23
+ end
21
24
 
22
25
  yield if block_given?
23
26
 
24
- time_left = config.report_timeout
27
+ time_left = config.report_timeout - duration.to_i
25
28
  time_left_with_no_workers = config.inactive_workers_timeout
26
29
  until exhausted? || time_left <= 0 || max_test_failed? || time_left_with_no_workers <= 0
27
30
  time_left -= 1
@@ -44,6 +47,12 @@ module CI
44
47
 
45
48
  private
46
49
 
50
+ def measure
51
+ starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
52
+ yield
53
+ Process.clock_gettime(Process::CLOCK_MONOTONIC) - starting
54
+ end
55
+
47
56
  def active_workers?
48
57
  # if there are running jobs we assume there are still agents active
49
58
  redis.zrangebyscore(key('running'), CI::Queue.time_now.to_f - config.timeout, "+inf", limit: [0,1]).count > 0
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CI
4
4
  module Queue
5
- VERSION = '0.46.0'
5
+ VERSION = '0.48.0'
6
6
  DEV_SCRIPTS_ROOT = ::File.expand_path('../../../../../redis', __FILE__)
7
7
  RELEASE_SCRIPTS_ROOT = ::File.expand_path('../redis', __FILE__)
8
8
  end
@@ -207,6 +207,12 @@ module Minitest
207
207
  puts
208
208
  end
209
209
 
210
+ if run_index == 0
211
+ step(yellow("The failing test was the first test in the test order so there is nothing to bisect."))
212
+ File.write('log/test_order.log', "")
213
+ exit! 1
214
+ end
215
+
210
216
  failing_order = queue.candidates
211
217
  step("Final validation")
212
218
  status = if run_tests_in_fork(failing_order)
@@ -220,7 +226,7 @@ module Minitest
220
226
  command += argv
221
227
 
222
228
  puts
223
- puts "cat <<EOF |\n#{failing_order.to_a.map(&:id).join("\n")}\nEOF\n#{command.join(' ')}"
229
+ puts "cat <<'EOF' |\n#{failing_order.to_a.map(&:id).join("\n")}\nEOF\n#{command.join(' ')}"
224
230
  puts
225
231
 
226
232
  File.write('log/test_order.log', failing_order.to_a.map(&:id).join("\n"))
@@ -157,7 +157,7 @@ module Minitest
157
157
  end
158
158
 
159
159
  def id
160
- @id ||= "#{@runnable}##{@method_name}"
160
+ @id ||= "#{@runnable}##{@method_name}".freeze
161
161
  end
162
162
 
163
163
  def <=>(other)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.46.0
4
+ version: 0.48.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-06 00:00:00.000000000 Z
11
+ date: 2024-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -160,7 +160,9 @@ extensions: []
160
160
  extra_rdoc_files: []
161
161
  files:
162
162
  - ".gitignore"
163
+ - ".ruby-version"
163
164
  - Gemfile
165
+ - Gemfile.lock
164
166
  - README.md
165
167
  - Rakefile
166
168
  - bin/bundler
@@ -234,14 +236,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
236
  requirements:
235
237
  - - ">="
236
238
  - !ruby/object:Gem::Version
237
- version: '0'
239
+ version: '2.7'
238
240
  required_rubygems_version: !ruby/object:Gem::Requirement
239
241
  requirements:
240
242
  - - ">="
241
243
  - !ruby/object:Gem::Version
242
244
  version: '0'
243
245
  requirements: []
244
- rubygems_version: 3.5.5
246
+ rubygems_version: 3.5.7
245
247
  signing_key:
246
248
  specification_version: 4
247
249
  summary: Distribute tests over many workers using a queue