blinka-reporter 0.3.0 → 0.3.1

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: 3fa8216d86cce40da5c4c423b473dcb6956302b017807ab383d93b94c32484fe
4
- data.tar.gz: 1eabf2319cedab3b2378e087c66b36974fdc4dc0753ebd7cdb95f50300ac5df3
3
+ metadata.gz: 56e193271a3f7ffc8d089ac8e4484edb68e7a8783a1b138ceee55ba667b720e2
4
+ data.tar.gz: 70dfd466a32dba39ea0d0d28713ed979d56cdbc2cc5451cf35b54464c3ecf42e
5
5
  SHA512:
6
- metadata.gz: 259de1e1edf5332fa682d95444a081d85cd2f55416ce183a92e4109822735ff594f70885cf3307d3045f8c7f9df73bc874a1ca7abb20523cd7e00980cbf3a6c5
7
- data.tar.gz: b18f0a91507350ad8023894b7d237aab25a92683db6963c651d9267d316315a8f5233dcbc361355bd21e21530c181df4a318e7a1a3a353b5290d45bacaf817a4
6
+ metadata.gz: 2f1bd80ac40f5d2b68a6a72ff166d490835c4c58996d2019d4309cc0806ca19c7588f26f0930c8dbf25f099f7c195c06f191eb2852c4f025e266896356c9c049
7
+ data.tar.gz: 55abf722700a5a475d1e24fd93a7885c57a6b6272cc383c975b33e7707ae4df415f6560e3a00d9387da7d1dcd60830ec6589b4fee6439e713477e344b1aef501
data/lib/blinka_client.rb CHANGED
@@ -40,7 +40,7 @@ class BlinkaClient
40
40
  end
41
41
 
42
42
  def report(filepath: './blinka_results.json')
43
- unless File.exists?(filepath)
43
+ unless File.exist?(filepath)
44
44
  raise(
45
45
  BlinkaError,
46
46
  'Could not find blinka_results.json, did tests run with environment variable BLINKA_JSON=true set?'
@@ -94,6 +94,12 @@ class BlinkaClient
94
94
  else
95
95
  raise(BlinkaError, "Could not report, got response code #{response.code}")
96
96
  end
97
+ rescue => error
98
+ raise(BlinkaError, <<-EOS)
99
+ BLINKA:
100
+ Failed to create report because of #{error.class} with message:
101
+ #{error.message}
102
+ EOS
97
103
  end
98
104
 
99
105
  def self.upload_image(filepath:)
@@ -1,6 +1,7 @@
1
1
  require 'minitest'
2
2
  require 'json'
3
3
  require 'blinka_minitest'
4
+ require 'blinka_client'
4
5
 
5
6
  module Minitest
6
7
  def self.plugin_blinka_init(options)
@@ -25,9 +26,12 @@ module Minitest
25
26
  end
26
27
 
27
28
  def report
28
- tap_report unless ENV['BLINKA_TAP'].nil?
29
- json_report unless ENV['BLINKA_JSON'].nil?
30
-
29
+ tap_report if ENV['BLINKA_TAP']
30
+ json_report if ENV['BLINKA_JSON'] || ENV['BLINKA_REPORT']
31
+ BlinkaClient.new.report if ENV['BLINKA_REPORT']
32
+ rescue BlinkaClient::BlinkaError => error
33
+ puts(error)
34
+ ensure
31
35
  super
32
36
  end
33
37
 
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.0
4
+ version: 0.3.1
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-02-08 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty