circleci-coverage_reporter 0.7.0 → 0.8.0
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/CHANGELOG.md +6 -1
- data/lib/circleci/coverage_reporter/artifact.rb +5 -3
- data/lib/circleci/coverage_reporter/build.rb +3 -2
- data/lib/circleci/coverage_reporter/client.rb +1 -1
- data/lib/circleci/coverage_reporter/reporters/base.rb +2 -2
- data/lib/circleci/coverage_reporter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd5f48c0d180c907d5f629e55a0b379aa68c567
|
4
|
+
data.tar.gz: 0a0dae80532822e85c99a3edc189c566996bab9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 333c597aef52a7a01492c1fe2c16679d9ea65d7b918d65876a68facdcffd550eb7cfdbfae9df358836987a3ddfcb73b28764259af2ed5cf7daccbac5e7586f90
|
7
|
+
data.tar.gz: 9ebe4d3c04e745734d3e6d0d08e1a45a76d51ec281227ac5de7ba93ea26a9350e8782d15e8f882a8014c3c7ea6e16c570c78ecc2a58a3a5b4b7a715eea2df0ee
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.8.0] - 2017-05-31
|
10
|
+
### Changed
|
11
|
+
- Use artifacts in container No. 0
|
12
|
+
|
9
13
|
## [0.7.0] - 2017-05-31
|
10
14
|
### Changed
|
11
15
|
- Add base and previous links to Link reporter
|
@@ -71,7 +75,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
71
75
|
### Added
|
72
76
|
- Initial release
|
73
77
|
|
74
|
-
[Unreleased]: https://github.com/increments/circleci-coverage_reporter/compare/v0.
|
78
|
+
[Unreleased]: https://github.com/increments/circleci-coverage_reporter/compare/v0.8.0...HEAD
|
79
|
+
[0.8.0]: https://github.com/increments/circleci-coverage_reporter/compare/v0.7.0...v0.8.0
|
75
80
|
[0.7.0]: https://github.com/increments/circleci-coverage_reporter/compare/v0.6.0...v0.7.0
|
76
81
|
[0.6.0]: https://github.com/increments/circleci-coverage_reporter/compare/v0.5.0...v0.6.0
|
77
82
|
[0.5.0]: https://github.com/increments/circleci-coverage_reporter/compare/v0.4.0...v0.5.0
|
@@ -4,11 +4,13 @@ module CircleCI
|
|
4
4
|
#
|
5
5
|
# @attr path [String] abstract path to the artifact in CircleCI container
|
6
6
|
# @attr url [String] URL of the artifact
|
7
|
-
|
7
|
+
# @attr node_index [Integer] the ID of the artifact's container
|
8
|
+
Artifact = Struct.new(:path, :url, :node_index) do
|
8
9
|
# @param value [String]
|
10
|
+
# @param node_index [Integer, nil]
|
9
11
|
# @return [Boolean]
|
10
|
-
def match?(value)
|
11
|
-
path.end_with?(value)
|
12
|
+
def match?(value, node_index: nil)
|
13
|
+
path.end_with?(value) && (node_index.nil? || self.node_index == node_index)
|
12
14
|
end
|
13
15
|
|
14
16
|
# @return [String] content of the artifact
|
@@ -17,9 +17,10 @@ module CircleCI
|
|
17
17
|
end
|
18
18
|
|
19
19
|
# @param string [String]
|
20
|
+
# @param node_index [Integer, nil]
|
20
21
|
# @return [Artifact, nil]
|
21
|
-
def find_artifact(string)
|
22
|
-
artifacts.find { |artifact| artifact.match?(string) }
|
22
|
+
def find_artifact(string, node_index: nil)
|
23
|
+
artifacts.find { |artifact| artifact.match?(string, node_index: node_index) }
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
@@ -93,14 +93,14 @@ module CircleCI
|
|
93
93
|
# @param build [Build]
|
94
94
|
# @return [Float]
|
95
95
|
def build_coverage(build)
|
96
|
-
artifact = build.find_artifact(json_file_name) or return Float::NAN
|
96
|
+
artifact = build.find_artifact(json_file_name, node_index: 0) or return Float::NAN
|
97
97
|
parse_json(artifact.body)
|
98
98
|
end
|
99
99
|
|
100
100
|
# @param build [Build]
|
101
101
|
# @return [String]
|
102
102
|
def build_url(build)
|
103
|
-
artifact = build.find_artifact(html_file_name) or return '#'
|
103
|
+
artifact = build.find_artifact(html_file_name, node_index: 0) or return '#'
|
104
104
|
artifact.url
|
105
105
|
end
|
106
106
|
|