codecov_opentelem 0.1.5 → 0.1.6

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
  SHA256:
3
- metadata.gz: d385d9be5936bef168660940493430288123e80e7e52ef7cfe3c745d7426dc71
4
- data.tar.gz: ee1593d6f7e9b04d964f81d290a6116ea6d460ad65352500cc3b8b0d8c9b813d
3
+ metadata.gz: a837d9537c3dccbc0d656e4bd7c7a196073c95e5686a02252a69f267b49be89b
4
+ data.tar.gz: 6feed841349acebe12bbc6afc3f1f87f9b897d86867e9fc91a4a442f3930b10f
5
5
  SHA512:
6
- metadata.gz: 970d7e5aeecdea1689d933bfa78c222b70265345f3c62b62c79220b6ff212832146a41bcff5cc1017987b572c46d49c8a934cf883d3841630056400e1df5796a
7
- data.tar.gz: 02fbe4c9bbc6c9e36f346d139dd6c0ea5f82fc4216d75a307a31d79a64ea146775ea06eb8f05d88eff076087f4959b60d97525b744867efb5bf12330dae1017c
6
+ metadata.gz: c0823f094eb916153de0aae3a29496bd9f1245648159435e6c070ef86e371b9015f399efc3f54e3cc9fe45081357c524ea9c5fbf01f216fb78f3f41b3e9853f7
7
+ data.tar.gz: 7fd37d56e8ca61aac7ee18537a486a865efe4a834a77eabeb8b3dab17a002c4430cfca3a6af4b603dbbed0e598b803405cd61045b6291aaa692b5b9955adf591
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'base64'
3
4
  require 'json'
4
- require 'uri'
5
5
  require 'net/http'
6
+ require 'uri'
6
7
 
7
- require 'opentelemetry/sdk'
8
8
  require 'coverage'
9
+ require 'opentelemetry/sdk'
9
10
 
10
11
  module CoverageSpanFilter
11
12
  REGEX_NAME = 'name_regex'
@@ -78,14 +79,17 @@ class CoverageExporter < OpenTelemetry::SDK::Trace::Export::SpanExporter
78
79
  span_hash[k] = v
79
80
  end
80
81
 
82
+ cov_string = cov.map{ |k, v| "\"#{k}\":[#{v.map{ |i| i.nil? ? "null" : i}.join(',')}]"}.join(',')
83
+ cov_string = "{\"coverage\":{#{cov_string}}}"
84
+
81
85
  if !cov.nil?
82
86
  span_hash['codecov'] = {
83
- 'coverage': cov.to_json,
84
- 'type': 'json',
87
+ 'coverage': Base64.strict_encode64(cov_string),
88
+ 'type': 'bytes',
85
89
  }
86
- tracked_spans.append(span_hash.to_json)
90
+ tracked_spans.append(span_hash)
87
91
  elsif rand() < @untracked_export_rate
88
- untracked_spans.append(span_hash.to_json)
92
+ untracked_spans.append(span_hash)
89
93
  end
90
94
  end
91
95
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CodecovOpentelem
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codecov_opentelem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmed-Elghrbawy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-18 00:00:00.000000000 Z
11
+ date: 2022-06-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: