hoe 3.19.0 → 3.20.0

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: 60448a5d7c3bd1a47db43c58f5fc6df41be8d019f4cbd42ec0422f35adc9e65c
4
- data.tar.gz: c314ee93a2fb7ece4f45653b998992bb9290efdb9f48f801bf302598d27d339f
3
+ metadata.gz: 0fa81b70d7c1e4d69338c4ee609525317bb1e9226f6cf7cdd7939524f6aa3f1b
4
+ data.tar.gz: eab25d6cbf84c54bc19dab742701aebe73705ebf141b579adef59b7d4bbc7887
5
5
  SHA512:
6
- metadata.gz: 427f6587c04472d4f736c07c1a5350774ea7eacde7a391af49b7f279f06dd8927d40954655668a7bb15b6273f51c2fbd13fb8d8d90b8c20871ef9f5a42247fed
7
- data.tar.gz: 0a07b4c88ef15ec87eb7fe2c7be3c388aca7bf73f1e0292e6d69da7263a047b1bc30f6e468b1c3fd51225f4f7d41c578e92b8a8f1d86527351b92b332130fb33
6
+ metadata.gz: b592a6202d60185d452036f10c7ef6e9febcfb9eaef67707ef221bb8cc988e8fce39911436b9b2219e5ba58b5437b999a4789243bd32b5d5eb7824493361f950
7
+ data.tar.gz: a3972c4b77340980ad5696a994e007fb9cd3646b9b8743f98cc137282498baa6bbe1b45ee5e647550eac78ce1e2100df55ba3457eff9014607d2c2c50e2f610e
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- ���.�����ۤ�'w�@���'{=��?++mW�C���}��a�F��O&�65��6 y��ձ*���1�]I��>�5�b�����;���q��0T���]�Hc��V�t�wr?�����9*�PF��Ǡ 3z�?�k<� ;�M��_5���O\�'�Q
1
+ *���͟:�jl���� }x(B���G����o���� ���ћ������$�\*��.Z��<~��J�,�
2
+ ��60��UR��KF�∣������]0[W�f�ú���C�r�h`}7�M�?�=Y-�v)��3��2��A�s�4�B�l���� ����-)�*����ظ����SZ��kˌߩ�.�n�6|�ŕv� @8��-�j"O� M�GiCE��`���/���?�h�:��+���C
@@ -1,3 +1,10 @@
1
+ === 3.20.0 / 2019-11-09
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Added <test>:isolated task that runs tests in parallel. Replaces <test>:dep task.
6
+ * Bumped rake dependency to be < 15.
7
+
1
8
  === 3.19.0 / 2019-10-29
2
9
 
3
10
  * 4 minor enhancements:
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ Hoe.spec "hoe" do
19
19
  pluggable!
20
20
  require_rubygems_version ">= 1.4"
21
21
 
22
- dependency "rake", [">= 0.8", "< 13.0"] # FIX: to force it to exist pre-isolate
22
+ dependency "rake", [">= 0.8", "< 15.0"] # FIX: to force it to exist pre-isolate
23
23
  end
24
24
 
25
25
  task :plugins do
data/lib/hoe.rb CHANGED
@@ -91,7 +91,7 @@ class Hoe
91
91
  include Rake::DSL if defined?(Rake::DSL)
92
92
 
93
93
  # duh
94
- VERSION = "3.19.0"
94
+ VERSION = "3.20.0"
95
95
 
96
96
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
97
97
  :publish, :gemcutter, :signing, :test]
@@ -19,20 +19,19 @@ module Minitest # :nodoc:
19
19
  #
20
20
  # The most basic and default setup.
21
21
  #
22
- # Minitest::TestTask.create :do_the_thing
22
+ # Minitest::TestTask.create :my_tests
23
23
  #
24
24
  # The most basic/default setup, but with a custom name
25
25
  #
26
- # Minitest::TestTask.create :spec do |t|
27
- # t.test_globs = ["spec/**/*_spec.rb"]
28
- # t.libs << "../dependency/lib"
26
+ # Minitest::TestTask.create :unit do |t|
27
+ # t.test_globs = ["test/unit/**/*_test.rb"]
28
+ # t.warning = false
29
29
  # end
30
30
  #
31
- # Customize the name, dependencies, and use a spec directory instead
32
- # of test.
31
+ # Customize the name and only run unit tests.
33
32
 
34
33
  class TestTask < Rake::TaskLib
35
- WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ # :nodoc: # TODO: verify
34
+ WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ # :nodoc:
36
35
 
37
36
  ##
38
37
  # Create several test-oriented tasks under +name+. Takes an
@@ -50,10 +49,11 @@ module Minitest # :nodoc:
50
49
  # Extra arguments to pass to the tests. Defaults empty but gets
51
50
  # populated by a number of enviroment variables:
52
51
  #
53
- # + N (-n flag) a string or regexp of tests to run.
54
- # + X (-e flag) a string or regexp of tests to exclude.
55
- # + TESTOPTS - extra stuff. For compatibility? I guess?
56
- # + A (arg) - quick way to inject an arbitrary argument (eg A=--help)
52
+ # N (-n flag) :: a string or regexp of tests to run.
53
+ # X (-e flag) :: a string or regexp of tests to exclude.
54
+ # A (arg) :: quick way to inject an arbitrary argument (eg A=--help).
55
+ #
56
+ # See #process_env
57
57
 
58
58
  attr_accessor :extra_args
59
59
 
@@ -94,11 +94,14 @@ module Minitest # :nodoc:
94
94
  attr_accessor :test_prelude
95
95
 
96
96
  ##
97
- # Print out commands as they run. Defaults to Rake's trace (-t
97
+ # Print out commands as they run. Defaults to Rake's +trace+ (-t
98
98
  # flag) option.
99
99
 
100
100
  attr_accessor :verbose
101
101
 
102
+ ##
103
+ # Use TestTask.create instead.
104
+
102
105
  def initialize name = :test # :nodoc:
103
106
  self.extra_args = []
104
107
  self.framework = %(require "minitest/autorun")
@@ -113,20 +116,20 @@ module Minitest # :nodoc:
113
116
 
114
117
  ##
115
118
  # Extract variables from the environment and convert them to
116
- # command line arguments. See +extra_args+.
119
+ # command line arguments. See #extra_args.
117
120
  #
118
121
  # Environment Variables:
119
122
  #
120
- # + MT_LIB_EXTRAS - Extra libs to dynamically override/inject for custom runs.
121
- # + N - Tests to run (string or /regexp/)
122
- # + X - Tests to exclude (string or /regexp/)
123
- # + A - Any extra arguments. Honors shell quoting.
123
+ # MT_LIB_EXTRAS :: Extra libs to dynamically override/inject for custom runs.
124
+ # N :: Tests to run (string or /regexp/).
125
+ # X :: Tests to exclude (string or /regexp/).
126
+ # A :: Any extra arguments. Honors shell quoting.
124
127
  #
125
128
  # Deprecated:
126
129
  #
127
- # + TESTOPTS - for argument passing, use A
128
- # + N - for parallel testing, use MT_CPU
129
- # + FILTER - same as TESTOPTS
130
+ # TESTOPTS :: For argument passing, use +A+.
131
+ # N :: For parallel testing, use +MT_CPU+.
132
+ # FILTER :: Same as +TESTOPTS+.
130
133
 
131
134
  def process_env
132
135
  warn "TESTOPTS is deprecated in Minitest::TestTask. Use A instead" if
@@ -153,10 +156,7 @@ module Minitest # :nodoc:
153
156
  extra_args.compact!
154
157
  end
155
158
 
156
- ##
157
- # Create the tasks.
158
-
159
- def define
159
+ def define # :nodoc:
160
160
  default_tasks = []
161
161
 
162
162
  desc "Run the test suite. Use N, X, A, and TESTOPTS to add flags/args."
@@ -169,24 +169,73 @@ module Minitest # :nodoc:
169
169
  puts "ruby #{make_test_cmd}"
170
170
  end
171
171
 
172
- desc "Show which test files fail when run alone."
173
- task "#{name}:deps" do
172
+ desc "Show which test files fail when run in isolation."
173
+ task "#{name}:isolated" do
174
174
  tests = Dir[*self.test_globs].uniq
175
175
 
176
- null_dev = WINDOWS ? "> NUL 2>&1" : "> /dev/null 2>&1"
176
+ # 3 seems to be the magic number... (tho not by that much)
177
+ bad, good, n = {}, [], (ENV.delete("K") || 3).to_i
178
+ path = ENV.delete("F")
179
+ times = {}
180
+
181
+ tt0 = Time.now
177
182
 
178
- tests.each do |test|
179
- cmd = make_test_cmd test
183
+ n.threads_do tests.sort do |path|
184
+ t0 = Time.now
185
+ output = `#{Gem.ruby} #{make_test_cmd path} 2>&1`
186
+ t1 = Time.now - t0
180
187
 
181
- if system "ruby #{cmd} #{null_dev}" then
182
- puts "# good: #{test}"
188
+ times[path] = t1
189
+
190
+ if $?.success?
191
+ $stderr.print "."
192
+ good << path
183
193
  else
184
- puts "# bad: #{test}"
185
- puts " ruby #{cmd}"
194
+ $stderr.print "x"
195
+ bad[path] = output
196
+ end
197
+ end
198
+
199
+ puts "done"
200
+ puts "Ran in %.2f seconds" % [ Time.now - tt0 ]
201
+
202
+ if path then
203
+ require "json"
204
+ File.open path, "w" do |io|
205
+ io.write JSON.pretty_generate times
206
+ end
207
+ end
208
+
209
+ unless good.empty?
210
+ puts
211
+ puts "# Good tests:"
212
+ puts
213
+ good.sort.each do |path|
214
+ puts "%.2fs: %s" % [times[path], path]
186
215
  end
187
216
  end
217
+
218
+ unless bad.empty?
219
+ puts
220
+ puts "# Bad tests:"
221
+ puts
222
+ bad.keys.sort.each do |path|
223
+ puts "%.2fs: %s" % [times[path], path]
224
+ end
225
+ puts
226
+ puts "# Bad Test Output:"
227
+ puts
228
+ bad.sort.each do |path, output|
229
+ puts
230
+ puts "# #{path}:"
231
+ puts output
232
+ end
233
+ exit 1
234
+ end
188
235
  end
189
236
 
237
+ task "#{name}:deps" => "#{name}:isolated" # now just an alias
238
+
190
239
  desc "Show bottom 25 tests wrt time."
191
240
  task "#{name}:slow" do
192
241
  sh ["rake #{name} TESTOPTS=-v",
@@ -227,3 +276,30 @@ module Minitest # :nodoc:
227
276
  end
228
277
  end
229
278
  end
279
+
280
+ class Work < Queue
281
+ def initialize jobs = []
282
+ super()
283
+
284
+ jobs.each do |job|
285
+ self << job
286
+ end
287
+
288
+ close
289
+ end
290
+ end
291
+
292
+ class Integer
293
+ def threads_do(jobs) # :nodoc:
294
+ require "thread"
295
+ q = Work.new jobs
296
+
297
+ self.times.map {
298
+ Thread.new do
299
+ while job = q.pop # go until quit value
300
+ yield job
301
+ end
302
+ end
303
+ }.each(&:join)
304
+ end
305
+ end
@@ -391,6 +391,8 @@ class TestHoe < Minitest::Test
391
391
  end
392
392
 
393
393
  def test_with_config_overrides
394
+ require "hoe/debug" # modifies Hoe::DEFAULT_CONFIG["exclude"]
395
+
394
396
  overrides = {
395
397
  "exclude" => Regexp.union( Hoe::DEFAULT_CONFIG["exclude"], /\.hg/ ),
396
398
  "plugins" => %w[tweedledee tweedledum],
@@ -1,4 +1,5 @@
1
1
  require "hoe"
2
+ require "minitest/autorun"
2
3
 
3
4
  Hoe.load_plugins
4
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.19.0
4
+ version: 3.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  Em82dBUFsipwMLCYj39kcyHWAxyl6Ae1Cn9r/ItVBCxoeFdrHjfavnrIEoXUt4bU
30
30
  UfBugfLD19bu3nvL+zTAGx/U
31
31
  -----END CERTIFICATE-----
32
- date: 2019-10-30 00:00:00.000000000 Z
32
+ date: 2019-11-09 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: '0.8'
41
41
  - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '13.0'
43
+ version: '15.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  version: '0.8'
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '13.0'
53
+ version: '15.0'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: rdoc
56
56
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file