itriagetestrail 1.0.33 → 1.0.38
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: 316ef8566e9b3a1eb558d8a78ce5b9968fd787f26ea0c3054fe5fa85eff4675a
|
4
|
+
data.tar.gz: f22e0a3b34ff051d5163315521b0a88c355a061a4e83feee595de4e031657a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68ec66a8b3ea432fd12a9c6edcbb99e74389b254c7b2334f4dc16e608871c7fb3f830268d7d2acfe35f7a8b6588e8e140f402cae892b1b133859634c76617cdb
|
7
|
+
data.tar.gz: 1d76726f8cdbb942748de2847eab6bf763c39c23832bc3ffc9dd1673f74129fc2805a530ef180b4a6acd8a1ed48b8a1210c5710f35ea1035bec22e3911de0b0d
|
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}"
|
@@ -148,10 +148,11 @@ module TestRail
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def cache_to_file(url, content)
|
151
|
+
payload = {'response' => content}
|
151
152
|
Dir.mkdir('./tmp') unless File.exist?('./tmp')
|
152
153
|
filename = sanitize_filename(url)
|
153
154
|
file = File.open("./tmp/#{filename}", 'w')
|
154
|
-
file.write(
|
155
|
+
file.write(payload.to_json)
|
155
156
|
file.close
|
156
157
|
end
|
157
158
|
|
@@ -159,9 +160,9 @@ module TestRail
|
|
159
160
|
filename = sanitize_filename(url)
|
160
161
|
return unless File.exist?("./tmp/#{filename}")
|
161
162
|
file = File.open("./tmp/#{filename}", 'r')
|
162
|
-
content = JSON.parse(file.read
|
163
|
+
content = JSON.parse(file.read)
|
163
164
|
file.close
|
164
|
-
content
|
165
|
+
content['response']
|
165
166
|
end
|
166
167
|
|
167
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,7 +53,7 @@ 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)
|
57
57
|
unless run_id
|
58
58
|
run_id = content[:runId]
|
59
59
|
end
|