danger-jacoco 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jacoco/gem_version.rb +1 -1
- data/lib/jacoco/plugin.rb +11 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 371b0dde165ac428614147067f7e6afb770a5612
|
4
|
+
data.tar.gz: 8ca1e6cdcee1c395c4627c6a41254ea80b64a43c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d216754af4136b642921a1bae373a437e97cf0f99326be3260d8b77bfa02aa94735eab6077f0cc1721d57e2fea6e917f7c6effec83c4cfe94d1f04f9650ec411
|
7
|
+
data.tar.gz: 02f1ffc71d5eac688733f5165f6cf9152df4542d4f29d2f3ad20b3ddb635b964f9bf05124c211998fe75073cd625fb01506dde6600d36280510e3003246946dd
|
data/lib/jacoco/gem_version.rb
CHANGED
data/lib/jacoco/plugin.rb
CHANGED
@@ -69,10 +69,7 @@ module Danger
|
|
69
69
|
|
70
70
|
# It returns a specific class code coverage and an emoji status as well
|
71
71
|
def report_class(jacoco_class)
|
72
|
-
|
73
|
-
branch_counter = counters.detect { |e| e.type.eql? 'BRANCH' }
|
74
|
-
line_counter = counters.detect { |e| e.type.eql? 'LINE' }
|
75
|
-
counter = branch_counter.nil? ? line_counter : branch_counter
|
72
|
+
counter = coverage_counter(jacoco_class)
|
76
73
|
coverage = (counter.covered.fdiv(counter.covered + counter.missed) * 100).floor
|
77
74
|
status = coverage_status(coverage, minimum_class_coverage_percentage)
|
78
75
|
|
@@ -109,6 +106,16 @@ module Danger
|
|
109
106
|
|
110
107
|
private
|
111
108
|
|
109
|
+
def coverage_counter(jacoco_class)
|
110
|
+
counters = jacoco_class.counters
|
111
|
+
branch_counter = counters.detect { |e| e.type.eql? 'BRANCH' }
|
112
|
+
line_counter = counters.detect { |e| e.type.eql? 'LINE' }
|
113
|
+
counter = branch_counter.nil? ? line_counter : branch_counter
|
114
|
+
raise "No coverage data found for #{jacoco_class.name}" if counter.nil?
|
115
|
+
|
116
|
+
counter
|
117
|
+
end
|
118
|
+
|
112
119
|
# rubocop:disable Style/SignalException
|
113
120
|
def report_fails(class_coverage_above_minimum, total_covered)
|
114
121
|
if total_covered[:covered] < minimum_project_coverage_percentage
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-jacoco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Malinskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|