danger-jacoco-instacart 0.1.12.SNAPSHOT.2 → 0.1.12
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 +1 -12
- data/spec/jacoco_spec.rb +0 -31
- 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: 1abc0461e9b260a95c412ad877e45259ee557f26b9ed4de55eaa982cc84a0dad
|
4
|
+
data.tar.gz: be45bc45af39819be0735aa3d9a5456118a317c597890da3145fb00cbabe6b2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f3260792e92abff7de9d85f6cf67c6c93233b6b492937049167cf37a72f3e2dfc90dba09f8ba14da85e9a5991c8602c54439275c7c3b601026cbcd00b0afe3
|
7
|
+
data.tar.gz: 84bbc4e0f01417de4dac8a1d2b2da1c07e65e69769828154fa1bda935ffc8639145e79132ea0bc12734ac01e3c72fbac78717dc18f55a232b5d9d63e8019a409
|
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 fcee9a884aa0707169357197da0ee6d6298be6fa
|
3
|
+
/Users/alexanderbezverhni/workspace/junk/danger-jacoco/lib/jacoco/plugin.rb f1cb8c9c21dde323e5f7dd51b3f4387094361fcc
|
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
@@ -23,7 +23,7 @@ module Danger
|
|
23
23
|
attr_accessor :minimum_project_coverage_percentage, :minimum_class_coverage_percentage,
|
24
24
|
:minimum_composable_class_coverage_percentage, :only_check_new_files, :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
|
27
27
|
|
28
28
|
# Initialize the plugin with configured parameters or defaults
|
29
29
|
def setup
|
@@ -31,7 +31,6 @@ module Danger
|
|
31
31
|
setup_texts
|
32
32
|
@only_check_new_files = false unless only_check_new_files
|
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
|
35
34
|
end
|
36
35
|
|
37
36
|
# Initialize the plugin with configured optional texts
|
@@ -232,24 +231,14 @@ module Danger
|
|
232
231
|
# fail danger if total coverage is smaller than minimum_project_coverage_percentage
|
233
232
|
covered = total_covered[:covered]
|
234
233
|
fail("Total coverage of #{covered}%. Improve this to at least #{minimum_project_coverage_percentage}%")
|
235
|
-
# 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)
|
236
|
-
create_status_file_on_failure if class_coverage_above_minimum
|
237
|
-
# rubocop:enable Lint/UnreachableCode
|
238
234
|
end
|
239
235
|
|
240
236
|
return if class_coverage_above_minimum
|
241
237
|
|
242
238
|
fail("Class coverage is below minimum. Improve to at least #{minimum_class_coverage_percentage}%")
|
243
|
-
# 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)
|
244
|
-
create_status_file_on_failure
|
245
|
-
# rubocop:enable Lint/UnreachableCode
|
246
239
|
end
|
247
240
|
# rubocop:enable Style/SignalException
|
248
241
|
|
249
|
-
def create_status_file_on_failure
|
250
|
-
File.open(file_to_create_on_failure, 'w') {}
|
251
|
-
end
|
252
|
-
|
253
242
|
def markdown_class(parser, report_markdown, report_url, class_to_file_path_hash)
|
254
243
|
class_coverage_above_minimum = true
|
255
244
|
parser.classes.each do |jacoco_class| # Check metrics for each classes
|
data/spec/jacoco_spec.rb
CHANGED
@@ -25,7 +25,6 @@ module Danger
|
|
25
25
|
|
26
26
|
allow(@dangerfile.git).to receive(:modified_files).and_return(modified_files)
|
27
27
|
allow(@dangerfile.git).to receive(:added_files).and_return(added_files)
|
28
|
-
allow(File).to receive(:open).and_call_original
|
29
28
|
end
|
30
29
|
|
31
30
|
it :report do
|
@@ -44,36 +43,6 @@ module Danger
|
|
44
43
|
expect(@dangerfile.status_report[:markdowns][0].message).to include('| `com/example/CachedRepository` | 50% | 100% | :warning: |')
|
45
44
|
end
|
46
45
|
|
47
|
-
it 'creates supplied status file upon failure' do
|
48
|
-
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
49
|
-
|
50
|
-
@my_plugin.minimum_project_coverage_percentage = 100
|
51
|
-
@my_plugin.minimum_class_coverage_percentage = 60
|
52
|
-
@my_plugin.file_to_create_on_failure = 'kmm.txt'
|
53
|
-
|
54
|
-
expect(File).to receive(:open).with('kmm.txt', 'w')
|
55
|
-
@my_plugin.report path_a
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'creates default status file upon failure' do
|
59
|
-
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
60
|
-
|
61
|
-
@my_plugin.minimum_class_coverage_percentage = 60
|
62
|
-
|
63
|
-
expect(File).to receive(:open).with('danger_jacoco_failure_status_file.txt', 'w')
|
64
|
-
@my_plugin.report path_a
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'does _not_ create status file upon success' do
|
68
|
-
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
69
|
-
|
70
|
-
@my_plugin.minimum_class_coverage_percentage = 40
|
71
|
-
@my_plugin.file_to_create_on_failure = 'kmm.txt'
|
72
|
-
|
73
|
-
expect(File).to_not receive(:open).with('kmm.txt', 'w')
|
74
|
-
@my_plugin.report path_a
|
75
|
-
end
|
76
|
-
|
77
46
|
it 'test regex class coverage' do
|
78
47
|
path_a = "#{File.dirname(__FILE__)}/fixtures/output_a.xml"
|
79
48
|
|
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.12
|
4
|
+
version: 0.1.12
|
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-07 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: '0'
|
234
234
|
requirements: []
|
235
235
|
rubygems_version: 3.1.2
|
236
236
|
signing_key:
|