minitest-distributed 0.1.0 → 0.1.1

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: c7cdf0e712969711ce22cfa2f7344b112177eff46d2e632a447b71830a248761
4
- data.tar.gz: 5c4e0ebdaf02176ad90d4ae6f907f5fc619c6335f4df64f4667eaaf54e7e657e
3
+ metadata.gz: 655c323406da3624b5c1a9aa6fb61fdb9b65816e4c440f08b03c7f6c90020082
4
+ data.tar.gz: 0f1decd1f9c88803ee9abf766111b8902c74327f0d2ad287189c5fe72ba46464
5
5
  SHA512:
6
- metadata.gz: 1858ec3fa36a8f31e2210999d4b5db0d361d6e01169946ecd2f9aec2af19028502d908301dd19e9657be8171001479a0914650a195013c6672f54305f639df87
7
- data.tar.gz: e720806c0fefa3958adb4c8170226913eb5c587819eef3666dde63018aacd882355d816384291029c260fc39681bf37ad4140f72cdabb2028303e259d8229c4d
6
+ metadata.gz: 48ce33a0bc593730ee3ca28332ab831608cec1af4ab6c28bed0c6bf05dec625817cf595f59961afe683c184fd8ce7f0933c1e392ebb5c099329998494bc76bda
7
+ data.tar.gz: fdea9c05ec72f5022be1d1a2c8a0a98da4f147624992ddb5ce8f5511da2f3f1a521110b3c126073370da2a1e570100cbd873d106c3d32af7dd430ae4380f9001
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ Gemfile.lock
@@ -19,6 +19,13 @@ module Minitest
19
19
  io.sync = true
20
20
  end
21
21
  @coordinator = T.let(options[:distributed].coordinator, Coordinators::CoordinatorInterface)
22
+ @window_line_width = T.let(nil, T.nilable(Integer))
23
+ end
24
+
25
+ sig { override.void }
26
+ def start
27
+ Signal.trap('WINCH') { @window_line_width = nil }
28
+ super
22
29
  end
23
30
 
24
31
  # Note: due to batching and parallel tests, we have no guarantee that `prerecord`
@@ -31,8 +38,8 @@ module Minitest
31
38
  sig { override.params(klass: T.class_of(Runnable), name: String).void }
32
39
  def prerecord(klass, name)
33
40
  if io.tty?
34
- line_width = clear_current_line
35
- io.print("[#{results.acks}/#{results.size}] #{klass}##{name}".slice(0...line_width))
41
+ clear_current_line
42
+ io.print("[#{results.acks}/#{results.size}] #{klass}##{name}".slice(0...window_line_width))
36
43
  end
37
44
  end
38
45
 
@@ -59,11 +66,17 @@ module Minitest
59
66
 
60
67
  private
61
68
 
62
- sig { returns(Integer) }
69
+ sig { void }
63
70
  def clear_current_line
64
- _height, width = IO.console.winsize
65
- io.print("\r" + (' ' * width) + "\r")
66
- width
71
+ io.print("\r" + (' ' * window_line_width) + "\r")
72
+ end
73
+
74
+ sig { returns(Integer) }
75
+ def window_line_width
76
+ @window_line_width ||= begin
77
+ _height, width = io.winsize
78
+ width > 0 ? width : 80
79
+ end
67
80
  end
68
81
 
69
82
  sig { returns(ResultAggregate) }
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Minitest
5
5
  module Distributed
6
- VERSION = "0.1.0"
6
+ VERSION = "0.1.1"
7
7
  end
8
8
  end
@@ -8,6 +8,10 @@ module Minitest
8
8
  extend T::Sig
9
9
 
10
10
  def plugin_distributed_options(opts, options)
11
+ opts.on('--disable-distributed', "Disable the distributed plugin") do
12
+ options[:disable_distributed] = true
13
+ end
14
+
11
15
  options[:distributed] = Minitest::Distributed::Configuration.from_env
12
16
 
13
17
  opts.on('--coordinator=URI', "The URI pointing to the coordinator") do |uri|
@@ -36,6 +40,8 @@ module Minitest
36
40
  end
37
41
 
38
42
  def plugin_distributed_init(options)
43
+ return if options[:disable_distributed]
44
+
39
45
  Minitest.singleton_class.prepend(Minitest::Distributed::TestRunnerPatch)
40
46
  options[:distributed].coordinator.register_reporters(reporter: reporter, options: options)
41
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-distributed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
@@ -80,7 +80,6 @@ files:
80
80
  - ".travis.yml"
81
81
  - CODE_OF_CONDUCT.md
82
82
  - Gemfile
83
- - Gemfile.lock
84
83
  - LICENSE.txt
85
84
  - README.md
86
85
  - Rakefile
@@ -1,53 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- minitest-distributed (0.1.0)
5
- minitest (~> 5.12)
6
- redis (~> 4.1)
7
- sorbet-runtime
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- ast (2.4.0)
13
- jaro_winkler (1.5.4)
14
- minitest (5.14.0)
15
- parallel (1.19.1)
16
- parser (2.7.1.2)
17
- ast (~> 2.4.0)
18
- rainbow (3.0.0)
19
- rake (12.3.3)
20
- redis (4.2.1)
21
- rexml (3.2.4)
22
- rubocop (0.82.0)
23
- jaro_winkler (~> 1.5.1)
24
- parallel (~> 1.10)
25
- parser (>= 2.7.0.1)
26
- rainbow (>= 2.2.2, < 4.0)
27
- rexml
28
- ruby-progressbar (~> 1.7)
29
- unicode-display_width (>= 1.4.0, < 2.0)
30
- rubocop-shopify (1.0.2)
31
- rubocop (~> 0.82.0)
32
- rubocop-sorbet (0.3.7)
33
- ruby-progressbar (1.10.1)
34
- sorbet (0.5.5605)
35
- sorbet-static (= 0.5.5605)
36
- sorbet-runtime (0.5.5765)
37
- sorbet-static (0.5.5605-universal-darwin-14)
38
- unicode-display_width (1.7.0)
39
-
40
- PLATFORMS
41
- ruby
42
-
43
- DEPENDENCIES
44
- minitest (~> 5.0)
45
- minitest-distributed!
46
- rake (~> 12.0)
47
- rubocop
48
- rubocop-shopify
49
- rubocop-sorbet
50
- sorbet
51
-
52
- BUNDLED WITH
53
- 2.1.4