forking_test_runner 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/forking_test_runner/version.rb +1 -1
- data/lib/forking_test_runner.rb +15 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b60ad12f5e9ca46633a91e12106f4fd6e00bb161
|
4
|
+
data.tar.gz: 453d510148cd579c234ed2d136f59fe6dbab7770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4c72f64b34403c193e2fca528ef30e9f7de3afd4a2176148649ba033fe6e76ba49c87a4800f7b99af1459409b925147c086e1d7c6e576d83b16b95ef35a1f23
|
7
|
+
data.tar.gz: b7fe40d180eabde2317abbf720e0f944e5b4fa94792c11c76225c6d89c328d2768a24c6db0b35c7f761d69bb8ff30dbaa4d2b422106de7318ac92a7e36e98b38
|
data/lib/forking_test_runner.rb
CHANGED
@@ -137,16 +137,25 @@ module ForkingTestRunner
|
|
137
137
|
def run_test(file)
|
138
138
|
preload_fixtures
|
139
139
|
ActiveRecord::Base.connection.disconnect!
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
140
|
+
change_program_name_to file do
|
141
|
+
child = fork do
|
142
|
+
key = (ActiveRecord::VERSION::STRING >= "4.1.0" ? :test : "test")
|
143
|
+
ActiveRecord::Base.establish_connection key
|
144
|
+
enable_minitest_autorun
|
145
|
+
require "./#{file}"
|
146
|
+
end
|
147
|
+
Process.wait(child)
|
145
148
|
end
|
146
|
-
Process.wait(child)
|
147
149
|
$?.success?
|
148
150
|
end
|
149
151
|
|
152
|
+
def change_program_name_to(name)
|
153
|
+
old, $0 = $0, name
|
154
|
+
yield
|
155
|
+
ensure
|
156
|
+
$0 = old
|
157
|
+
end
|
158
|
+
|
150
159
|
def find_tests_for_group(group, group_count, tests, runtime_log)
|
151
160
|
require 'parallel_tests/test/runner'
|
152
161
|
|
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: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel_tests
|