itriagetestrail 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: 0e4b34fc68615740cb5247064b7635c603149c7e
4
- data.tar.gz: 08b07991a0d6917d176e1fe72f209e3f2527ff18
3
+ metadata.gz: 6f61f27b368672b3e86af31ba8f3dddfd754e45f
4
+ data.tar.gz: 384738a316031f1597ce403dd3ee79c2164fe805
5
5
  SHA512:
6
- metadata.gz: 0ef107f0a6f489c7d4bab0f85ccc176d124316ab9dce714a6667b81990a890e63b97fe3e6ac8d66cb591d1b61179dac96da9db8b4ee30aa3aa23e245b2c94e55
7
- data.tar.gz: 443c46a032847a4779671bd61e82696d28b130b92cc536f4d66b793f5ab4548f4752a6938005504b548c675106fc9000df0bc69e8cd90383901151083aae48a6
6
+ metadata.gz: 9a727dff6865e6a608b1a230dd93a85ec189e129353eeea2de034a262fe29242c5a78af2b97bd6f7d3350bff54d5c6462d5c9967e9b2988ac0ac9df600f59c0c
7
+ data.tar.gz: 5b8d98735d526e492c99813b7aab35d77feddb78e2e33712babb1e3b9db6ebd4dc1272a732c1cb2cdba2e42fdb73b37da9e1375f8f9737bf57512ec7f3a1c0f3
@@ -1,3 +1,3 @@
1
1
  module Itriagetestrail
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -1,4 +1,4 @@
1
- require 'itriagetestrail/version'
1
+ require_relative 'itriagetestrail/version'
2
2
  require_relative 'itriagetestrail/testrail_binding'
3
3
  require_relative 'itriagetestrail/pool'
4
4
 
@@ -15,12 +15,14 @@ module Itriagetestrail
15
15
  attr_reader :results
16
16
  attr_reader :external_results
17
17
 
18
- def initialize(testrail_config, origin)
18
+ def initialize(testrail_config, origin, jenkins_build, app_version)
19
19
  @run_id = 0
20
20
  @setup = false
21
21
  @testrail_config = testrail_config
22
22
  @project_id = @testrail_config['project_id']
23
23
  @milestone_name = normalize_milestone(origin)
24
+ @jenkins_build = jenkins_build
25
+ @app_version = app_version
24
26
 
25
27
  if @testrail_config['send_local_results?'] && @milestone_name == 'Local'
26
28
  @execute = true
@@ -148,10 +150,10 @@ module Itriagetestrail
148
150
  test_case_id = testrail_test_case_id(external_id)
149
151
  # store the test case id with the local result
150
152
  @results[:results].each do |result|
151
- next unless result['external_id'] == external_id
152
- @external_results['results'] << { case_id: test_case_id,
153
- status_id: result['status_id'],
154
- comment: result['comment'] }
153
+ next unless result[:external_id] == external_id
154
+ @external_results[:results] << { case_id: test_case_id,
155
+ status_id: result['status_id'],
156
+ comment: result['comment'] }
155
157
  end
156
158
  end
157
159
 
@@ -170,19 +172,30 @@ module Itriagetestrail
170
172
  testrail_ids
171
173
  end
172
174
 
175
+ def test_name
176
+ label = ''
177
+ label += "App Version:#{@app_version}" unless @app_version.nil?
178
+ label += " Jenkins Build:#{@jenkins_build}" unless @jenkins_build .nil?
179
+ label.strip!
180
+ label = 'Regression' if label == ''
181
+ label + ' (' + Time.now.strftime('%-I:%M %p') + ')'
182
+ end
183
+
173
184
  # open a test run to submit test results
174
185
  def add_testrail_run
175
186
  if @testrail_config['include_all?']
176
187
 
177
188
  body = {
178
- name: "POC Regression on #{Time.zone.now}",
189
+ name: test_name,
190
+ description: 'Timestamp: ' + Time.now.strftime('%m/%d/%Y %-I:%M %p'),
179
191
  include_all: true,
180
192
  milestone_id: @milestone_id
181
193
  }
182
194
  else
183
195
 
184
196
  body = {
185
- name: "POC Regression on #{Time.zone.now}",
197
+ name: test_name,
198
+ description: 'Timestamp: ' + Time.now.strftime('%m/%d/%Y %I:%M %p'),
186
199
  include_all: false,
187
200
  case_ids: @test_case_ids,
188
201
  milestone_id: @milestone_id
@@ -195,7 +208,7 @@ module Itriagetestrail
195
208
  end
196
209
 
197
210
  def send_results_to_testrail
198
- return unless @results[:results].size == 0
211
+ return unless @results[:results].size != 0
199
212
  # copy what is in the results
200
213
  @submitted[:results] << @results[:results]
201
214
 
@@ -211,20 +224,17 @@ module Itriagetestrail
211
224
  def update_test_suite(scenario_title, external_id, scenario_steps)
212
225
  feature = external_id.split(';')[0]
213
226
 
214
- section_id = testrail_section_id(feature)
215
-
216
- # if the testrail section does not exist, update sections
217
- section_id = add_testrail_section(feature) if section_id == -1
218
-
219
227
  # if the testrail case does not exist, update cases
220
228
  if testrail_test_case_id(external_id) == -1
221
229
 
222
- # @scenario_title = result['scenario_title']
230
+ section_id = testrail_section_id(feature)
231
+
232
+ # if the testrail section does not exist, update sections
233
+ section_id = add_testrail_section(feature) if section_id == -1
223
234
 
224
235
  add_testrail_test_case(scenario_title, external_id, scenario_steps, section_id)
225
236
  sleep 1
226
237
  end
227
-
228
238
  # store the case id associated with the external_id
229
239
  associate_result(external_id)
230
240
  end
@@ -233,7 +243,6 @@ module Itriagetestrail
233
243
  update_test_suite scenario_title, external_id, scenario_steps
234
244
 
235
245
  case_id = testrail_test_case_id(external_id)
236
-
237
246
  @results[:results] << {
238
247
  case_id: case_id,
239
248
  scenario_title: scenario_title,
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: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - a801069
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-23 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,8 +81,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubyforge_project:
84
- rubygems_version: 2.0.14
84
+ rubygems_version: 2.0.14.1
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Plugin to export your cucumber tests in the Testrail
88
88
  test_files: []
89
+ has_rdoc: