danger-jacoco-instacart 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardoc/checksums +2 -2
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/lib/jacoco/gem_version.rb +1 -1
- data/lib/jacoco/plugin.rb +15 -4
- data/spec/fixtures/output_a.xml +1 -1
- data/spec/fixtures/output_b.xml +0 -2
- data/spec/fixtures/output_c.xml +2 -2
- data/spec/fixtures/output_d.xml +35 -0
- data/spec/fixtures/output_e.xml +34 -0
- data/spec/fixtures/output_f.xml +33 -0
- data/spec/jacoco_spec.rb +30 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9fec5fb323f06e8bdffbfdc200b32801b1a74aaf596c374618afca9248326f1
|
4
|
+
data.tar.gz: 60d06a3074b5aa763632d8bd5661ebc82908cb514346e172b5d383d053d061ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d29d01cf0b2971a5fda3d26e7d82085b42853b852388d1ac84c284bc9856de86628d98d4f44b29e8bb68ccb9628c73a028271153cd8248551bb3e572f1be1ad
|
7
|
+
data.tar.gz: 02da2696139039613c08b30e576a2b2e512d8ce5770780e6e186af6fefff990c6030388b749d242932143da338c20b61bb12c1230cd13b0b91f6686650c4c2c4
|
data/.yardoc/checksums
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/danger_jacoco.rb 38229d934b3315bb2a5a4eec18eb65f3c54d304f
|
2
|
-
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/gem_version.rb
|
3
|
-
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/plugin.rb
|
2
|
+
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/gem_version.rb ed9d8db86045983fb4286a8695d1d67276512c90
|
3
|
+
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/plugin.rb 4d411eb29a16b42105f2775fd15d9ca0dc8e3093
|
4
4
|
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/sax_parser.rb 370e2799f8dbdf7d642c820214e6ea84c30c9cb0
|
5
5
|
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/model/counter.rb 368f4a9811617b7a174ddf837a8fac49a4bc32a6
|
6
6
|
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/model/report.rb 7cf45ee71ff347a130320f6190ddb25525c7095d
|
data/.yardoc/object_types
CHANGED
Binary file
|
data/.yardoc/objects/root.dat
CHANGED
Binary file
|
data/lib/jacoco/gem_version.rb
CHANGED
data/lib/jacoco/plugin.rb
CHANGED
@@ -184,10 +184,8 @@ module Danger
|
|
184
184
|
private
|
185
185
|
|
186
186
|
def coverage_counter(jacoco_class)
|
187
|
-
|
188
|
-
|
189
|
-
line_counter = counters.detect { |e| e.type.eql? 'LINE' }
|
190
|
-
counter = branch_counter.nil? ? line_counter : branch_counter
|
187
|
+
all_class_counters = jacoco_class.counters
|
188
|
+
counter = class_counter(all_class_counters)
|
191
189
|
|
192
190
|
if counter.nil?
|
193
191
|
no_coverage_data_found_message = "No coverage data found for #{jacoco_class.name}"
|
@@ -200,6 +198,19 @@ module Danger
|
|
200
198
|
counter
|
201
199
|
end
|
202
200
|
|
201
|
+
def class_counter(all_class_counters)
|
202
|
+
instruction_counter = all_class_counters.detect { |e| e.type.eql? 'INSTRUCTION' }
|
203
|
+
branch_counter = all_class_counters.detect { |e| e.type.eql? 'BRANCH' }
|
204
|
+
line_counter = all_class_counters.detect { |e| e.type.eql? 'LINE' }
|
205
|
+
if !instruction_counter.nil?
|
206
|
+
instruction_counter
|
207
|
+
elsif !branch_counter.nil?
|
208
|
+
branch_counter
|
209
|
+
else
|
210
|
+
line_counter
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
203
214
|
# rubocop:disable Style/SignalException
|
204
215
|
def report_fails(class_coverage_above_minimum, total_covered)
|
205
216
|
if total_covered[:covered] < minimum_project_coverage_percentage
|
data/spec/fixtures/output_a.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
<counter type="COMPLEXITY" missed="0" covered="1"/>
|
11
11
|
<counter type="METHOD" missed="0" covered="1"/>
|
12
12
|
</method>
|
13
|
-
<counter type="INSTRUCTION" missed="
|
13
|
+
<counter type="INSTRUCTION" missed="46" covered="46"/>
|
14
14
|
<counter type="LINE" missed="0" covered="14"/>
|
15
15
|
<counter type="COMPLEXITY" missed="5" covered="7"/>
|
16
16
|
<counter type="METHOD" missed="0" covered="7"/>
|
data/spec/fixtures/output_b.xml
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
<counter type="COMPLEXITY" missed="0" covered="1"/>
|
10
10
|
<counter type="METHOD" missed="0" covered="1"/>
|
11
11
|
</method>
|
12
|
-
<counter type="INSTRUCTION" missed="0" covered="46"/>
|
13
12
|
<counter type="COMPLEXITY" missed="5" covered="7"/>
|
14
13
|
<counter type="METHOD" missed="0" covered="7"/>
|
15
14
|
<counter type="CLASS" missed="0" covered="1"/>
|
@@ -17,7 +16,6 @@
|
|
17
16
|
<sourcefile name="CachedRepository.java">
|
18
17
|
<line nr="16" mi="0" ci="2" mb="0" cb="0"/>
|
19
18
|
<line nr="17" mi="0" ci="3" mb="0" cb="0"/>
|
20
|
-
<counter type="INSTRUCTION" missed="2" covered="98"/>
|
21
19
|
<counter type="COMPLEXITY" missed="2" covered="11"/>
|
22
20
|
<counter type="METHOD" missed="2" covered="11"/>
|
23
21
|
<counter type="CLASS" missed="2" covered="4"/>
|
data/spec/fixtures/output_c.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
<counter type="COMPLEXITY" missed="0" covered="1"/>
|
11
11
|
<counter type="METHOD" missed="0" covered="1"/>
|
12
12
|
</method>
|
13
|
-
<counter type="INSTRUCTION" missed="
|
13
|
+
<counter type="INSTRUCTION" missed="46" covered="46"/>
|
14
14
|
<counter type="LINE" missed="0" covered="14"/>
|
15
15
|
<counter type="COMPLEXITY" missed="5" covered="7"/>
|
16
16
|
<counter type="METHOD" missed="0" covered="7"/>
|
@@ -41,7 +41,7 @@
|
|
41
41
|
<counter type="COMPLEXITY" missed="0" covered="1"/>
|
42
42
|
<counter type="METHOD" missed="0" covered="1"/>
|
43
43
|
</method>
|
44
|
-
<counter type="INSTRUCTION" missed="
|
44
|
+
<counter type="INSTRUCTION" missed="18" covered="36"/>
|
45
45
|
<counter type="LINE" missed="0" covered="12"/>
|
46
46
|
<counter type="COMPLEXITY" missed="5" covered="8"/>
|
47
47
|
<counter type="METHOD" missed="0" covered="9"/>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN"
|
2
|
+
"report.dtd">
|
3
|
+
<report name="test_report">
|
4
|
+
<sessioninfo id="test-id" start="1480057517395" dump="1480057526412"/>
|
5
|
+
<package name="com/example">
|
6
|
+
<class name="com/example/CachedRepository">
|
7
|
+
<method name="<init>" desc="()V" line="17">
|
8
|
+
<counter type="INSTRUCTION" missed="0" covered="11"/>
|
9
|
+
<counter type="COMPLEXITY" missed="0" covered="1"/>
|
10
|
+
<counter type="METHOD" missed="0" covered="1"/>
|
11
|
+
</method>
|
12
|
+
<counter type="INSTRUCTION" missed="46" covered="118"/>
|
13
|
+
<counter type="LINE" missed="1" covered="14"/>
|
14
|
+
<counter type="COMPLEXITY" missed="5" covered="7"/>
|
15
|
+
<counter type="METHOD" missed="0" covered="7"/>
|
16
|
+
<counter type="CLASS" missed="0" covered="1"/>
|
17
|
+
<counter type="BRANCH" missed="2" covered="3" />
|
18
|
+
</class>
|
19
|
+
<sourcefile name="CachedRepository.java">
|
20
|
+
<line nr="16" mi="0" ci="2" mb="0" cb="0"/>
|
21
|
+
<line nr="17" mi="0" ci="3" mb="0" cb="0"/>
|
22
|
+
<counter type="COMPLEXITY" missed="2" covered="11"/>
|
23
|
+
<counter type="METHOD" missed="2" covered="11"/>
|
24
|
+
<counter type="CLASS" missed="2" covered="4"/>
|
25
|
+
</sourcefile>
|
26
|
+
<counter type="INSTRUCTION" missed="80" covered="324"/>
|
27
|
+
<counter type="COMPLEXITY" missed="11" covered="39"/>
|
28
|
+
<counter type="METHOD" missed="9" covered="37"/>
|
29
|
+
<counter type="CLASS" missed="2" covered="10"/>
|
30
|
+
</package>
|
31
|
+
<counter type="INSTRUCTION" missed="39399" covered="19321"/>
|
32
|
+
<counter type="COMPLEXITY" missed="5517" covered="1444"/>
|
33
|
+
<counter type="METHOD" missed="3382" covered="1120"/>
|
34
|
+
<counter type="CLASS" missed="491" covered="370"/>
|
35
|
+
</report>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN"
|
2
|
+
"report.dtd">
|
3
|
+
<report name="test_report">
|
4
|
+
<sessioninfo id="test-id" start="1480057517395" dump="1480057526412"/>
|
5
|
+
<package name="com/example">
|
6
|
+
<class name="com/example/CachedRepository">
|
7
|
+
<method name="<init>" desc="()V" line="17">
|
8
|
+
<counter type="INSTRUCTION" missed="0" covered="11"/>
|
9
|
+
<counter type="COMPLEXITY" missed="0" covered="1"/>
|
10
|
+
<counter type="METHOD" missed="0" covered="1"/>
|
11
|
+
</method>
|
12
|
+
<counter type="LINE" missed="1" covered="14"/>
|
13
|
+
<counter type="COMPLEXITY" missed="5" covered="7"/>
|
14
|
+
<counter type="METHOD" missed="0" covered="7"/>
|
15
|
+
<counter type="CLASS" missed="0" covered="1"/>
|
16
|
+
<counter type="BRANCH" missed="4" covered="3" />
|
17
|
+
</class>
|
18
|
+
<sourcefile name="CachedRepository.java">
|
19
|
+
<line nr="16" mi="0" ci="2" mb="0" cb="0"/>
|
20
|
+
<line nr="17" mi="0" ci="3" mb="0" cb="0"/>
|
21
|
+
<counter type="COMPLEXITY" missed="2" covered="11"/>
|
22
|
+
<counter type="METHOD" missed="2" covered="11"/>
|
23
|
+
<counter type="CLASS" missed="2" covered="4"/>
|
24
|
+
</sourcefile>
|
25
|
+
<counter type="INSTRUCTION" missed="80" covered="324"/>
|
26
|
+
<counter type="COMPLEXITY" missed="11" covered="39"/>
|
27
|
+
<counter type="METHOD" missed="9" covered="37"/>
|
28
|
+
<counter type="CLASS" missed="2" covered="10"/>
|
29
|
+
</package>
|
30
|
+
<counter type="INSTRUCTION" missed="39399" covered="19321"/>
|
31
|
+
<counter type="COMPLEXITY" missed="5517" covered="1444"/>
|
32
|
+
<counter type="METHOD" missed="3382" covered="1120"/>
|
33
|
+
<counter type="CLASS" missed="491" covered="370"/>
|
34
|
+
</report>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN"
|
2
|
+
"report.dtd">
|
3
|
+
<report name="test_report">
|
4
|
+
<sessioninfo id="test-id" start="1480057517395" dump="1480057526412"/>
|
5
|
+
<package name="com/example">
|
6
|
+
<class name="com/example/CachedRepository">
|
7
|
+
<method name="<init>" desc="()V" line="17">
|
8
|
+
<counter type="INSTRUCTION" missed="0" covered="11"/>
|
9
|
+
<counter type="COMPLEXITY" missed="0" covered="1"/>
|
10
|
+
<counter type="METHOD" missed="0" covered="1"/>
|
11
|
+
</method>
|
12
|
+
<counter type="LINE" missed="1" covered="14"/>
|
13
|
+
<counter type="COMPLEXITY" missed="5" covered="7"/>
|
14
|
+
<counter type="METHOD" missed="0" covered="7"/>
|
15
|
+
<counter type="CLASS" missed="0" covered="1"/>
|
16
|
+
</class>
|
17
|
+
<sourcefile name="CachedRepository.java">
|
18
|
+
<line nr="16" mi="0" ci="2" mb="0" cb="0"/>
|
19
|
+
<line nr="17" mi="0" ci="3" mb="0" cb="0"/>
|
20
|
+
<counter type="COMPLEXITY" missed="2" covered="11"/>
|
21
|
+
<counter type="METHOD" missed="2" covered="11"/>
|
22
|
+
<counter type="CLASS" missed="2" covered="4"/>
|
23
|
+
</sourcefile>
|
24
|
+
<counter type="INSTRUCTION" missed="80" covered="324"/>
|
25
|
+
<counter type="COMPLEXITY" missed="11" covered="39"/>
|
26
|
+
<counter type="METHOD" missed="9" covered="37"/>
|
27
|
+
<counter type="CLASS" missed="2" covered="10"/>
|
28
|
+
</package>
|
29
|
+
<counter type="INSTRUCTION" missed="39399" covered="19321"/>
|
30
|
+
<counter type="COMPLEXITY" missed="5517" covered="1444"/>
|
31
|
+
<counter type="METHOD" missed="3382" covered="1120"/>
|
32
|
+
<counter type="CLASS" missed="491" covered="370"/>
|
33
|
+
</report>
|
data/spec/jacoco_spec.rb
CHANGED
@@ -295,6 +295,36 @@ module Danger
|
|
295
295
|
|
296
296
|
expect(@dangerfile.status_report[:markdowns][0].message).to include('| New files | Covered | Required | Status |')
|
297
297
|
end
|
298
|
+
|
299
|
+
it 'instruction coverage takes over all the rest coverages for classes' do
|
300
|
+
path_a = "#{File.dirname(__FILE__)}/fixtures/output_d.xml"
|
301
|
+
|
302
|
+
@my_plugin.minimum_class_coverage_percentage = 50
|
303
|
+
|
304
|
+
@my_plugin.report path_a
|
305
|
+
|
306
|
+
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `com/example/CachedRepository` | 71% | 50% | :white_check_mark: |')
|
307
|
+
end
|
308
|
+
|
309
|
+
it 'branch coverage takes over line coverage for classes, when instruction coverage is not available' do
|
310
|
+
path_a = "#{File.dirname(__FILE__)}/fixtures/output_e.xml"
|
311
|
+
|
312
|
+
@my_plugin.minimum_class_coverage_percentage = 50
|
313
|
+
|
314
|
+
@my_plugin.report path_a
|
315
|
+
|
316
|
+
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `com/example/CachedRepository` | 42% | 50% | :warning: |')
|
317
|
+
end
|
318
|
+
|
319
|
+
it 'line coverage takes over for classes, when both instruction coverage and branch coverage are not available' do
|
320
|
+
path_a = "#{File.dirname(__FILE__)}/fixtures/output_f.xml"
|
321
|
+
|
322
|
+
@my_plugin.minimum_class_coverage_percentage = 50
|
323
|
+
|
324
|
+
@my_plugin.report path_a
|
325
|
+
|
326
|
+
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `com/example/CachedRepository` | 93% | 50% | :white_check_mark: |')
|
327
|
+
end
|
298
328
|
end
|
299
329
|
end
|
300
330
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-jacoco-instacart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Malinskiy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-08-
|
12
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: danger-plugin-api
|
@@ -208,6 +208,9 @@ files:
|
|
208
208
|
- spec/fixtures/output_a.xml
|
209
209
|
- spec/fixtures/output_b.xml
|
210
210
|
- spec/fixtures/output_c.xml
|
211
|
+
- spec/fixtures/output_d.xml
|
212
|
+
- spec/fixtures/output_e.xml
|
213
|
+
- spec/fixtures/output_f.xml
|
211
214
|
- spec/jacoco_spec.rb
|
212
215
|
- spec/spec_helper.rb
|
213
216
|
homepage: https://github.com/alexanderbezverhni/danger-jacoco
|
@@ -237,5 +240,8 @@ test_files:
|
|
237
240
|
- spec/fixtures/output_a.xml
|
238
241
|
- spec/fixtures/output_b.xml
|
239
242
|
- spec/fixtures/output_c.xml
|
243
|
+
- spec/fixtures/output_d.xml
|
244
|
+
- spec/fixtures/output_e.xml
|
245
|
+
- spec/fixtures/output_f.xml
|
240
246
|
- spec/jacoco_spec.rb
|
241
247
|
- spec/spec_helper.rb
|