jason-o-matic-deep_test 1.2.2.6 → 1.2.2.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -32,11 +32,21 @@ module DeepTest
|
|
32
32
|
def read_results(result, tests_by_name)
|
33
33
|
DeepTest.logger.debug("SupervisedTestSuite: going to read #{tests_by_name.size} results")
|
34
34
|
|
35
|
+
result_times = {}
|
36
|
+
|
35
37
|
missing_tests =
|
36
38
|
ResultReader.new(@blackboard).read(tests_by_name) do |test, remote_result|
|
39
|
+
result_times["#{test.method_name}(#{test.class.name})"] = remote_result.time
|
37
40
|
remote_result.add_to result
|
38
41
|
yield ::Test::Unit::TestCase::FINISHED, test.name if block_given?
|
39
42
|
end
|
43
|
+
|
44
|
+
longest_test_name_size = result_times.keys.map(&:size).sort.last
|
45
|
+
if File.exist? "tmp"
|
46
|
+
File.open(File.join("tmp", "test_times.txt"), "w") do |file|
|
47
|
+
file.write result_times.sort_by {|n, t| t}.reverse.map {|n, t| n.ljust(longest_test_name_size + 1) + t.to_s.sub(/^(.*\.\d)\d.*/, '\1').rjust(9) + "\n"}.join
|
48
|
+
end
|
49
|
+
end
|
40
50
|
|
41
51
|
missing_tests.each do |name, test_case|
|
42
52
|
result.add_error ::Test::Unit::Error.new(name, WorkUnitNeverReceivedError.new)
|
data/lib/deep_test/worker.rb
CHANGED
@@ -13,11 +13,13 @@ module DeepTest
|
|
13
13
|
while work_unit = next_work_unit
|
14
14
|
@listener.starting_work(self, work_unit)
|
15
15
|
|
16
|
+
start_time = Time.now
|
16
17
|
result = begin
|
17
18
|
work_unit.run
|
18
19
|
rescue Exception => error
|
19
20
|
Error.new(work_unit, error)
|
20
21
|
end
|
22
|
+
result.time = Time.now - start_time
|
21
23
|
|
22
24
|
@listener.finished_work(self, work_unit, result)
|
23
25
|
@blackboard.write_result result
|