Class: RSpecTracer::ReportMerger

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_tracer/report_merger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReportMerger

Returns a new instance of ReportMerger.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rspec_tracer/report_merger.rb', line 9

def initialize
  @last_run = {}
  @all_examples = {}
  @duplicate_examples = {}
  @interrupted_examples = Set.new
  @flaky_examples = Set.new
  @failed_examples = Set.new
  @pending_examples = Set.new
  @skipped_examples = Set.new
  @all_files = {}
  @dependency = Hash.new { |hash, key| hash[key] = Set.new }
  @reverse_dependency = {}
  @examples_coverage = {}
end

Instance Attribute Details

#all_examplesObject (readonly)

Returns the value of attribute all_examples.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def all_examples
  @all_examples
end

#all_filesObject (readonly)

Returns the value of attribute all_files.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def all_files
  @all_files
end

#dependencyObject (readonly)

Returns the value of attribute dependency.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def dependency
  @dependency
end

#duplicate_examplesObject (readonly)

Returns the value of attribute duplicate_examples.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def duplicate_examples
  @duplicate_examples
end

#examples_coverageObject (readonly)

Returns the value of attribute examples_coverage.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def examples_coverage
  @examples_coverage
end

#failed_examplesObject (readonly)

Returns the value of attribute failed_examples.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def failed_examples
  @failed_examples
end

#flaky_examplesObject (readonly)

Returns the value of attribute flaky_examples.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def flaky_examples
  @flaky_examples
end

#interrupted_examplesObject (readonly)

Returns the value of attribute interrupted_examples.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def interrupted_examples
  @interrupted_examples
end

#last_runObject (readonly)

Returns the value of attribute last_run.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def last_run
  @last_run
end

#pending_examplesObject (readonly)

Returns the value of attribute pending_examples.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def pending_examples
  @pending_examples
end

#reverse_dependencyObject (readonly)

Returns the value of attribute reverse_dependency.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def reverse_dependency
  @reverse_dependency
end

#skipped_examplesObject (readonly)

Returns the value of attribute skipped_examples.



5
6
7
# File 'lib/rspec_tracer/report_merger.rb', line 5

def skipped_examples
  @skipped_examples
end

Instance Method Details

#merge(reports_dir) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rspec_tracer/report_merger.rb', line 24

def merge(reports_dir)
  reports_dir.each do |report_dir|
    next unless File.directory?(report_dir)

    merge_cache(load_cache(report_dir))
    merge_last_run_report(File.dirname(report_dir))
  end

  @dependency.transform_values!(&:to_a)

  @reverse_dependency = RSpecTracer::ReportGenerator.new(self, nil).reverse_dependency_report
end