itriagetestrail 1.0.17 → 1.0.22
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbe880b8fbaf52b1bd6279bcaad84c1e592e9bb6
|
4
|
+
data.tar.gz: 1d6afdcbcd973c6166308fa56f437bf36bcd6de9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20202a2bc2cb09f045119e2fa7469eb815f8f0dface67bda8b0310cfcf8da6c9130d1d6db334c30a2bf95e498908642a8d6713e98dd7506ca2378cc79368c243
|
7
|
+
data.tar.gz: c48e7d371a314ca9ed0ff8ed4bbff98eedabe7e8fdcb14dc9413c150cf68faca1cc73f8b6b029217a07806a35cf10e955910faca1503e6010bd317ee1d968b9c
|
data/lib/itriagetestrail.rb
CHANGED
@@ -45,11 +45,24 @@ module Itriagetestrail
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
+
def testrail_online
|
49
|
+
# This is the very first call to TestRail
|
50
|
+
make_connection
|
51
|
+
@client.send_get('get_projects')
|
52
|
+
|
53
|
+
if @client.response_code == '200'
|
54
|
+
true
|
55
|
+
else
|
56
|
+
puts "**** TESTRAIL IS OFFLINE for maintenance or other reason with status code #{@client.response_code}"
|
57
|
+
false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
48
61
|
def _execute
|
49
62
|
@execute = if @testrail_config[:user].nil? || @testrail_config[:user].empty?
|
50
63
|
false
|
51
64
|
else
|
52
|
-
|
65
|
+
testrail_online
|
53
66
|
end
|
54
67
|
end
|
55
68
|
|
@@ -158,14 +171,14 @@ module Itriagetestrail
|
|
158
171
|
|
159
172
|
#Supports tagging
|
160
173
|
@testrail_case_fields = @client.send_get('get_case_fields')
|
161
|
-
|
162
|
-
# TODO: Look into configuration_ids to add a plan
|
163
|
-
add_testrail_run if @run_id.to_i.zero?
|
164
|
-
|
165
174
|
@pool = Pool.new(1)
|
166
|
-
|
167
175
|
@setup = true
|
168
176
|
end
|
177
|
+
|
178
|
+
def create_run_id
|
179
|
+
# TODO: Look into configuration_ids to add a plan
|
180
|
+
add_testrail_run if @run_id.to_i.zero?
|
181
|
+
end
|
169
182
|
|
170
183
|
def initialize_variables
|
171
184
|
make_connection
|
@@ -21,9 +21,11 @@ module TestRail
|
|
21
21
|
@url = ''
|
22
22
|
@user = ''
|
23
23
|
@password = ''
|
24
|
+
@response_code = nil
|
24
25
|
|
25
26
|
attr_accessor :user
|
26
27
|
attr_accessor :password
|
28
|
+
attr_reader :response_code
|
27
29
|
|
28
30
|
def initialize(base_url)
|
29
31
|
valid_regex = %r{/\/$/}
|
@@ -109,10 +111,10 @@ module TestRail
|
|
109
111
|
retry_count = 0
|
110
112
|
while retry_count < 10
|
111
113
|
response = conn.request(request)
|
112
|
-
response_code = response.code
|
113
|
-
if response_code == '429'
|
114
|
+
@response_code = response.code
|
115
|
+
if @response_code == '429'
|
114
116
|
sleep(response.header['retry-after'].to_i)
|
115
|
-
elsif
|
117
|
+
elsif @response_code == '500'
|
116
118
|
puts response.to_s
|
117
119
|
# this might require different handling for 500 'Deadlock found when
|
118
120
|
# trying to get lock; try restarting transaction'
|
@@ -51,7 +51,6 @@ module Itriagetestrail
|
|
51
51
|
# Pull Tag IDs
|
52
52
|
unless @scenario_tags.nil?
|
53
53
|
|
54
|
-
# TODO: Determine how to approach updating tags without permanently storing results on broken tests?
|
55
54
|
# https://github.com/cucumber/cucumber-ruby/blob/master/lib/cucumber/runtime.rb
|
56
55
|
# Test has to actually run in order to populate testrail.
|
57
56
|
|
@@ -67,12 +66,13 @@ module Itriagetestrail
|
|
67
66
|
end
|
68
67
|
end
|
69
68
|
|
70
|
-
|
71
|
-
testrail_case_tag_ids = @test_cases.select { |item| item['id'] == case_id }[0]['custom_tags']
|
69
|
+
current_case = @test_cases.select { |item| item['id'] == case_id }[0]
|
72
70
|
|
73
|
-
|
74
|
-
|
75
|
-
|
71
|
+
testrail_case_tag_ids = current_case['custom_tags']
|
72
|
+
testrail_case_steps = current_case['custom_steps']
|
73
|
+
|
74
|
+
if testrail_case_tag_ids == scenario_tag_ids || testrail_case_steps == @scenario_steps
|
75
|
+
@client.send_post("update_case/#{case_id}", { 'custom_tags': scenario_tag_ids, 'custom_steps': @scenario_steps})
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itriagetestrail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- a801069
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|