forking_test_runner 1.5.0 → 1.8.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: fc4844e1ccea576d0e7992efedab19587cb803ec04df7db7f82061253bada8fe
4
- data.tar.gz: 2a8a12c8446e35c410417ac5271cd401d525d508a9b0db2c1c0674bd81d9275f
3
+ metadata.gz: 4305afeb107804af380e5b6bcd47f2898f9eab13c278a0ceb7f9f0c38ef43e08
4
+ data.tar.gz: 0cac2bb33fa7aa9e95773d954f2dd79525afde18820eddc61463f2d4e1f9f00a
5
5
  SHA512:
6
- metadata.gz: 67e48c4c7e3ac01664bfb0b21bf8339875a1fed6b8a40a75f546cd849ad165df3346afaf641035317ff0be8d553ab745f2cc7e14fb3d747c5849db01d5bab1d9
7
- data.tar.gz: 59c63fcf19c1a472804504987d31bfe01e85805453db87104068279227a7b83391e9cc74323f412033d1fbe83a5a9b4304805b249f275539ba2367a3478e2460
6
+ metadata.gz: 5e61dd68b3d49db51c47b6c1634fb4868c0ba1da8abe04eef24c89729ea6286a96c1c1c7211270e57e4a3fa945b5be9ed0eb89662d9a1f1fbd7aaea30d0486a2
7
+ data.tar.gz: 607c539c59aba33a07aa8cee7eafcd079326e9ca7c94cb6fd8e3b70fc2467e5a367a04b6166c3a3d8e86cd73185ef14a9068435d219f0cf77e3779b9b742fd5c
@@ -21,6 +21,7 @@ module ForkingTestRunner
21
21
  if parallel && !@options.fetch(:group)
22
22
  Array.new(parallel) { |i| find_tests_for_group(i + 1, parallel, tests, runtime_log) }
23
23
  else
24
+ raise ArgumentError, "Use the same amount of processors as groups" if parallel && parallel != groups.count
24
25
  groups.map { |group| find_tests_for_group(group, group_count, tests, runtime_log) }
25
26
  end
26
27
 
@@ -251,8 +252,7 @@ module ForkingTestRunner
251
252
 
252
253
  child = fork do
253
254
  rpipe.close
254
- $stdout.reopen(wpipe)
255
-
255
+ preserve_tty { $stdout.reopen(wpipe) }
256
256
  yield
257
257
  end
258
258
 
@@ -269,6 +269,13 @@ module ForkingTestRunner
269
269
  buffer
270
270
  end
271
271
 
272
+ # not tested via CI
273
+ def preserve_tty
274
+ was_tty = $stdout.tty?
275
+ yield
276
+ def $stdout.tty?; true; end if was_tty
277
+ end
278
+
272
279
  def run_test(file)
273
280
  stdout = change_program_name_to file do
274
281
  fork_with_captured_stdout do
@@ -340,7 +347,7 @@ module ForkingTestRunner
340
347
 
341
348
  if value
342
349
  minitest_class.autorun
343
- require(file.start_with?('/') ? file : "./#{file}")
350
+ load file
344
351
  end
345
352
  end
346
353
  end
@@ -1,3 +1,3 @@
1
1
  module ForkingTestRunner
2
- VERSION = "1.5.0"
2
+ VERSION = "1.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forking_test_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-02 00:00:00.000000000 Z
11
+ date: 2020-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel_tests
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.0.3
143
+ rubygems_version: 3.1.3
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Run every test in a fork to avoid pollution and get clean output per test