res 1.2.16 → 1.2.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b18b5dab714e0f2047c7cd740180a4a3c06a03e
4
- data.tar.gz: 64c203ffe4cdb6f660cc86cccca52b023fb7532d
3
+ metadata.gz: e495d9220fa374e9c75cf6f694ada1608b8f2fbf
4
+ data.tar.gz: c6011b3ced7ae736c19486c0bd91d606dcf3252f
5
5
  SHA512:
6
- metadata.gz: 77e19fe525f1e0985d0dd9f1c316d4bc635e600d8132a5180ffc44c493ab8b1b4243493acefaa1de8baee2461bcfe79553431f31c46146a562aba0f37f3304a2
7
- data.tar.gz: 09ab11dd2e4c72979f36c133503c8ce8fa22e84603f1b23e54755d677a80af0d061c7e33bd5336dec977ede0e34c6efaaa9b71d6e5ed1d285f588634252f555d
6
+ metadata.gz: 2c1d96c99304680bc61fbb37185758459963743db25a4d90c43055245eeab8394d0f1adb1c55ba53638c02701e9f3883c68f54cc00d74144b4313ac72c515915
7
+ data.tar.gz: db38fc0d05955a148f63579a343345db7810ef0faad169951cc6b6ac1ef3d73dd537e0d0ca42fa7bdd3d70749e0d7e5d370dc94523d42efd256a38fa04dd4a8f
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Res
2
+ [![Build Status](https://travis-ci.org/bbc/res.svg?branch=master)](https://travis-ci.org/bbc/res)
2
3
 
3
4
  Res is a collection of formatting tools for making test
4
5
  result reporting easier and more consistent. The concept is that
data/bin/res CHANGED
@@ -149,13 +149,17 @@ if options.reporter
149
149
 
150
150
  reporter = Res::Reporters::Testmine.new(
151
151
  :config_file => options.config_file,
152
- :version => options.version,
152
+ :url => options.url,
153
+ :cert => options.cert,
154
+ :cacert => options.cacert,
153
155
  :target => options.target,
154
- :url => options.url
156
+ :ssl_verify_mode => options.ssl_verify_mode,
157
+ :ir => ir
155
158
  )
156
159
 
157
160
  id = reporter.submit_results(ir)
158
161
  puts "Reported to testmine: #{id}"
162
+
159
163
  when 'testrail'
160
164
  reporter = Res::Reporters::TestRail.new(
161
165
  :config_file => options.config_file,
@@ -166,6 +170,7 @@ if options.reporter
166
170
 
167
171
  output = reporter.submit_results(ir)
168
172
  puts output
173
+
169
174
  when 'lion'
170
175
  reporter = Res::Reporters::Lion.new(
171
176
  :config_file => options.config_file,
@@ -8,8 +8,8 @@ module Res
8
8
 
9
9
  def initialize(args)
10
10
  @url = args[:url]
11
- @config = Res::Config.new([:project, :component, :suite, :version, :url, :target],
12
- :optional => [:hive_job_id],
11
+ @config = Res::Config.new([:project, :component, :suite, :url],
12
+ :optional => [:hive_job_id, :version, :target, :cert, :cacert, :ssl_verify_mode],
13
13
  :pre_env => 'TESTMINE_')
14
14
  config.process(args)
15
15
  end
@@ -29,18 +29,23 @@ module Res
29
29
  }
30
30
 
31
31
  # Submit to testmine
32
+
32
33
  uri = URI.parse(config.url)
33
- net = Net::HTTP.new(uri.host, uri.port)
34
- request = Net::HTTP::Post.new("/api/v1/submit")
35
- request.set_form_data({"data" => ir.to_json})
36
- net.read_timeout = 60
37
- net.open_timeout = 10
38
-
39
- response = net.start do |http|
40
- http.request(request)
34
+ @http = Net::HTTP.new(uri.host, uri.port)
35
+ if config.cert
36
+ pem = File.read(config.cert)
37
+ @http.use_ssl = true if uri.scheme == 'https'
38
+ @http.cert = OpenSSL::X509::Certificate.new(pem)
39
+ @http.key = OpenSSL::PKey::RSA.new(pem)
40
+ @http.ca_file = config.cacert if config.cacert
41
+ @http.verify_mode = config.ssl_verify_mode if config.ssl_verify_mode
41
42
  end
42
43
 
43
- response.read_body
44
+ request = Net::HTTP::Post.new(config.url + "/api/v1/submit")
45
+ request.content_type = 'application/json'
46
+ request.set_form_data({"data" => ir.to_json})
47
+ @http.request(request)
48
+
44
49
  end
45
50
 
46
51
  end
@@ -1,3 +1,3 @@
1
1
  module Res
2
- VERSION = '1.2.16'
2
+ VERSION = '1.2.17'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: res
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.16
4
+ version: 1.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-11-02 00:00:00.000000000 Z
13
+ date: 2017-01-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.6.7
131
+ rubygems_version: 2.5.1
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Test Result report libraries