parallelized_specs 0.4.65 → 0.4.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/parallelized_specs.rb +1 -1
- data/lib/parallelized_specs/selenium_trending_collector.rb +15 -11
- data/lib/parallelized_specs/slow_spec_logger.rb +14 -13
- data/lib/parallelized_specs/trending_example_failures_logger.rb +34 -18
- data/parallelized_specs.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ begin
|
|
12
12
|
gem.email = "jake@instructure.com"
|
13
13
|
gem.homepage = "http://github.com/jakesorce/#{gem.name}"
|
14
14
|
gem.authors = "Jake Sorce, Bryan Madsen, Shawn Meredith"
|
15
|
-
gem.version = "0.4.
|
15
|
+
gem.version = "0.4.66"
|
16
16
|
end
|
17
17
|
Jeweler::GemcutterTasks.new
|
18
18
|
rescue LoadError
|
data/lib/parallelized_specs.rb
CHANGED
@@ -385,7 +385,7 @@ class ParallelizedSpecs
|
|
385
385
|
puts "INFO: #{spec} will be ran and marked as a success if it passes"
|
386
386
|
@examples = 0
|
387
387
|
@failures = 0
|
388
|
-
result = %x[bundle exec rake spec #{spec}]
|
388
|
+
result = %x[export DISPLAY=:2.0 firefox && bundle exec rake spec #{spec}]
|
389
389
|
parse_result(result)
|
390
390
|
result
|
391
391
|
end
|
@@ -11,6 +11,7 @@ ActiveRecord::Base.establish_connection(
|
|
11
11
|
:password => 'youtpass'
|
12
12
|
)
|
13
13
|
|
14
|
+
|
14
15
|
class SeleniumTrend < ActiveRecord::Base
|
15
16
|
ActiveRecord::Migration.class_eval do
|
16
17
|
unless SeleniumTrend.table_exists?
|
@@ -23,7 +24,9 @@ class SeleniumTrend < ActiveRecord::Base
|
|
23
24
|
t.string :nested_spec_name
|
24
25
|
t.string :trace
|
25
26
|
t.string :full_path
|
26
|
-
t.
|
27
|
+
t.string :time
|
28
|
+
t.string :status
|
29
|
+
t.date :date
|
27
30
|
end
|
28
31
|
end
|
29
32
|
end
|
@@ -34,20 +37,21 @@ def store_failure_data
|
|
34
37
|
data = "#{dir}/tmp/parallel_log/trends.log"
|
35
38
|
File.open("#{data}", 'r') do |f|
|
36
39
|
f.each_line do |line|
|
37
|
-
values = line.split("*").to_a
|
38
|
-
|
39
40
|
if values != nil
|
41
|
+
values = line.split("*").to_a
|
40
42
|
spec_line_failure = values[0]
|
41
43
|
spec_name = values[1]
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
date = values[2]
|
45
|
+
status = values[3]
|
46
|
+
time = values[4]
|
47
|
+
nested_spec_name = values[5]
|
48
|
+
trace = values[6]
|
49
|
+
full_path = values[7]
|
50
|
+
hudson_build = values[9]
|
51
|
+
hudson_project = values[10]
|
52
|
+
hudson_url = values[11]
|
49
53
|
|
50
|
-
SeleniumTrend.create!(:spec_line_failure => spec_line_failure, :spec_name => spec_name, :nested_spec_name => nested_spec_name, :trace => trace, :full_path => full_path, :
|
54
|
+
SeleniumTrend.create!(:spec_line_failure => spec_line_failure, :spec_name => spec_name, :date => date, :status => status, :time => time, :nested_spec_name => nested_spec_name, :trace => trace, :full_path => full_path, :hudson_build => hudson_build, :hudson_project => hudson_project, :hudson_url => hudson_url)
|
51
55
|
end
|
52
56
|
end
|
53
57
|
end
|
@@ -1,34 +1,35 @@
|
|
1
1
|
require 'parallelized_specs'
|
2
2
|
|
3
3
|
module RSpec
|
4
|
-
|
5
|
-
|
6
4
|
class ParallelizedSpecs::SlowestSpecLogger < ParallelizedSpecs::SpecLoggerBase
|
7
5
|
|
6
|
+
def initialize
|
7
|
+
@examples = []
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
8
11
|
def example_started(example)
|
9
12
|
@spec_start_time = Time.now
|
10
13
|
end
|
11
14
|
|
12
15
|
def example_passed(example)
|
13
|
-
|
14
|
-
write_total_spec_time(total_time, example)
|
16
|
+
add_total_spec_time(example)
|
15
17
|
end
|
16
18
|
|
17
19
|
def example_failed(example, count, failure)
|
18
|
-
|
19
|
-
write_total_spec_time(total_time, example)
|
20
|
+
add_total_spec_time(example)
|
20
21
|
end
|
21
22
|
|
22
|
-
def
|
23
|
-
total_time = Time.now - spec_start_time
|
24
|
-
total_time
|
25
|
-
end
|
26
|
-
|
27
|
-
def write_total_spec_time(total_time, example)
|
23
|
+
def dump_summary
|
28
24
|
lock_output do
|
29
|
-
@output.puts "#{
|
25
|
+
@examples.each { |example| @output.puts "#{example}" }
|
30
26
|
end
|
31
27
|
@output.flush
|
32
28
|
end
|
29
|
+
|
30
|
+
def add_total_spec_time(example)
|
31
|
+
total_time = Time.now - @spec_start_time
|
32
|
+
@examples << "#{total_time}*#{example.description}*#{example_group.location}"
|
33
|
+
end
|
33
34
|
end
|
34
35
|
end
|
@@ -2,34 +2,50 @@ require 'parallelized_specs/spec_logger_base'
|
|
2
2
|
|
3
3
|
class ParallelizedSpecs::TrendingExampleFailures < ParallelizedSpecs::SpecLoggerBase
|
4
4
|
|
5
|
+
def initialize
|
6
|
+
@passed_examples = {}
|
7
|
+
@failed_examples = {}
|
8
|
+
@pending_examples = {}
|
9
|
+
@hudson_build_info = File.read("#{Rails.root}/spec/build_info.txt")
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def example_started(example)
|
14
|
+
@spec_start_time = Time.now
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
5
18
|
def example_failed(example, counter, failure)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
@failed_examples["#{example.location.match(/spec.*\d/).to_s}*"] = ["#{example.description}*", "#{failure.header}*", "#{failure.exception.to_s.gsub(/\n/,"")}*", "#{failure.exception.backtrace.to_s.gsub(/\n/,"")}*", "#{Date.today}*"]
|
10
|
-
end
|
19
|
+
total_time = Time.now - @spec_start_time
|
20
|
+
if example.location != nil
|
21
|
+
@failed_examples["#{example.location.match(/spec.*\d/).to_s}*"] = ["#{example.description}*", "#{Date.today}*", "failed*", "#{total_time}*", "#{failure.header}*", "#{failure.exception.to_s.gsub(/\n/, "")}*", "#{failure.exception.backtrace.to_s.gsub(/\n/)}*"]
|
11
22
|
end
|
12
23
|
end
|
13
24
|
|
14
|
-
def
|
25
|
+
def example_passed(example, counter)
|
26
|
+
total_time = Time.now - @spec_start_time
|
27
|
+
if example.location != nil
|
28
|
+
@passed_examples["#{example.location.match(/spec.*\d/).to_s}*"] = ["#{example.description}*", "#{Date.today}*", "passed*", "#{total_time}*","NA*","NA*","NA*"]
|
29
|
+
end
|
30
|
+
end
|
15
31
|
|
16
|
-
def dump_failures(*args);end
|
17
32
|
|
18
|
-
def
|
33
|
+
def example_pending(example, counter)
|
34
|
+
total_time = Time.now - @spec_start_time
|
35
|
+
if example.location != nil
|
36
|
+
@pending_examples["#{example.location.match(/spec.*\d/).to_s}*"] = ["#{example.description}*", "#{Date.today}*", "pending*", "#{total_time}*","NA*","NA*","NA*"]
|
37
|
+
end
|
38
|
+
end
|
19
39
|
|
20
|
-
def dump_pending(*args);end
|
21
40
|
|
22
41
|
def dump_summary(*args)
|
23
|
-
|
24
|
-
if File.exists?("#{Rails.root}/spec/build_info.txt")
|
25
|
-
@hudson_build_info = File.read("#{Rails.root}/spec/build_info.txt")
|
26
|
-
else
|
27
|
-
@hudson_build_info = "no*hudson build*info"
|
28
|
-
end
|
29
|
-
|
30
42
|
lock_output do
|
31
|
-
|
32
|
-
|
43
|
+
[@failed_examples, @passed_examples, @pending_examples].each do | example_results |
|
44
|
+
unless example_results.empty?
|
45
|
+
(example_results).each_pair do |example, details|
|
46
|
+
@output.puts "#{example}#{details}#{@hudson_build_info}"
|
47
|
+
end
|
48
|
+
end
|
33
49
|
end
|
34
50
|
@output.flush
|
35
51
|
end
|
data/parallelized_specs.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "parallelized_specs"
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.66"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jake Sorce, Bryan Madsen, Shawn Meredith"]
|