itriagetestrail 0.2.8 → 0.2.9

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: ff8c251aa4b51be1de34a1fd78a05e50c6042951
4
- data.tar.gz: 5357f251efa75033b073154217dc7fd7a6656b17
3
+ metadata.gz: e7134faed06d48f7b3a63f450a2898e57efea892
4
+ data.tar.gz: d0bc66d934df7202661a89bd355af7c8036883d4
5
5
  SHA512:
6
- metadata.gz: 67e87221c85dd0a1eb0569077e08304b74e884755221a0adc03f353864d813a8f7b1b50ecbedfec883733a1977467396ab87addcba9eafec25ad4f4029837635
7
- data.tar.gz: 3700558442c400da0790682dd8825b1167113a3e9a91944cfda7e5651b7ce01ca5d62dfb89fb144af1900c8e77f652ca83977a23de34ca0f664e13285604dc53
6
+ metadata.gz: b06ee6c0a19e37efde8008bd6fc9eee9ae4cb037290bddd4b973236751119f41e831ff2d7420547a9e4ec3e2db49f7c76d58180132cc611771f4afa125dcf64d
7
+ data.tar.gz: 9c75b77eb65607d63e4e9b2f0c57cd4b86e862235a1e669cef71589705cc00ada1dc2b50e6bf034d1a4b3044cd4f87031020452d0e53702622f5ce29eda4d42f
@@ -17,7 +17,7 @@ module Itriagetestrail
17
17
  attr_reader :external_results
18
18
 
19
19
  def initialize(testrail_config)
20
- @run_id = 0
20
+ @run_id = @testrail_config[:run_id] || 0
21
21
  @setup = false
22
22
  @testrail_config = testrail_config
23
23
  @milestone_name = normalize_milestone
@@ -63,7 +63,7 @@ module Itriagetestrail
63
63
 
64
64
  @milestone_id = fetch_milestone(@milestone_name)
65
65
 
66
- add_testrail_run
66
+ add_testrail_run if @run_id == 0
67
67
 
68
68
  @pool = Pool.new(1)
69
69
 
@@ -286,17 +286,6 @@ module Itriagetestrail
286
286
  }
287
287
  end
288
288
 
289
- def close_run?()
290
-
291
- # always close the run unless specified otherwise
292
- if @testrail_config[:close_run] == 'false'
293
- close_run = false
294
- else
295
- close_run = true
296
- end
297
- close_run
298
- end
299
-
300
289
  # this is the hack at very end to exclude tests which frameworks like MiniTest and Cucumber did not touch
301
290
  # including all tests at beginning is necessary so that at least some progress can be seen when
302
291
  # real time updating is enabled.
@@ -307,11 +296,24 @@ module Itriagetestrail
307
296
  @client.send_post("update_run/#{@run_id}", send)
308
297
  end
309
298
 
299
+ def close_run?()
300
+ # do not close a run if a run id was supplied. other test suites related to the job will need it.
301
+ close_run = false
302
+ if @testrail_config[:close_run] == 'true' && (@testrail_config[:run_id].nil? || @testrail_config[:run_id] == '')
303
+ close_run = true
304
+ end
305
+ close_run
306
+ end
307
+
308
+ def close_run
309
+ @client.send_post("close_run/#{@run_id}", {})
310
+ end
311
+
310
312
  def shutdown
311
313
  @pool.shutdown
312
314
 
313
315
  update_test_run
314
- @client.send_post("close_run/#{@run_id}", {}) if close_run?
316
+ close_run if close_run?
315
317
  end
316
318
  end
317
319
  end
@@ -1,3 +1,3 @@
1
1
  module Itriagetestrail
2
- VERSION = '0.2.8'
2
+ VERSION = '0.2.9'
3
3
  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.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - a801069
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler