itriagetestrail 1.0.34 → 1.0.39
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92575ff3a5692b229f54f96a3148623b6b870c88dc5fc80276c57a3e3eb083c4
|
4
|
+
data.tar.gz: 1efb6905bdb1b22249855bda058e1cda0265f093cf549d18e760682f6b4a8c55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 229dda3808dea626b44848d4add36cd5b159be21c27c2bcdebbb22a4cb4b1cc288e32f928a7275a56ed409d2173a250530ba93bd6a42c1d80cf61710afb4981c
|
7
|
+
data.tar.gz: 37a2bdb950cf3e87fcc696788c2eaf903599cbd064bc3e5d6f94fe7086f66e1d2eca7c38d2feac533a268c10d0980b92c2ccfebdd0256db1ca56493f4149d25b
|
data/lib/itriagetestrail.rb
CHANGED
@@ -49,7 +49,7 @@ module Itriagetestrail
|
|
49
49
|
# This is the very first call to TestRail
|
50
50
|
make_connection
|
51
51
|
projects
|
52
|
-
if @client.response_code == '200'
|
52
|
+
if @client.response_code == '200' || @client.response_code.nil?
|
53
53
|
true
|
54
54
|
else
|
55
55
|
puts "**** TESTRAIL IS OFFLINE for maintenance or other reason with status code #{@client.response_code}"
|
@@ -160,9 +160,9 @@ module TestRail
|
|
160
160
|
filename = sanitize_filename(url)
|
161
161
|
return unless File.exist?("./tmp/#{filename}")
|
162
162
|
file = File.open("./tmp/#{filename}", 'r')
|
163
|
-
content = JSON.parse(file.read
|
163
|
+
content = JSON.parse(file.read)
|
164
164
|
file.close
|
165
|
-
content[
|
165
|
+
content['response']
|
166
166
|
end
|
167
167
|
|
168
168
|
def sanitize_filename(filename)
|
@@ -18,10 +18,10 @@ module Itriagetestrail
|
|
18
18
|
|
19
19
|
# In implementations where there is not an at_exit, parallel test threads can store results
|
20
20
|
# of tests from the completed test class into a batch file, so final processing sends all results
|
21
|
-
# at the very end of the job while avoiding rate limiting issues.
|
21
|
+
# at the very end of the job while avoiding rate limiting issues. Each row is a separate json.
|
22
22
|
def store_results_to_batch_file
|
23
23
|
return if @results[:results].empty?
|
24
|
-
entry = {runId: @run_id, results: @results[:results]}
|
24
|
+
entry = {runId: @run_id, results: @results[:results]}.to_json
|
25
25
|
|
26
26
|
Dir.mkdir('./tmp') unless File.exist?('./tmp')
|
27
27
|
file = File.open("./tmp/batch", 'a')
|
@@ -53,10 +53,11 @@ module Itriagetestrail
|
|
53
53
|
run_id = nil
|
54
54
|
results = []
|
55
55
|
File.open("./tmp/batch").each do |line|
|
56
|
-
content =
|
56
|
+
content = JSON.parse(line, symbolize_names: true)
|
57
57
|
unless run_id
|
58
58
|
run_id = content[:runId]
|
59
59
|
end
|
60
|
+
puts content
|
60
61
|
content[:results].each { |result| results << result }
|
61
62
|
end
|
62
63
|
{runId: run_id, results: results}
|