parallel_tests 0.15.1 → 0.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Readme.md +1 -0
- data/lib/parallel_tests/tasks.rb +7 -4
- data/lib/parallel_tests/version.rb +1 -1
- data/spec/parallel_tests/tasks_spec.rb +10 -0
- 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: b06b8b7a06a62107496d979771375e1ae39b260f
|
4
|
+
data.tar.gz: 4bd2bb9780dd04d4aeb42d0e12676594036b544c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a1193b83e575ea49b19d3dd6a327abfaeedca05e86f86304e575501ed7672cce923202cc931b0875c87d2c786d1b71d1c1f98fee86014c82bef90060c68b75b
|
7
|
+
data.tar.gz: 71435234ad10665421a4cf07e6fafcc45ba8c9fbee3f021a564c67386e1ec901b8f2369763475e544f1861db492aa6faf6e0144d7a5d19ce742e5d07678e4972
|
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -290,6 +290,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
|
|
290
290
|
- [Felix Clack](https://github.com/felixclack)
|
291
291
|
- [Izaak Alpert](https://github.com/karlhungus)
|
292
292
|
- [Micah Geisel](https://github.com/botandrose)
|
293
|
+
- [Exoth](https://github.com/Exoth)
|
293
294
|
|
294
295
|
[Michael Grosser](http://grosser.it)<br/>
|
295
296
|
michael@grosser.it<br/>
|
data/lib/parallel_tests/tasks.rb
CHANGED
@@ -38,9 +38,11 @@ module ParallelTests
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def check_for_pending_migrations
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
["db:abort_if_pending_migrations", "app:db:abort_if_pending_migrations"].each do |abort_migrations|
|
42
|
+
if Rake::Task.task_defined?(abort_migrations)
|
43
|
+
Rake::Task[abort_migrations].invoke
|
44
|
+
break
|
45
|
+
end
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|
@@ -84,7 +86,8 @@ namespace :parallel do
|
|
84
86
|
else
|
85
87
|
# there is no separate dump / load for schema_format :sql -> do it safe and slow
|
86
88
|
args = args.to_hash.merge(:non_parallel => true) # normal merge returns nil
|
87
|
-
|
89
|
+
taskname = Rake::Task.task_defined?('db:test:prepare') ? 'db:test:prepare' : 'app:db:test:prepare'
|
90
|
+
ParallelTests::Tasks.run_in_parallel("rake #{taskname} --trace", args)
|
88
91
|
end
|
89
92
|
end
|
90
93
|
|
@@ -123,6 +123,7 @@ describe ParallelTests::Tasks do
|
|
123
123
|
describe ".check_for_pending_migrations" do
|
124
124
|
after do
|
125
125
|
Rake.application.instance_variable_get('@tasks').delete("db:abort_if_pending_migrations")
|
126
|
+
Rake.application.instance_variable_get('@tasks').delete("app:db:abort_if_pending_migrations")
|
126
127
|
end
|
127
128
|
|
128
129
|
it "should do nothing if pending migrations is no defined" do
|
@@ -138,6 +139,15 @@ describe ParallelTests::Tasks do
|
|
138
139
|
foo.should == 2
|
139
140
|
end
|
140
141
|
|
142
|
+
it "should run pending migrations is app task is defined" do
|
143
|
+
foo = 1
|
144
|
+
Rake::Task.define_task("app:db:abort_if_pending_migrations") do
|
145
|
+
foo = 2
|
146
|
+
end
|
147
|
+
ParallelTests::Tasks.check_for_pending_migrations
|
148
|
+
foo.should == 2
|
149
|
+
end
|
150
|
+
|
141
151
|
it "should not execute the task twice" do
|
142
152
|
foo = 1
|
143
153
|
Rake::Task.define_task("db:abort_if_pending_migrations") do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_tests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|