blinka-reporter 0.3.4 → 0.3.5
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/lib/blinka_client.rb +8 -27
- data/lib/blinka_reporter/version.rb +3 -0
- data/lib/minitest/blinka_plugin.rb +14 -2
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18126165bf1e12fccca242964c2086abcab1ad37f1ca6b089b5e02edcb0a64b5
|
4
|
+
data.tar.gz: fc47b4d956f56d7c7572e8fd11b4cd9d119d4e14929ac6f73ba35ee20a66abfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d362519ba45683ad4cddc22c9fbe7e2f5f72e4281ff5369bda0056789b90ae77d3ddf529728a7c5b305d55a633e719a297e6389c79e4f923138311be1777ce75
|
7
|
+
data.tar.gz: 34416bc8b028746deb93b11a684cfed331c0f7fcb0b0210cc216721faec0c41d99caf3b335a9750db3bc11c131850f04964372b50481a680a6cf1368ee7a1649
|
data/lib/blinka_client.rb
CHANGED
@@ -7,23 +7,13 @@ class BlinkaClient
|
|
7
7
|
include HTTParty
|
8
8
|
|
9
9
|
class BlinkaConfig
|
10
|
-
attr_reader(
|
11
|
-
:tag,
|
12
|
-
:commit,
|
13
|
-
:host,
|
14
|
-
:repository,
|
15
|
-
:team_id,
|
16
|
-
:team_secret,
|
17
|
-
:jwt_token
|
18
|
-
)
|
10
|
+
attr_reader(:host, :repository, :team_id, :team_secret, :jwt_token)
|
19
11
|
|
20
12
|
def initialize
|
21
13
|
@host = ENV.fetch('BLINKA_HOST', DEFAULT_HOST)
|
22
14
|
@team_id = ENV.fetch('BLINKA_TEAM_ID', nil)
|
23
15
|
@team_secret = ENV.fetch('BLINKA_TEAM_SECRET', nil)
|
24
16
|
@repository = ENV.fetch('BLINKA_REPOSITORY', nil)
|
25
|
-
@tag = ENV.fetch('BLINKA_TAG', '')
|
26
|
-
@commit = BlinkaClient.find_commit
|
27
17
|
|
28
18
|
if @team_id.nil? || @team_secret.nil? || @repository.nil?
|
29
19
|
raise(BlinkaError, <<~EOS)
|
@@ -75,13 +65,13 @@ class BlinkaClient
|
|
75
65
|
body = {
|
76
66
|
report: {
|
77
67
|
repository: @config.repository,
|
78
|
-
tag:
|
79
|
-
commit:
|
68
|
+
tag: data['tag'],
|
69
|
+
commit: data['commit'],
|
80
70
|
metadata: {
|
81
|
-
total_time: data
|
82
|
-
nbr_tests: data
|
83
|
-
nbr_assertions: data
|
84
|
-
seed: data
|
71
|
+
total_time: data['total_time'],
|
72
|
+
nbr_tests: data['nbr_tests'],
|
73
|
+
nbr_assertions: data['nbr_assertions'],
|
74
|
+
seed: data['seed']
|
85
75
|
}.compact,
|
86
76
|
results: results
|
87
77
|
}
|
@@ -98,9 +88,7 @@ class BlinkaClient
|
|
98
88
|
)
|
99
89
|
case response.code
|
100
90
|
when 200
|
101
|
-
puts "Reported #{data
|
102
|
-
@config.commit
|
103
|
-
}!"
|
91
|
+
puts "Reported #{data['nbr_tests']} tests of commit #{data['commit']}!"
|
104
92
|
else
|
105
93
|
raise(BlinkaError, "Could not report, got response code #{response.code}")
|
106
94
|
end
|
@@ -198,11 +186,4 @@ class BlinkaClient
|
|
198
186
|
}
|
199
187
|
}
|
200
188
|
end
|
201
|
-
|
202
|
-
def self.find_commit
|
203
|
-
ENV.fetch(
|
204
|
-
'BLINKA_COMMIT',
|
205
|
-
ENV.fetch('HEROKU_TEST_RUN_COMMIT_VERSION', `git rev-parse HEAD`.chomp)
|
206
|
-
)
|
207
|
-
end
|
208
189
|
end
|
@@ -26,13 +26,13 @@ module Minitest
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def report
|
29
|
+
super
|
30
|
+
|
29
31
|
tap_report if ENV['BLINKA_TAP']
|
30
32
|
json_report if ENV['BLINKA_JSON'] || ENV['BLINKA_REPORT']
|
31
33
|
BlinkaClient.new.report if ENV['BLINKA_REPORT']
|
32
34
|
rescue BlinkaClient::BlinkaError => error
|
33
35
|
puts(error)
|
34
|
-
ensure
|
35
|
-
super
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
@@ -42,6 +42,8 @@ module Minitest
|
|
42
42
|
total_time: total_time,
|
43
43
|
nbr_tests: count,
|
44
44
|
nbr_assertions: assertions,
|
45
|
+
commit: find_commit,
|
46
|
+
tag: ENV.fetch('BLINKA_TAG', ''),
|
45
47
|
seed: options[:seed],
|
46
48
|
results:
|
47
49
|
tests.map { |test_result| BlinkaMinitest.new(test_result).report }
|
@@ -83,6 +85,16 @@ module Minitest
|
|
83
85
|
def print_padded_comment(line)
|
84
86
|
puts "##{' ' * TAP_COMMENT_PAD + line}"
|
85
87
|
end
|
88
|
+
|
89
|
+
def find_commit
|
90
|
+
ENV.fetch(
|
91
|
+
'BLINKA_COMMIT',
|
92
|
+
ENV.fetch(
|
93
|
+
'HEROKU_TEST_RUN_COMMIT_VERSION',
|
94
|
+
`git rev-parse HEAD`.chomp
|
95
|
+
)
|
96
|
+
)
|
97
|
+
end
|
86
98
|
end
|
87
99
|
end
|
88
100
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blinka-reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Wessman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -116,11 +116,17 @@ extra_rdoc_files: []
|
|
116
116
|
files:
|
117
117
|
- lib/blinka_client.rb
|
118
118
|
- lib/blinka_minitest.rb
|
119
|
+
- lib/blinka_reporter/version.rb
|
119
120
|
- lib/minitest/blinka_plugin.rb
|
120
121
|
homepage: https://github.com/davidwessman/blinka_reporter
|
121
122
|
licenses:
|
122
123
|
- MIT
|
123
|
-
metadata:
|
124
|
+
metadata:
|
125
|
+
homepage_uri: https://github.com/davidwessman/blinka_reporter
|
126
|
+
bug_tracker_uri: https://github.com/davidwessman/blinka_reporter/issues
|
127
|
+
documentation_uri: https://github.com/davidwessman/blinka_reporter
|
128
|
+
changelog_uri: https://github.com/davidwessman/blinka_reporter/main/CHANGELOG.md
|
129
|
+
source_code_uri: https://github.com/davidwessman/blinka_reporter
|
124
130
|
post_install_message:
|
125
131
|
rdoc_options: []
|
126
132
|
require_paths:
|