jason-o-matic-deep_test 1.2.2.8 → 1.2.2.9
Sign up to get free protection for your applications and to get access to all the features.
data/lib/deep_test/option.rb
CHANGED
data/lib/deep_test/options.rb
CHANGED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'test/unit/collector/objectspace'
|
2
|
+
module DeepTest
|
3
|
+
module Test
|
4
|
+
module Collector
|
5
|
+
|
6
|
+
# This allows us to run tests in a similar order to how rails normal runs them
|
7
|
+
# (i.e. units, functionals, integration) without having to mintain the test file
|
8
|
+
# loading order and passing it down the line somehow.
|
9
|
+
class RailsOrderedObjectSpace < ::Test::Unit::Collector::ObjectSpace
|
10
|
+
|
11
|
+
# this is like ::Test::Unit::AutoRunner::COLLECTORS[:objectspace] in standard Test::Unit
|
12
|
+
::Test::Unit::AutoRunner::COLLECTORS[:rails_ordered_objectspace] = proc do |r|
|
13
|
+
c = DeepTest::Test::Collector::RailsOrderedObjectSpace.new
|
14
|
+
c.filter = r.filters
|
15
|
+
c.collect($0.sub(/\.rb\Z/, ''))
|
16
|
+
end
|
17
|
+
|
18
|
+
def sort(suites)
|
19
|
+
done = int = filter_and_sort_suites(suites, ActionController::IntegrationTest)
|
20
|
+
done += func = filter_and_sort_suites(suites - done, ActionController::TestCase)
|
21
|
+
done += others = filter_and_sort_suites(suites - done, ::Test::Unit::TestCase)
|
22
|
+
|
23
|
+
ordered = others + func + int
|
24
|
+
if ordered.size == suites.size
|
25
|
+
ordered
|
26
|
+
else
|
27
|
+
oddballs = suites - ordered
|
28
|
+
|
29
|
+
warn <<-STR
|
30
|
+
|
31
|
+
WARNING:
|
32
|
+
Deep Test isn\'t sure it has preserved the standard test running order.
|
33
|
+
Tests that aren\'t of the standard rails unit, functional, or integration
|
34
|
+
classes will be run after those that are.
|
35
|
+
|
36
|
+
The #{oddballs.uniq.size} oddballs are of classes: #{oddballs.map(&:name).uniq.inspect}
|
37
|
+
|
38
|
+
oddballs:
|
39
|
+
#{oddballs.inspect}
|
40
|
+
|
41
|
+
STR
|
42
|
+
ordered + oddballs
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def filter_and_sort_suites(suites, klass)
|
47
|
+
suites.select {|s| s.name.constantize < klass}.sort_by {|s| suite_to_filename(s)}
|
48
|
+
end
|
49
|
+
|
50
|
+
def suite_to_filename(s)
|
51
|
+
s.name.underscore + ".rb"
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -13,12 +13,14 @@ module DeepTest
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def process_work_units(server)
|
16
|
-
suite = ::Test::Unit::AutoRunner::COLLECTORS[
|
16
|
+
suite = ::Test::Unit::AutoRunner::COLLECTORS[@options.test_collector].call NO_FILTERS
|
17
17
|
supervised_suite = DeepTest::Test::SupervisedTestSuite.new(suite, server)
|
18
18
|
require 'test/unit/ui/console/testrunner'
|
19
19
|
result = ::Test::Unit::UI::Console::TestRunner.run(supervised_suite, ::Test::Unit::UI::NORMAL)
|
20
20
|
result.passed?
|
21
21
|
end
|
22
|
+
|
23
|
+
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
data/lib/deep_test.rb
CHANGED
@@ -90,3 +90,4 @@ require File.dirname(__FILE__) + "/deep_test/ui/console"
|
|
90
90
|
require File.dirname(__FILE__) + "/deep_test/ui/null"
|
91
91
|
|
92
92
|
require File.expand_path(File.dirname(__FILE__) + "/deep_test/drbfire.rb")
|
93
|
+
require File.expand_path(File.dirname(__FILE__) + "/deep_test/test/collector/rails_ordered_object_space.rb")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jason-o-matic-deep_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.2.
|
4
|
+
version: 1.2.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anonymous z, Dan Manges, David Vollbracht
|
@@ -23,6 +23,7 @@ extra_rdoc_files:
|
|
23
23
|
- README.rdoc
|
24
24
|
- CHANGELOG
|
25
25
|
files:
|
26
|
+
- lib/deep_test/test/collector/rails_ordered_object_space.rb
|
26
27
|
- lib/deep_test/drbfire.rb
|
27
28
|
- lib/deep_test/database/mysql_setup_listener.rb
|
28
29
|
- lib/deep_test/database/setup_listener.rb
|