rspec-tracer 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/rspec_tracer/coverage_reporter.rb +7 -3
- data/lib/rspec_tracer/reporter.rb +9 -9
- data/lib/rspec_tracer/runner.rb +15 -5
- data/lib/rspec_tracer/version.rb +1 -1
- data/lib/rspec_tracer.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a86a9027964446fd10fc51379221d718e15699f6f93ba0c56af654273ccf632d
|
4
|
+
data.tar.gz: 1ade4a1b9a14b8cf0a10467889e0631d4b4e30871118734a6d2b4705138b19b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c251e47b35e667c0b847c54bb7a7c96ad33c39b8c91f48bcaf96c06cb9b017155ed760398f24e382ee93c94fe8bf7b40289fd9c87518bbd467d42b2bae91daac
|
7
|
+
data.tar.gz: a314d23f2b7998cb64b5183a5a0da4d1d100039accfd28998ccdf15d451f633fb4181688951de400bbaf82095253f56d73e585632e411657ada157d0e285a1b0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -71,7 +71,7 @@ integrating the gem into your project to better understand what is happening.
|
|
71
71
|
|
72
72
|
Add this line to your `Gemfile` and `bundle install`:
|
73
73
|
```ruby
|
74
|
-
gem 'rspec-tracer', group: :test, require: false
|
74
|
+
gem 'rspec-tracer', version: '~> 0.6', group: :test, require: false
|
75
75
|
```
|
76
76
|
|
77
77
|
And, add the followings to your `.gitignore`:
|
@@ -29,11 +29,15 @@ module RSpecTracer
|
|
29
29
|
|
30
30
|
def compute_diff(example_id)
|
31
31
|
peek_coverage.each_pair do |file_path, current_stats|
|
32
|
-
|
33
|
-
existing_file_diff_coverage(example_id, file_path, current_stats)
|
34
|
-
else
|
32
|
+
unless @coverage.key?(file_path)
|
35
33
|
missing_file_diff_coverage(example_id, file_path, current_stats)
|
34
|
+
|
35
|
+
next
|
36
36
|
end
|
37
|
+
|
38
|
+
next if current_stats == @coverage[file_path]
|
39
|
+
|
40
|
+
existing_file_diff_coverage(example_id, file_path, current_stats)
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
@@ -229,56 +229,56 @@ module RSpecTracer
|
|
229
229
|
def write_all_examples_report
|
230
230
|
file_name = File.join(@cache_dir, 'all_examples.json')
|
231
231
|
|
232
|
-
File.write(file_name, JSON.
|
232
|
+
File.write(file_name, JSON.pretty_generate(@all_examples))
|
233
233
|
end
|
234
234
|
|
235
235
|
def write_flaky_examples_report
|
236
236
|
file_name = File.join(@cache_dir, 'flaky_examples.json')
|
237
237
|
|
238
|
-
File.write(file_name, JSON.
|
238
|
+
File.write(file_name, JSON.pretty_generate(@flaky_examples.to_a))
|
239
239
|
end
|
240
240
|
|
241
241
|
def write_failed_examples_report
|
242
242
|
file_name = File.join(@cache_dir, 'failed_examples.json')
|
243
243
|
|
244
|
-
File.write(file_name, JSON.
|
244
|
+
File.write(file_name, JSON.pretty_generate(@failed_examples.to_a))
|
245
245
|
end
|
246
246
|
|
247
247
|
def write_pending_examples_report
|
248
248
|
file_name = File.join(@cache_dir, 'pending_examples.json')
|
249
249
|
|
250
|
-
File.write(file_name, JSON.
|
250
|
+
File.write(file_name, JSON.pretty_generate(@pending_examples.to_a))
|
251
251
|
end
|
252
252
|
|
253
253
|
def write_all_files_report
|
254
254
|
file_name = File.join(@cache_dir, 'all_files.json')
|
255
255
|
|
256
|
-
File.write(file_name, JSON.
|
256
|
+
File.write(file_name, JSON.pretty_generate(@all_files))
|
257
257
|
end
|
258
258
|
|
259
259
|
def write_dependency_report
|
260
260
|
file_name = File.join(@cache_dir, 'dependency.json')
|
261
261
|
|
262
|
-
File.write(file_name, JSON.
|
262
|
+
File.write(file_name, JSON.pretty_generate(@dependency))
|
263
263
|
end
|
264
264
|
|
265
265
|
def write_reverse_dependency_report
|
266
266
|
file_name = File.join(@cache_dir, 'reverse_dependency.json')
|
267
267
|
|
268
|
-
File.write(file_name, JSON.
|
268
|
+
File.write(file_name, JSON.pretty_generate(@reverse_dependency))
|
269
269
|
end
|
270
270
|
|
271
271
|
def write_examples_coverage_report
|
272
272
|
file_name = File.join(@cache_dir, 'examples_coverage.json')
|
273
273
|
|
274
|
-
File.write(file_name, JSON.
|
274
|
+
File.write(file_name, JSON.pretty_generate(@examples_coverage))
|
275
275
|
end
|
276
276
|
|
277
277
|
def write_last_run_report
|
278
278
|
file_name = File.join(RSpecTracer.cache_path, 'last_run.json')
|
279
279
|
last_run_data = @last_run.merge(run_id: @run_id, timestamp: Time.now.utc)
|
280
280
|
|
281
|
-
File.write(file_name, JSON.
|
281
|
+
File.write(file_name, JSON.pretty_generate(last_run_data))
|
282
282
|
end
|
283
283
|
end
|
284
284
|
end
|
data/lib/rspec_tracer/runner.rb
CHANGED
@@ -90,16 +90,15 @@ module RSpecTracer
|
|
90
90
|
# rubocop:enable Metrics/AbcSize
|
91
91
|
|
92
92
|
def register_dependency(examples_coverage)
|
93
|
+
filtered_files = Set.new
|
94
|
+
|
93
95
|
examples_coverage.each_pair do |example_id, example_coverage|
|
94
96
|
register_example_files_dependency(example_id)
|
95
97
|
|
96
98
|
example_coverage.each_key do |file_path|
|
97
|
-
|
98
|
-
|
99
|
-
next if RSpecTracer.filters.any? { |filter| filter.match?(source_file) }
|
99
|
+
next if filtered_files.include?(file_path)
|
100
100
|
|
101
|
-
|
102
|
-
@reporter.register_dependency(example_id, source_file[:file_name])
|
101
|
+
filtered_files << file_path unless register_file_dependency(example_id, file_path)
|
103
102
|
end
|
104
103
|
end
|
105
104
|
|
@@ -260,6 +259,17 @@ module RSpecTracer
|
|
260
259
|
@reporter.register_dependency(example_id, file_name)
|
261
260
|
end
|
262
261
|
|
262
|
+
def register_file_dependency(example_id, file_path)
|
263
|
+
source_file = RSpecTracer::SourceFile.from_path(file_path)
|
264
|
+
|
265
|
+
return false if RSpecTracer.filters.any? { |filter| filter.match?(source_file) }
|
266
|
+
|
267
|
+
@reporter.register_source_file(source_file)
|
268
|
+
@reporter.register_dependency(example_id, source_file[:file_name])
|
269
|
+
|
270
|
+
true
|
271
|
+
end
|
272
|
+
|
263
273
|
def generate_examples_status_report
|
264
274
|
starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
265
275
|
|
data/lib/rspec_tracer/version.rb
CHANGED
data/lib/rspec_tracer.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-tracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abhimanyu Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docile
|
@@ -107,7 +107,7 @@ licenses:
|
|
107
107
|
- MIT
|
108
108
|
metadata:
|
109
109
|
homepage_uri: https://github.com/avmnu-sng/rspec-tracer
|
110
|
-
source_code_uri: https://github.com/avmnu-sng/rspec-tracer/tree/v0.6.
|
110
|
+
source_code_uri: https://github.com/avmnu-sng/rspec-tracer/tree/v0.6.2
|
111
111
|
changelog_uri: https://github.com/avmnu-sng/rspec-tracer/blob/main/CHANGELOG.md
|
112
112
|
bug_tracker_uri: https://github.com/avmnu-sng/rspec-tracer/issues
|
113
113
|
post_install_message:
|