danger-jacoco-instacart 0.1.12 → 0.1.13.SNAPSHOT.1
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.
- 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 -8
- data/spec/jacoco_spec.rb +59 -36
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f29acbe4cffe4ddeae3ab9f829a1dc5310da2f837aa8afd313d3cd16ddd63ad6
|
4
|
+
data.tar.gz: f74387bb9bb4307342e9baff55c011d52d2e06281bf86decfbd858f6962854f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 591ee3b4094f83a2f69e152b4d5f956a1402f3ee84c932287389aa017065743c3e88017c1979b043044e6961991be05da0ca6ad74ad26f13c726ef14ea24eae3
|
7
|
+
data.tar.gz: 130a3e11af52b5598603edeed78e57a6039528e7bf38f7cebdd9b8427cbf7d83f3654c572a17a89e1b5329d343a59e7f1cb22a9e7df18c04e097bd4f9cf368b3
|
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 8f31621c2d22f454fcaacb2640694c9c6e7f1fb8
|
3
|
+
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/plugin.rb e0262efb6d2458fa4ad4e2138c1f8a10fb11a1de
|
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
@@ -21,16 +21,17 @@ module Danger
|
|
21
21
|
#
|
22
22
|
class DangerJacoco < Plugin # rubocop:disable Metrics/ClassLength
|
23
23
|
attr_accessor :minimum_project_coverage_percentage, :minimum_class_coverage_percentage,
|
24
|
-
:minimum_composable_class_coverage_percentage, :
|
24
|
+
:minimum_composable_class_coverage_percentage, :files_to_check, :files_extension,
|
25
25
|
:minimum_package_coverage_map, :minimum_class_coverage_map, :fail_no_coverage_data_found,
|
26
|
-
:title, :class_column_title, :subtitle_success, :subtitle_failure
|
26
|
+
:title, :class_column_title, :subtitle_success, :subtitle_failure, :file_to_create_on_failure
|
27
27
|
|
28
28
|
# Initialize the plugin with configured parameters or defaults
|
29
29
|
def setup
|
30
30
|
setup_minimum_coverages
|
31
31
|
setup_texts
|
32
|
-
@
|
32
|
+
@files_to_check = [] unless files_to_check
|
33
33
|
@files_extension = ['.kt', '.java'] unless files_extension
|
34
|
+
@file_to_create_on_failure = 'danger_jacoco_failure_status_file.txt' unless file_to_create_on_failure
|
34
35
|
end
|
35
36
|
|
36
37
|
# Initialize the plugin with configured optional texts
|
@@ -102,13 +103,9 @@ module Danger
|
|
102
103
|
end
|
103
104
|
# rubocop:enable Style/AbcSize
|
104
105
|
|
105
|
-
# Select either only added files or modified and added files in this PR,
|
106
|
-
# depending on "only_check_new_files" attribute
|
107
106
|
def classes(delimiter)
|
108
|
-
git = @dangerfile.git
|
109
|
-
affected_files = only_check_new_files ? git.added_files : git.added_files + git.modified_files
|
110
107
|
class_to_file_path_hash = {}
|
111
|
-
|
108
|
+
files_to_check.select { |file| files_extension.reduce(false) { |state, el| state || file.end_with?(el) } }
|
112
109
|
.each do |file| # "src/java/com/example/CachedRepository.java"
|
113
110
|
classname = file.split('.').first.split(delimiter)[1] # "com/example/CachedRepository"
|
114
111
|
class_to_file_path_hash[classname] = file
|
@@ -231,14 +228,24 @@ module Danger
|
|
231
228
|
# fail danger if total coverage is smaller than minimum_project_coverage_percentage
|
232
229
|
covered = total_covered[:covered]
|
233
230
|
fail("Total coverage of #{covered}%. Improve this to at least #{minimum_project_coverage_percentage}%")
|
231
|
+
# rubocop:disable Lint/UnreachableCode (rubocop mistakenly thinks that this line is unreachable since priorly called "fail" raises an error, but in fact "fail" is caught and handled)
|
232
|
+
create_status_file_on_failure if class_coverage_above_minimum
|
233
|
+
# rubocop:enable Lint/UnreachableCode
|
234
234
|
end
|
235
235
|
|
236
236
|
return if class_coverage_above_minimum
|
237
237
|
|
238
238
|
fail("Class coverage is below minimum. Improve to at least #{minimum_class_coverage_percentage}%")
|
239
|
+
# rubocop:disable Lint/UnreachableCode (rubocop mistakenly thinks that this line is unreachable since priorly called "fail" raises an error, but in fact "fail" is caught and handled)
|
240
|
+
create_status_file_on_failure
|
241
|
+
# rubocop:enable Lint/UnreachableCode
|
239
242
|
end
|
240
243
|
# rubocop:enable Style/SignalException
|
241
244
|
|
245
|
+
def create_status_file_on_failure
|
246
|
+
File.open(file_to_create_on_failure, 'w') {}
|
247
|
+
end
|
248
|
+
|
242
249
|
def markdown_class(parser, report_markdown, report_url, class_to_file_path_hash)
|
243
250
|
class_coverage_above_minimum = true
|
244
251
|
parser.classes.each do |jacoco_class| # Check metrics for each classes
|
data/spec/jacoco_spec.rb
CHANGED
@@ -20,16 +20,13 @@ module Danger
|
|
20
20
|
@dangerfile = testing_dangerfile
|
21
21
|
@my_plugin = @dangerfile.jacoco
|
22
22
|
|
23
|
-
|
24
|
-
added_files = ['src/java/io/sample/UseCase.java']
|
25
|
-
|
26
|
-
allow(@dangerfile.git).to receive(:modified_files).and_return(modified_files)
|
27
|
-
allow(@dangerfile.git).to receive(:added_files).and_return(added_files)
|
23
|
+
allow(File).to receive(:open).and_call_original
|
28
24
|
end
|
29
25
|
|
30
26
|
it :report do
|
31
27
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
32
28
|
|
29
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
33
30
|
@my_plugin.minimum_project_coverage_percentage = 50
|
34
31
|
@my_plugin.minimum_class_coverage_map = { 'com/example/CachedRepository' => 100 }
|
35
32
|
|
@@ -43,9 +40,43 @@ module Danger
|
|
43
40
|
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `com/example/CachedRepository` | 50% | 100% | :warning: |')
|
44
41
|
end
|
45
42
|
|
43
|
+
it 'creates supplied status file upon failure' do
|
44
|
+
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
45
|
+
|
46
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
47
|
+
@my_plugin.minimum_project_coverage_percentage = 100
|
48
|
+
@my_plugin.minimum_class_coverage_percentage = 60
|
49
|
+
@my_plugin.file_to_create_on_failure = 'kmm.txt'
|
50
|
+
|
51
|
+
expect(File).to receive(:open).with('kmm.txt', 'w')
|
52
|
+
@my_plugin.report path_a
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'creates default status file upon failure' do
|
56
|
+
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
57
|
+
|
58
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
59
|
+
@my_plugin.minimum_class_coverage_percentage = 60
|
60
|
+
|
61
|
+
expect(File).to receive(:open).with('danger_jacoco_failure_status_file.txt', 'w')
|
62
|
+
@my_plugin.report path_a
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'does _not_ create status file upon success' do
|
66
|
+
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
67
|
+
|
68
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
69
|
+
@my_plugin.minimum_class_coverage_percentage = 40
|
70
|
+
@my_plugin.file_to_create_on_failure = 'kmm.txt'
|
71
|
+
|
72
|
+
expect(File).to_not receive(:open).with('kmm.txt', 'w')
|
73
|
+
@my_plugin.report path_a
|
74
|
+
end
|
75
|
+
|
46
76
|
it 'test regex class coverage' do
|
47
77
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
48
78
|
|
79
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
49
80
|
@my_plugin.minimum_project_coverage_percentage = 50
|
50
81
|
@my_plugin.minimum_class_coverage_map = { '.*Repository' => 60 }
|
51
82
|
|
@@ -57,6 +88,7 @@ module Danger
|
|
57
88
|
it 'test with package coverage' do
|
58
89
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
59
90
|
|
91
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
60
92
|
@my_plugin.minimum_project_coverage_percentage = 50
|
61
93
|
@my_plugin.minimum_package_coverage_map = { 'com/example/' => 70 }
|
62
94
|
|
@@ -68,6 +100,7 @@ module Danger
|
|
68
100
|
it 'test with bigger overlapped package coverage' do
|
69
101
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
70
102
|
|
103
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
71
104
|
@my_plugin.minimum_project_coverage_percentage = 50
|
72
105
|
@my_plugin.minimum_package_coverage_map = {
|
73
106
|
'com/example/' => 70,
|
@@ -82,6 +115,7 @@ module Danger
|
|
82
115
|
it 'test with lower overlapped package coverage' do
|
83
116
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
84
117
|
|
118
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
85
119
|
@my_plugin.minimum_project_coverage_percentage = 50
|
86
120
|
@my_plugin.minimum_package_coverage_map = {
|
87
121
|
'com/example/' => 77,
|
@@ -96,6 +130,7 @@ module Danger
|
|
96
130
|
it 'test with overlapped package coverage and bigger class coverage' do
|
97
131
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
98
132
|
|
133
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
99
134
|
@my_plugin.minimum_project_coverage_percentage = 50
|
100
135
|
@my_plugin.minimum_package_coverage_map = {
|
101
136
|
'com/example/' => 77,
|
@@ -111,6 +146,7 @@ module Danger
|
|
111
146
|
it 'test with overlapped package coverage and lower class coverage' do
|
112
147
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
113
148
|
|
149
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
114
150
|
@my_plugin.minimum_project_coverage_percentage = 50
|
115
151
|
@my_plugin.minimum_package_coverage_map = {
|
116
152
|
'com/example/' => 90,
|
@@ -123,24 +159,10 @@ module Danger
|
|
123
159
|
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `com/example/CachedRepository` | 50% | 80% | :warning: |')
|
124
160
|
end
|
125
161
|
|
126
|
-
it 'checks modified files when "only_check_new_files" attribute is false' do
|
127
|
-
path_a = "#{File.dirname(__FILE__)}/fixtures/output_c.xml"
|
128
|
-
|
129
|
-
@my_plugin.minimum_project_coverage_percentage = 50
|
130
|
-
@my_plugin.only_check_new_files = false
|
131
|
-
|
132
|
-
@my_plugin.report path_a
|
133
|
-
|
134
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('### JaCoCo Code Coverage 55.59% :white_check_mark:')
|
135
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('| Class | Covered | Required | Status |')
|
136
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('|:---|:---:|:---:|:---:|')
|
137
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `com/example/CachedRepository` | 50% | 0% | :white_check_mark: |')
|
138
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `io/sample/UseCase` | 66% | 0% | :white_check_mark: |')
|
139
|
-
end
|
140
|
-
|
141
162
|
it 'defaults "only_check_new_files" attribute to false' do
|
142
163
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_c.xml"
|
143
164
|
|
165
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
144
166
|
@my_plugin.minimum_project_coverage_percentage = 50
|
145
167
|
|
146
168
|
@my_plugin.report path_a
|
@@ -149,25 +171,10 @@ module Danger
|
|
149
171
|
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `io/sample/UseCase` | 66% | 0% | :white_check_mark: |')
|
150
172
|
end
|
151
173
|
|
152
|
-
it 'does _not_ check modified files when "only_check_new_files" attribute is true' do
|
153
|
-
path_a = "#{File.dirname(__FILE__)}/fixtures/output_c.xml"
|
154
|
-
|
155
|
-
@my_plugin.minimum_project_coverage_percentage = 50
|
156
|
-
@my_plugin.minimum_class_coverage_percentage = 70
|
157
|
-
@my_plugin.only_check_new_files = true
|
158
|
-
|
159
|
-
@my_plugin.report path_a
|
160
|
-
|
161
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('### JaCoCo Code Coverage 55.59% :white_check_mark:')
|
162
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('| Class | Covered | Required | Status |')
|
163
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('|:---|:---:|:---:|:---:|')
|
164
|
-
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `io/sample/UseCase` | 66% | 70% | :warning: |')
|
165
|
-
expect(@dangerfile.status_report[:markdowns][0].message).not_to include('com/example/CachedRepository')
|
166
|
-
end
|
167
|
-
|
168
174
|
it 'adds a link to report' do
|
169
175
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
170
176
|
|
177
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
171
178
|
@my_plugin.minimum_class_coverage_percentage = 80
|
172
179
|
@my_plugin.minimum_project_coverage_percentage = 50
|
173
180
|
|
@@ -179,6 +186,7 @@ module Danger
|
|
179
186
|
it 'When option "fail_no_coverage_data_found" is set to optionally fail, it doesn\'t fail the execution' do
|
180
187
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
181
188
|
|
189
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
182
190
|
@my_plugin.minimum_class_coverage_percentage = 80
|
183
191
|
@my_plugin.minimum_project_coverage_percentage = 50
|
184
192
|
|
@@ -188,6 +196,7 @@ module Danger
|
|
188
196
|
it 'When option "fail_no_coverage_data_found" is not set, the execution fails on empty data' do
|
189
197
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_b.xml"
|
190
198
|
|
199
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
191
200
|
@my_plugin.minimum_class_coverage_percentage = 80
|
192
201
|
@my_plugin.minimum_project_coverage_percentage = 50
|
193
202
|
|
@@ -197,6 +206,7 @@ module Danger
|
|
197
206
|
it 'When option "fail_no_coverage_data_found" is set to optionally fail, the execution fails on empty data' do
|
198
207
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_b.xml"
|
199
208
|
|
209
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
200
210
|
@my_plugin.minimum_class_coverage_percentage = 80
|
201
211
|
@my_plugin.minimum_project_coverage_percentage = 50
|
202
212
|
|
@@ -206,6 +216,7 @@ module Danger
|
|
206
216
|
it 'When option "fail_no_coverage_data_found" is set to optionally warn (not fail), the execution doesn\'t fail on empty data' do
|
207
217
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_b.xml"
|
208
218
|
|
219
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
209
220
|
@my_plugin.minimum_class_coverage_percentage = 80
|
210
221
|
@my_plugin.minimum_project_coverage_percentage = 50
|
211
222
|
|
@@ -215,6 +226,7 @@ module Danger
|
|
215
226
|
it 'prints default success subtitle' do
|
216
227
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
217
228
|
|
229
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
218
230
|
@my_plugin.minimum_project_coverage_percentage = 30
|
219
231
|
@my_plugin.minimum_class_coverage_percentage = 40
|
220
232
|
|
@@ -231,6 +243,7 @@ module Danger
|
|
231
243
|
it 'prints default failure subtitle' do
|
232
244
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
233
245
|
|
246
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
234
247
|
@my_plugin.minimum_project_coverage_percentage = 30
|
235
248
|
@my_plugin.minimum_class_coverage_percentage = 60
|
236
249
|
|
@@ -247,6 +260,7 @@ module Danger
|
|
247
260
|
it 'prints custom success subtitle' do
|
248
261
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
249
262
|
|
263
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
250
264
|
@my_plugin.minimum_project_coverage_percentage = 30
|
251
265
|
@my_plugin.minimum_class_coverage_percentage = 40
|
252
266
|
@my_plugin.subtitle_success = 'You rock! 🔥'
|
@@ -264,6 +278,7 @@ module Danger
|
|
264
278
|
it 'prints custom failure subtitle' do
|
265
279
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
266
280
|
|
281
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
267
282
|
@my_plugin.minimum_project_coverage_percentage = 30
|
268
283
|
@my_plugin.minimum_class_coverage_percentage = 60
|
269
284
|
@my_plugin.subtitle_failure = 'Too bad :('
|
@@ -281,6 +296,8 @@ module Danger
|
|
281
296
|
it 'prints default class column title' do
|
282
297
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
283
298
|
|
299
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
300
|
+
|
284
301
|
@my_plugin.report path_a
|
285
302
|
|
286
303
|
expect(@dangerfile.status_report[:markdowns][0].message).to include('| Class | Covered | Required | Status |')
|
@@ -289,6 +306,7 @@ module Danger
|
|
289
306
|
it 'prints custom class column title' do
|
290
307
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
291
308
|
|
309
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
292
310
|
@my_plugin.class_column_title = 'New files'
|
293
311
|
|
294
312
|
@my_plugin.report path_a
|
@@ -299,6 +317,7 @@ module Danger
|
|
299
317
|
it 'instruction coverage takes over all the rest coverages for classes' do
|
300
318
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_d.xml"
|
301
319
|
|
320
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
302
321
|
@my_plugin.minimum_class_coverage_percentage = 50
|
303
322
|
|
304
323
|
@my_plugin.report path_a
|
@@ -309,6 +328,7 @@ module Danger
|
|
309
328
|
it 'branch coverage takes over line coverage for classes, when instruction coverage is not available' do
|
310
329
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_e.xml"
|
311
330
|
|
331
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
312
332
|
@my_plugin.minimum_class_coverage_percentage = 50
|
313
333
|
|
314
334
|
@my_plugin.report path_a
|
@@ -319,6 +339,7 @@ module Danger
|
|
319
339
|
it 'line coverage takes over for classes, when both instruction coverage and branch coverage are not available' do
|
320
340
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_f.xml"
|
321
341
|
|
342
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
322
343
|
@my_plugin.minimum_class_coverage_percentage = 50
|
323
344
|
|
324
345
|
@my_plugin.report path_a
|
@@ -335,6 +356,7 @@ module Danger
|
|
335
356
|
it 'applies minimum_composable_class_coverage_percentage' do
|
336
357
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
337
358
|
|
359
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
338
360
|
@my_plugin.minimum_class_coverage_percentage = 55
|
339
361
|
@my_plugin.minimum_composable_class_coverage_percentage = 45
|
340
362
|
|
@@ -353,6 +375,7 @@ module Danger
|
|
353
375
|
it 'does not apply minimum_composable_class_coverage_percentage' do
|
354
376
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
355
377
|
|
378
|
+
@my_plugin.files_to_check = ['src/java/com/example/CachedRepository.java', 'src/java/io/sample/UseCase.java']
|
356
379
|
@my_plugin.minimum_class_coverage_percentage = 55
|
357
380
|
@my_plugin.minimum_composable_class_coverage_percentage = 45
|
358
381
|
|
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.13.SNAPSHOT.1
|
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-09-
|
12
|
+
date: 2022-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: danger-plugin-api
|
@@ -228,9 +228,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '2.6'
|
229
229
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
230
230
|
requirements:
|
231
|
-
- - "
|
231
|
+
- - ">"
|
232
232
|
- !ruby/object:Gem::Version
|
233
|
-
version:
|
233
|
+
version: 1.3.1
|
234
234
|
requirements: []
|
235
235
|
rubygems_version: 3.1.2
|
236
236
|
signing_key:
|