itriagetestrail 0.3.6 → 0.3.7

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: f062cfb480e67e4624e2c47a305b1c804d71e6e8
4
- data.tar.gz: fa33d3278f1f15a08f46f4441459c84d43786751
3
+ metadata.gz: 54047ca763dcc4840c06e0e6311c98ab8893be3e
4
+ data.tar.gz: 2ead1b1c1f17b53fb2a9cf339b205a04dbb8c526
5
5
  SHA512:
6
- metadata.gz: 74ca148606e7ee915bfa0acac9800eb77773f97b2599dd4a779145293a2f2143555000af0b45b68a389e8ccd299ade3911e1a878cd7d91f1299904e4ac16cb53
7
- data.tar.gz: 1e7eeb662fa46ff96d122fca5805e687fed633b21c37000a77df94daf1b278ab1dbefa02c6f98cbd5c6c2a77286f54b4439642facd3bba9920cd411f98d1d1f9
6
+ metadata.gz: a3210afa917b7c8e9815d0b496e41bece370138b04078fc2ee909d7bb18e5b84d348b2dbadd9a61e74a6bd6f9e2dec0cbd7901a4762a146ff4624c604c5bbe93
7
+ data.tar.gz: cd87e2e9b67fa081ae6f19863f8bb86959da39efd04520738798e402de3d39ba3bea86a985feb08a45ab1793538739426c532adf3ef7f4bb59a2ebfb69ff1a40
@@ -1,3 +1,3 @@
1
1
  module Itriagetestrail
2
- VERSION = '0.3.6'
2
+ VERSION = '0.3.7'
3
3
  end
@@ -65,7 +65,11 @@ module Itriagetestrail
65
65
 
66
66
  reset_milestone(@milestone_name)
67
67
 
68
- add_testrail_run if @run_id == 0
68
+ if @run_id == 0
69
+ add_testrail_run
70
+ else
71
+ extend_testrail_run
72
+ end
69
73
 
70
74
  @pool = Pool.new(1)
71
75
 
@@ -292,6 +296,19 @@ module Itriagetestrail
292
296
  label + ' (' + @time_zone.now.strftime('%-I:%M %p') + ')'
293
297
  end
294
298
 
299
+ def extend_testrail_run
300
+ # Get a list of test cases from prior runs
301
+ @existing_cases = File.read('./tmp/testrail_ids')
302
+
303
+ # Reset test scope to include all cases
304
+ body = { include_all: true }
305
+ @client.send_post("update_run/#{@run_id}", body)
306
+ end
307
+
308
+ def existing_cases
309
+ @existing_cases.split(',')
310
+ end
311
+
295
312
  # open a test run to submit test results
296
313
  def add_testrail_run
297
314
  if @testrail_config[:include_all] || true
@@ -365,12 +382,23 @@ module Itriagetestrail
365
382
  }
366
383
  end
367
384
 
385
+ def store_case_ids(list)
386
+ File.open('./tmp/testrail_ids', 'a') { |file| file.print list }
387
+ end
388
+
368
389
  # this is the hack at very end to exclude tests which frameworks like MiniTest and Cucumber did not touch
369
390
  # including all tests at beginning is necessary so that at least some progress can be seen when
370
391
  # real time updating is enabled.
371
392
  def update_test_run
372
393
  executed_ids = []
373
394
  @results[:results].each {|id| executed_ids << id[:case_id]}
395
+
396
+ # Save ids for more processes in this run
397
+ store_case_ids(executed_ids)
398
+
399
+ # If previous ids exist, retain them and their results
400
+ existing_cases.each { |case_id| executed_ids << case_id }
401
+
374
402
  send = {include_all: false, case_ids: executed_ids}
375
403
  @client.send_post("update_run/#{@run_id}", send)
376
404
  end
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.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - a801069
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler