circleci-coverage_reporter 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c02b2d7af2b63de0bd7ddb667a911ff9aa27bb4
4
- data.tar.gz: 7404cc0ff4659841480a436231ca53a1fb944693
3
+ metadata.gz: fcd5f48c0d180c907d5f629e55a0b379aa68c567
4
+ data.tar.gz: 0a0dae80532822e85c99a3edc189c566996bab9d
5
5
  SHA512:
6
- metadata.gz: 27d50c4f709ee6bfcc164504a3121f3c47bbe25f5a43f45e20f9a14e5df4f5b055f3a6b9ef4ad9bc4739774c951c33eec0b615e06be9405ca38da3dc74fcda37
7
- data.tar.gz: 4193dcc451c5c0fef0fbbef4046391241e30695716e2d455fe59d7e07587ad440a19d97c4fac71a1e48d52103ff02d9856cfb1035adcc5f18ec762a6d1248102
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.7.0...HEAD
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
- Artifact = Struct.new(:path, :url) do
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
@@ -115,7 +115,7 @@ module CircleCI
115
115
  # @param hash [Hash]
116
116
  # @return [Artifact]
117
117
  def create_artifact(hash)
118
- Artifact.new(hash['path'], hash['url'])
118
+ Artifact.new(hash['path'], hash['url'], hash['node_index'])
119
119
  end
120
120
 
121
121
  # @param hash [Hash]
@@ -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
 
@@ -2,7 +2,7 @@ module CircleCI
2
2
  module CoverageReporter
3
3
  module Version
4
4
  MAJOR = 0
5
- MINOR = 7
5
+ MINOR = 8
6
6
  PATCH = 0
7
7
 
8
8
  def self.to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circleci-coverage_reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuku Takahashi