minitest-distributed 0.2.7 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +43 -0
  3. data/.github/workflows/ruby.yml +38 -9
  4. data/.rubocop.yml +1 -0
  5. data/Gemfile +1 -0
  6. data/README.md +5 -5
  7. data/bin/rake +4 -2
  8. data/bin/rubocop +4 -2
  9. data/bin/srb +4 -2
  10. data/dev.yml +7 -0
  11. data/docker-compose.yml +11 -0
  12. data/lib/minitest/distributed/configuration.rb +5 -0
  13. data/lib/minitest/distributed/coordinators/redis_coordinator.rb +40 -11
  14. data/lib/minitest/distributed/enqueued_runnable.rb +1 -1
  15. data/lib/minitest/distributed/reporters/junitxml_reporter.rb +6 -4
  16. data/lib/minitest/distributed/reporters/test_order_reporter.rb +36 -0
  17. data/lib/minitest/distributed/result_type.rb +3 -1
  18. data/lib/minitest/distributed/test_selector.rb +11 -1
  19. data/lib/minitest/distributed/version.rb +1 -1
  20. data/lib/minitest/distributed_plugin.rb +7 -0
  21. data/lib/minitest/test_order_plugin.rb +21 -0
  22. data/minitest-distributed.gemspec +1 -1
  23. data/sorbet/config +1 -0
  24. data/sorbet/rbi/gems/ast.rbi +49 -0
  25. data/sorbet/rbi/gems/connection_pool.rbi +55 -0
  26. data/sorbet/rbi/gems/minitest-distributed.rbi +15 -0
  27. data/sorbet/rbi/gems/minitest.rbi +426 -0
  28. data/sorbet/rbi/gems/parallel.rbi +86 -0
  29. data/sorbet/rbi/gems/parser.rbi +1477 -0
  30. data/sorbet/rbi/gems/rainbow.rbi +122 -0
  31. data/sorbet/rbi/gems/rake.rbi +647 -0
  32. data/sorbet/rbi/gems/redis-client.rbi +311 -0
  33. data/sorbet/rbi/gems/redis.rbi +409 -0
  34. data/sorbet/rbi/gems/regexp_parser.rbi +984 -0
  35. data/sorbet/rbi/gems/rexml.rbi +599 -0
  36. data/sorbet/rbi/gems/rubocop-ast.rbi +1398 -0
  37. data/sorbet/rbi/gems/rubocop-minitest.rbi +406 -0
  38. data/sorbet/rbi/gems/rubocop-rake.rbi +85 -0
  39. data/sorbet/rbi/gems/rubocop-sorbet.rbi +218 -0
  40. data/sorbet/rbi/gems/rubocop.rbi +9351 -0
  41. data/sorbet/rbi/gems/ruby-progressbar.rbi +304 -0
  42. data/sorbet/rbi/gems/toxiproxy.rbi +112 -0
  43. data/sorbet/rbi/gems/unicode-display_width.rbi +23 -0
  44. data/sorbet/rbi/minitest.rbi +5 -1
  45. data/sorbet/rbi/rails.rbi +1 -0
  46. data/sorbet/rbi/rbconfig.rbi +1 -1
  47. metadata +29 -5
  48. data/sorbet/rbi/redis.rbi +0 -106
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dae86a5761e82ad0675cb289f945eeb29039bbb55c5be5d9e832e22bd5eb62c
4
- data.tar.gz: 56c65bd5817b033a9a912dc24a1dd8ef7276efa75828a9b3a5dd1dfc82387e0c
3
+ metadata.gz: 1dc9ad4333958d6197869544c8fd47f6bc0f6ccdb5fe2203fe4af1ed348164ed
4
+ data.tar.gz: fad3b8564ad602cf2209ebff92b1ddeef601f2ae3ccdfc94d67820e077a05943
5
5
  SHA512:
6
- metadata.gz: 3a48ade567a3e8db5f70b7b2fe0f9b1f19e295eaf457f49df59030b997bf17de3b86253def06ec60741f9b6344447a15239f345b3af4197fe3588851c4e22473
7
- data.tar.gz: b2ce6e5bfb8a24a308f4409b4e61b75db00fd3f677e1ea335d8b25e0c0f128eeb49737898fc6f7540923e965239e6bdb76dbdb14c22b42bea12ab06d88a08e7a
6
+ metadata.gz: 833c450f354affcdab9f7d3939dd5ac5de52de2a586758cf46b8b21a60073712dca466d2847aa6a918eea2e68d8013e6d53dee1fc335fc7dcca97edca7785cce
7
+ data.tar.gz: 6d35405c22570d2c9c9628e35330ce2e198d77ec8610e88568d07e7b3d7453323872db88e7b99de11148e396e56487be3c98c540110127cbaaa53ab21307da0a
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: "[BUG]"
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the issue**
11
+ A clear and concise description of the issue you're facing.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behaviour:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behaviour**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **What team are you on?**
27
+ Please provide the name of your team.
28
+
29
+ **Helpful links (Logs, Link to Build, Repo, PR etc.)**
30
+ Please provide any helpful links for investigating the issue.
31
+
32
+ **Is there a Slack thread related to this bug?**
33
+ After submitting this issue, you can use: @spy github issues create_comment repo=minitest-distributed issue_id=$NEW_ISSUE_ID on any relevant Slack threads to save that information here.
34
+
35
+ **Additional context**
36
+ Add any other context about the problem here.
37
+
38
+ If possible, assign appropriate severity level, priority (high, medium, low) and difficulty (easy, normal, difficult) labels to the issue.
39
+ SEV-1 <24-72h - Critical issue that actively impacts multiple users/products.
40
+ SEV-2 <14 days - Limited impact app or major inconvenience to app users, workarounds available.
41
+ SEV-3 <60 days - Minor issue requiring action, but not affecting a users ability to use the app.
42
+ SEV-4 <180 days - Minimal impact but something the team wants to fix eventually.
43
+ SEV-5 No timeline - Cosmetic issue or bugs, no effect on user's ability to use tooling.
@@ -10,13 +10,35 @@ name: Ruby
10
10
  on: push
11
11
 
12
12
  jobs:
13
+ test_32:
14
+ runs-on: shopify-ubuntu-latest
15
+ container: ruby:3.2
16
+
17
+ services:
18
+ redis:
19
+ image: redis
20
+ toxiproxy:
21
+ image: ghcr.io/shopify/toxiproxy:2.5.0
22
+
23
+ steps:
24
+ - uses: actions/checkout@v2
25
+ - name: Install dependencies
26
+ run: gem install bundler && bundle install
27
+ - name: Run tests
28
+ run: bin/rake test
29
+ env:
30
+ REDIS_URL: redis://toxiproxy:22220
31
+ TOXIPROXY_HOST: http://toxiproxy:8474
32
+
13
33
  test_31:
14
- runs-on: ubuntu-latest
34
+ runs-on: shopify-ubuntu-latest
15
35
  container: ruby:3.1
16
36
 
17
37
  services:
18
38
  redis:
19
39
  image: redis
40
+ toxiproxy:
41
+ image: ghcr.io/shopify/toxiproxy:2.5.0
20
42
 
21
43
  steps:
22
44
  - uses: actions/checkout@v2
@@ -25,15 +47,18 @@ jobs:
25
47
  - name: Run tests
26
48
  run: bin/rake test
27
49
  env:
28
- REDIS_URL: redis://redis:6379
50
+ REDIS_URL: redis://toxiproxy:22220
51
+ TOXIPROXY_HOST: http://toxiproxy:8474
29
52
 
30
53
  test_30:
31
- runs-on: ubuntu-latest
54
+ runs-on: shopify-ubuntu-latest
32
55
  container: ruby:3.0
33
56
 
34
57
  services:
35
58
  redis:
36
59
  image: redis
60
+ toxiproxy:
61
+ image: ghcr.io/shopify/toxiproxy:2.5.0
37
62
 
38
63
  steps:
39
64
  - uses: actions/checkout@v2
@@ -42,15 +67,18 @@ jobs:
42
67
  - name: Run tests
43
68
  run: bin/rake test
44
69
  env:
45
- REDIS_URL: redis://redis:6379
70
+ REDIS_URL: redis://toxiproxy:22220
71
+ TOXIPROXY_HOST: http://toxiproxy:8474
46
72
 
47
73
  test_27:
48
- runs-on: ubuntu-latest
74
+ runs-on: shopify-ubuntu-latest
49
75
  container: ruby:2.7
50
76
 
51
77
  services:
52
78
  redis:
53
79
  image: redis
80
+ toxiproxy:
81
+ image: ghcr.io/shopify/toxiproxy:2.5.0
54
82
 
55
83
  steps:
56
84
  - uses: actions/checkout@v2
@@ -59,10 +87,11 @@ jobs:
59
87
  - name: Run tests
60
88
  run: bin/rake test
61
89
  env:
62
- REDIS_URL: redis://redis:6379
90
+ REDIS_URL: redis://toxiproxy:22220
91
+ TOXIPROXY_HOST: http://toxiproxy:8474
63
92
 
64
93
  typecheck:
65
- runs-on: ubuntu-latest
94
+ runs-on: shopify-ubuntu-latest
66
95
  container: ruby:2.7
67
96
  steps:
68
97
  - uses: actions/checkout@v2
@@ -72,8 +101,8 @@ jobs:
72
101
  run: bin/srb tc
73
102
 
74
103
  lint:
75
- runs-on: ubuntu-latest
76
- container: ruby:2.7
104
+ runs-on: shopify-ubuntu-latest
105
+ container: ruby:3.2
77
106
  steps:
78
107
  - uses: actions/checkout@v2
79
108
  - name: Install dependencies
data/.rubocop.yml CHANGED
@@ -14,6 +14,7 @@ AllCops:
14
14
  CacheRootDirectory: tmp/rubocop
15
15
  Exclude:
16
16
  - minitest-distributed.gemspec
17
+ NewCops: disable
17
18
 
18
19
  # This cop is broken when using assignments
19
20
  Layout/RescueEnsureAlignment:
data/Gemfile CHANGED
@@ -13,3 +13,4 @@ gem "rubocop-shopify"
13
13
  gem "rubocop-sorbet"
14
14
  gem "rubocop-minitest"
15
15
  gem "rubocop-rake"
16
+ gem "toxiproxy"
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [About this repo](#about-this-repo) | [Commands](#commands) | [How to use this repo](#how-to-use-this-repo) | [Contribute to this repo](#contribute-to-this-repo) | [License](#license)
6
6
 
7
7
  ## About this repo
8
- **Introduction:**
8
+ **Introduction:**
9
9
 
10
10
  `minitest-distributed` is a plugin for [minitest](https://github.com/seattlerb/minitest)
11
11
  for executing tests on a distributed set of unreliable workers.
@@ -87,11 +87,11 @@ them to fail.
87
87
  - `--worker-id=IDENTIFIER` or `ENV[MINITEST_WORKER_ID]`: The ID of the worker,
88
88
  which should be unique to the cluster. We will default to a UUID if this is
89
89
  not set, which generally is fine.
90
- - `--exclude-file=PATH_TO_FILE`: Specify a file of tests to be excluded
91
- from running. The file should include test identifiers seperated by
90
+ - `--exclude-file=PATH_TO_FILE`: Specify a file of tests to be excluded
91
+ from running. The file should include test identifiers seperated by
92
92
  newlines.
93
93
  - `--include-file=PATH_TO_FILE`: Specify a file of tests to be included in
94
- the test run. The file should include test identifiers seperated by
94
+ the test run. The file should include test identifiers seperated by
95
95
  newlines.
96
96
 
97
97
  **Limitations**
@@ -124,7 +124,7 @@ To bootstrap a local development environment:
124
124
  - Start a Redis server by running `redis-server`, assuming you have Redis
125
125
  installed locally and the binary is on your `PATH`. Alternatively, you can
126
126
  set the `REDIS_URL` environment variable to point to a Redis instance running
127
- elsewhere.
127
+ elsewhere. You can also use `docker-compose up` with the provided `docker-compose.yml`.
128
128
  - Now, run `bin/rake test` to run the tests, and verify everything is working.
129
129
  - You can also run `bin/console` for an interactive prompt that will allow you
130
130
  to experiment.
data/bin/rake CHANGED
@@ -9,8 +9,10 @@
9
9
  #
10
10
 
11
11
  require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
13
+ "../../Gemfile",
14
+ Pathname.new(__FILE__).realpath,
15
+ )
14
16
 
15
17
  bundle_binstub = File.expand_path("../bundle", __FILE__)
16
18
 
data/bin/rubocop CHANGED
@@ -9,8 +9,10 @@
9
9
  #
10
10
 
11
11
  require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
13
+ "../../Gemfile",
14
+ Pathname.new(__FILE__).realpath,
15
+ )
14
16
 
15
17
  bundle_binstub = File.expand_path("../bundle", __FILE__)
16
18
 
data/bin/srb CHANGED
@@ -9,8 +9,10 @@
9
9
  #
10
10
 
11
11
  require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
13
+ "../../Gemfile",
14
+ Pathname.new(__FILE__).realpath,
15
+ )
14
16
 
15
17
  bundle_binstub = File.expand_path("../bundle", __FILE__)
16
18
 
data/dev.yml ADDED
@@ -0,0 +1,7 @@
1
+ name: minitest-distributed
2
+
3
+ type: ruby
4
+
5
+ up:
6
+ - ruby: 3.2.0
7
+ - bundler
@@ -0,0 +1,11 @@
1
+ version: '2'
2
+ services:
3
+ redis:
4
+ image: redis:latest
5
+ ports:
6
+ - "6379:6379"
7
+ toxi-proxy:
8
+ image: ghcr.io/shopify/toxiproxy:2.5.0
9
+ ports:
10
+ - "8474:8474"
11
+ - "22220:22220"
@@ -79,6 +79,10 @@ module Minitest
79
79
  configuration.include_file = file_path
80
80
  end
81
81
 
82
+ opts.on("--[no-]shuffle-suites", "Shuffle test suites as well") do |enabled|
83
+ configuration.shuffle_suites = enabled
84
+ end
85
+
82
86
  configuration
83
87
  end
84
88
  end
@@ -97,6 +101,7 @@ module Minitest
97
101
  prop :progress, T::Boolean, default: false
98
102
  prop :exclude_file, T.nilable(String)
99
103
  prop :include_file, T.nilable(String)
104
+ prop :shuffle_suites, T::Boolean, default: true
100
105
 
101
106
  sig { returns(Coordinators::CoordinatorInterface) }
102
107
  def coordinator
@@ -83,9 +83,18 @@ module Minitest
83
83
  sig { override.returns(ResultAggregate) }
84
84
  def combined_results
85
85
  @combined_results ||= begin
86
- stats_as_string = redis.mget(key("runs"), key("assertions"), key("passes"),
87
- key("failures"), key("errors"), key("skips"), key("requeues"), key("discards"),
88
- key("acks"), key("size"))
86
+ stats_as_string = redis.mget(
87
+ key("runs"),
88
+ key("assertions"),
89
+ key("passes"),
90
+ key("failures"),
91
+ key("errors"),
92
+ key("skips"),
93
+ key("requeues"),
94
+ key("discards"),
95
+ key("acks"),
96
+ key("size"),
97
+ )
89
98
 
90
99
  ResultAggregate.new(
91
100
  max_failures: configuration.max_failures,
@@ -279,8 +288,14 @@ module Minitest
279
288
 
280
289
  sig { params(block: Integer).returns(T::Array[EnqueuedRunnable]) }
281
290
  def claim_fresh_runnables(block:)
282
- result = redis.xreadgroup(group_name, configuration.worker_id, stream_key, ">",
283
- block: block, count: configuration.test_batch_size)
291
+ result = redis.xreadgroup(
292
+ group_name,
293
+ configuration.worker_id,
294
+ stream_key,
295
+ ">",
296
+ block: block,
297
+ count: configuration.test_batch_size,
298
+ )
284
299
  EnqueuedRunnable.from_redis_stream_claim(result.fetch(stream_key, []), configuration: configuration)
285
300
  end
286
301
 
@@ -293,8 +308,13 @@ module Minitest
293
308
  def xclaim_messages(pending_messages, max_idle_time_ms:)
294
309
  return [] if pending_messages.empty?
295
310
 
296
- claimed = redis.xclaim(stream_key, group_name, configuration.worker_id,
297
- max_idle_time_ms, pending_messages.keys)
311
+ claimed = redis.xclaim(
312
+ stream_key,
313
+ group_name,
314
+ configuration.worker_id,
315
+ max_idle_time_ms,
316
+ pending_messages.keys,
317
+ )
298
318
 
299
319
  EnqueuedRunnable.from_redis_stream_claim(claimed, pending_messages, configuration: configuration)
300
320
  end
@@ -421,10 +441,19 @@ module Minitest
421
441
  pipeline.incrby(key("size"), results.size)
422
442
  end
423
443
 
424
- @combined_results = ResultAggregate.new(max_failures: configuration.max_failures,
425
- runs: updated[0], assertions: updated[1], passes: updated[2],
426
- failures: updated[3], errors: updated[4], skips: updated[5], requeues: updated[6], discards: updated[7],
427
- acks: updated[8], size: updated[9])
444
+ @combined_results = ResultAggregate.new(
445
+ max_failures: configuration.max_failures,
446
+ runs: updated[0],
447
+ assertions: updated[1],
448
+ passes: updated[2],
449
+ failures: updated[3],
450
+ errors: updated[4],
451
+ skips: updated[5],
452
+ requeues: updated[6],
453
+ discards: updated[7],
454
+ acks: updated[8],
455
+ size: updated[9],
456
+ )
428
457
  end
429
458
 
430
459
  sig { params(name: String).returns(String) }
@@ -203,7 +203,7 @@ module Minitest
203
203
  sig do
204
204
  params(
205
205
  initial_result: Minitest::Result,
206
- block: T.proc.params(arg0: Minitest::Result).returns(EnqueuedRunnable::Result::Commit)
206
+ block: T.proc.params(arg0: Minitest::Result).returns(EnqueuedRunnable::Result::Commit),
207
207
  ).returns(EnqueuedRunnable::Result)
208
208
  end
209
209
  def commit_result(initial_result, &block)
@@ -78,11 +78,10 @@ module Minitest
78
78
  def add_tests_to(testsuites, suite, results)
79
79
  # TODO: make path relative to project root
80
80
  relative_path = T.must(results.first).source_location.first
81
- lineno = T.must(results.first).source_location.last
82
81
 
83
82
  testsuite = testsuites.add_element(
84
83
  "testsuite",
85
- { "name" => suite, "filepath" => relative_path }.merge(aggregate_suite_results(results))
84
+ { "name" => suite, "filepath" => relative_path }.merge(aggregate_suite_results(results)),
86
85
  )
87
86
 
88
87
  results.each do |test|
@@ -93,6 +92,7 @@ module Minitest
93
92
  "time" => test.time,
94
93
  # 'run-command' => ... # TODO
95
94
  }
95
+ lineno = test.source_location.last
96
96
  attributes["lineno"] = lineno if lineno != -1
97
97
 
98
98
  testcase_tag = testsuite.add_element("testcase", attributes)
@@ -107,9 +107,11 @@ module Minitest
107
107
  # noop
108
108
  when ResultType::Error, ResultType::Failed
109
109
  failure = T.must(result.failure)
110
- failure_tag = testcase.add_element("failure",
110
+ failure_tag = testcase.add_element(
111
+ "failure",
111
112
  "type" => result_type.serialize,
112
- "message" => truncate_message(failure.message))
113
+ "message" => truncate_message(failure.message),
114
+ )
113
115
  failure_tag.add_text(REXML::CData.new(result.to_s))
114
116
  else
115
117
  T.absurd(result_type)
@@ -0,0 +1,36 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module Minitest
5
+ module Distributed
6
+ module Reporters
7
+ class TestOrderReporter < Minitest::Reporter
8
+ extend T::Sig
9
+
10
+ sig { params(io: IO, options: T::Hash[Symbol, T.untyped]).void }
11
+ def initialize(io, options)
12
+ super
13
+ @path = T.let(options.fetch(:test_order_file), String)
14
+ @file = T.let(nil, T.nilable(File))
15
+ end
16
+
17
+ sig { void }
18
+ def start
19
+ @file = File.open(@path, "w+")
20
+ super
21
+ end
22
+
23
+ sig { override.params(klass: Class, name: String).void }
24
+ def prerecord(klass, name)
25
+ T.must(@file).puts("#{klass}##{name}")
26
+ T.must(@file).flush
27
+ end
28
+
29
+ sig { override.void }
30
+ def report
31
+ T.must(@file).close
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -27,7 +27,9 @@ module Minitest
27
27
  "\n\nThe test took %0.3fs to run, longer than the test timeout which is configured to be %0.1fs.\n" \
28
28
  "Another worker likely claimed ownership of this test, and will commit the result instead.\n" \
29
29
  "For best results, make sure that all your tests finish within %0.1fs.",
30
- result.time, test_timeout_seconds, test_timeout_seconds
30
+ result.time,
31
+ test_timeout_seconds,
32
+ test_timeout_seconds,
31
33
  )
32
34
  end
33
35
 
@@ -36,11 +36,21 @@ module Minitest
36
36
 
37
37
  sig { returns(T::Array[Minitest::Runnable]) }
38
38
  def discover_tests
39
- Minitest::Runnable.runnables.flat_map do |runnable|
39
+ runnables.flat_map do |runnable|
40
40
  runnable.runnable_methods.map { |method_name| runnable.new(method_name) }
41
41
  end
42
42
  end
43
43
 
44
+ sig { returns(T::Array[T.class_of(Minitest::Runnable)]) }
45
+ def runnables
46
+ if options[:distributed].shuffle_suites
47
+ srand(Minitest.seed)
48
+ Minitest::Runnable.runnables.shuffle
49
+ else
50
+ Minitest::Runnable.runnables
51
+ end
52
+ end
53
+
44
54
  sig { params(tests: T::Array[Minitest::Runnable]).returns(T::Array[Minitest::Runnable]) }
45
55
  def select_tests(tests)
46
56
  return tests if filters.empty?
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Minitest
5
5
  module Distributed
6
- VERSION = "0.2.7"
6
+ VERSION = "0.2.9"
7
7
  end
8
8
  end
@@ -8,10 +8,17 @@ module Minitest
8
8
  extend T::Sig
9
9
 
10
10
  def plugin_distributed_options(opts, options)
11
+ continuous_integration = ENV.fetch("CI", "false") == "true"
12
+ options[:disable_distributed] = !continuous_integration
13
+
11
14
  opts.on("--disable-distributed", "Disable the distributed plugin") do
12
15
  options[:disable_distributed] = true
13
16
  end
14
17
 
18
+ opts.on("--enable-distributed", "Enable the distributed plugin") do
19
+ options[:disable_distributed] = false
20
+ end
21
+
15
22
  options[:distributed] = Minitest::Distributed::Configuration.from_command_line_options(opts, options)
16
23
  end
17
24
 
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module Minitest
5
+ class << self
6
+ def plugin_test_order_options(opts, options)
7
+ options[:test_order_file] = ENV["MINITEST_TEST_ORDER"]
8
+
9
+ opts.on("--test_order=PATH", "Log order of tests executed to provided file.") do |path|
10
+ options[:test_order_file] = path
11
+ end
12
+ end
13
+
14
+ def plugin_test_order_init(options)
15
+ return if options[:test_order_file].nil?
16
+
17
+ require_relative "distributed/reporters/test_order_reporter"
18
+ reporter << Minitest::Distributed::Reporters::TestOrderReporter.new(options[:io], options)
19
+ end
20
+ end
21
+ end
@@ -45,6 +45,6 @@ Gem::Specification.new do |spec|
45
45
  spec.require_paths = ["lib"]
46
46
 
47
47
  spec.add_dependency('minitest', '~> 5.12')
48
- spec.add_dependency('redis', '>= 4.2', '< 6')
48
+ spec.add_dependency('redis', '>= 5.0.6', '< 6')
49
49
  spec.add_dependency('sorbet-runtime')
50
50
  end
data/sorbet/config CHANGED
@@ -1,2 +1,3 @@
1
1
  --dir
2
2
  .
3
+ --ignore=vendor
@@ -0,0 +1,49 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: strict
5
+ #
6
+ # If you would like to make changes to this file, great! Please create the gem's shim here:
7
+ #
8
+ # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/ast/all/ast.rbi
9
+ #
10
+ # ast-2.4.2
11
+
12
+ module AST
13
+ end
14
+ class AST::Node
15
+ def +(array); end
16
+ def <<(element); end
17
+ def ==(other); end
18
+ def append(element); end
19
+ def assign_properties(properties); end
20
+ def children; end
21
+ def clone; end
22
+ def concat(array); end
23
+ def deconstruct; end
24
+ def dup; end
25
+ def eql?(other); end
26
+ def fancy_type; end
27
+ def hash; end
28
+ def initialize(type, children = nil, properties = nil); end
29
+ def inspect(indent = nil); end
30
+ def original_dup; end
31
+ def to_a; end
32
+ def to_ast; end
33
+ def to_s(indent = nil); end
34
+ def to_sexp(indent = nil); end
35
+ def to_sexp_array; end
36
+ def type; end
37
+ def updated(type = nil, children = nil, properties = nil); end
38
+ end
39
+ class AST::Processor
40
+ include AST::Processor::Mixin
41
+ end
42
+ module AST::Processor::Mixin
43
+ def handler_missing(node); end
44
+ def process(node); end
45
+ def process_all(nodes); end
46
+ end
47
+ module AST::Sexp
48
+ def s(type, *children); end
49
+ end
@@ -0,0 +1,55 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: strict
5
+ #
6
+ # If you would like to make changes to this file, great! Please create the gem's shim here:
7
+ #
8
+ # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/connection_pool/all/connection_pool.rbi
9
+ #
10
+ # connection_pool-2.3.0
11
+
12
+ class ConnectionPool
13
+ def available; end
14
+ def checkin; end
15
+ def checkout(options = nil); end
16
+ def initialize(options = nil, &block); end
17
+ def reload(&block); end
18
+ def self.wrap(options, &block); end
19
+ def shutdown(&block); end
20
+ def size; end
21
+ def then(options = nil); end
22
+ def with(options = nil); end
23
+ end
24
+ class ConnectionPool::TimedStack
25
+ def <<(obj, options = nil); end
26
+ def connection_stored?(options = nil); end
27
+ def current_time; end
28
+ def empty?; end
29
+ def fetch_connection(options = nil); end
30
+ def initialize(size = nil, &block); end
31
+ def length; end
32
+ def max; end
33
+ def pop(timeout = nil, options = nil); end
34
+ def push(obj, options = nil); end
35
+ def shutdown(reload: nil, &block); end
36
+ def shutdown_connections(options = nil); end
37
+ def store_connection(obj, options = nil); end
38
+ def try_create(options = nil); end
39
+ end
40
+ class ConnectionPool::Wrapper < BasicObject
41
+ def initialize(options = nil, &block); end
42
+ def method_missing(name, *args, **kwargs, &block); end
43
+ def pool_available; end
44
+ def pool_shutdown(&block); end
45
+ def pool_size; end
46
+ def respond_to?(id, *args); end
47
+ def with(&block); end
48
+ def wrapped_pool; end
49
+ end
50
+ class ConnectionPool::Error < RuntimeError
51
+ end
52
+ class ConnectionPool::PoolShuttingDownError < ConnectionPool::Error
53
+ end
54
+ class ConnectionPool::TimeoutError < Timeout::Error
55
+ end
@@ -0,0 +1,15 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: strict
5
+ #
6
+ # If you would like to make changes to this file, great! Please create the gem's shim here:
7
+ #
8
+ # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/minitest-distributed/all/minitest-distributed.rbi
9
+ #
10
+ # minitest-distributed-0.2.8
11
+
12
+ module Minitest
13
+ def self.plugin_junitxml_init(options); end
14
+ def self.plugin_junitxml_options(opts, options); end
15
+ end