minitest-parallel_fork 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: eba31fcb9f0832fd81e818423d5f628ea679bd2f
4
- data.tar.gz: bf91180a0b69834f62519d1ada73fd1ce790fa98
3
+ metadata.gz: 42f6c6919472888f0ad2799def6d83c39bf69ab6
4
+ data.tar.gz: e4fe5385b3e8682001470c2c6891bc8eadb49696
5
5
  SHA512:
6
- metadata.gz: 364efbc3cff8e3e9b609b1fb8685c19866b8ce074f542edc1ef6c6cd78dd8be91aa14aba5d7bd4ba89ac612519f87e99930df776e0bdbf529a523c75fb3545b1
7
- data.tar.gz: 76cd985717baf5d01b7ef92a3c3e0800dc6c186be4e61f757d4f15d4bf1e82a11acd72740cfc5fde302d4749ada3aa67eee9cd5da9698ff9601952cb7ff40451
6
+ metadata.gz: 007440c55981f82d53333b49efc3ca47609eed8ad9e7601fb215b125cabe4b8d809181a97b4f467e3f87a97373907dc169401de53f8b547711c9408f67842536
7
+ data.tar.gz: 80d30b6fde62eaec6ca63ab203890a19a564243677b7bc9fa5ca01ac56a741c95f79b3dfb484d6b8abb52c2a64b35e7b1a2bb6e546a2dba94bf3ff0a434e8f2b
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.0.2 (2017-02-27)
2
+
3
+ * Show correct number of errors in output (jeremyevans)
4
+
1
5
  === 1.0.1 (2017-01-05)
2
6
 
3
7
  * Work with test suites that use parallelize_me! (jeremyevans) (#1)
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 Jeremy Evans
1
+ Copyright (c) 2015,2017 Jeremy Evans
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to
@@ -59,6 +59,20 @@ disconnecting, and after forking, the database name is changed in each child to
59
59
  a child-specific database, so that the child processes do not share a database and are
60
60
  thus independent.
61
61
 
62
+ == ActiveRecord
63
+
64
+ To use this with Rails/ActiveRecord, you probably want to use hooks similar to:
65
+
66
+ Minitest.before_parallel_fork do
67
+ ActiveRecord::Base.connection.disconnect!
68
+ end
69
+
70
+ Minitest.after_parallel_fork do |i|
71
+ db_config = Rails.application.config.database_configuration[Rails.env].clone
72
+ db_config['database'] += (i+1).to_s
73
+ ActiveRecord::Base.establish_connection(db_config)
74
+ end
75
+
62
76
  = Speedup
63
77
 
64
78
  The speedup you get greatly depends on your specs. Here's some examples using Sequel's
@@ -91,7 +91,7 @@ module Minitest
91
91
  stat_reporter.assertions += assertions
92
92
  results.map! do |name, failures|
93
93
  runnable = Test.new(name)
94
- runnable.failures.concat(failures)
94
+ runnable.failures.concat(failures.map{|f| f.is_a?(DumpableUnexpectedError) ? UnexpectedError.new(f) : f})
95
95
  runnable
96
96
  end
97
97
  stat_reporter.results.concat(results)
@@ -25,5 +25,17 @@ end
25
25
  it "should work" do
26
26
  sleep(1).must_equal 1
27
27
  end
28
+
29
+ it "should fail" do
30
+ 1.must_equal 2
31
+ end
32
+
33
+ it "should raise" do
34
+ raise
35
+ end
36
+
37
+ it "should skip" do
38
+ skip
39
+ end
28
40
  end
29
41
  end
@@ -17,6 +17,7 @@ describe 'minitest/parallel_fork' do
17
17
  time.must_be :<, 4
18
18
  time.must_be :>, 1
19
19
  output.must_match /:parent/
20
+ output.must_match /16 runs, 8 assertions, 4 failures, 4 errors, 4 skips/
20
21
  4.times do |i|
21
22
  output.must_match /:child#{i}a/
22
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-parallel_fork
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-05 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest