itriagetestrail 0.5.6 → 0.5.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: ea04d20269a32127e018fcda73847c6ecb930980
4
- data.tar.gz: 88a09c75c21d9039a2b4d5fa3ea6044ecfe3cd65
3
+ metadata.gz: d32153f293772e4cd7039291efbf8d2322936569
4
+ data.tar.gz: ba3fded85ace915ef98374b2e87fb42cebba95cd
5
5
  SHA512:
6
- metadata.gz: c25ba4474d89e566f8efed344b0af75b44ec51d33261cfa8faf105e4831244035197a9f7f9026dddcc1fba88f75098d9bc24053e68b18dd222321bcba2e87e8b
7
- data.tar.gz: 300b461fed5dd87765515c6ab46a0c9b525df0308c9af8f6399737e2c3e9e0be0372d0716262467757e5953a428f2fc3bbf149f098d77183c6396779383488a2
6
+ metadata.gz: 673ee94958fa75488a4f43446b87dca4da68b46fa4ba4482184f81c86de2fcbb628c16dbbccad964f4495b6554210261e7cc2ae1884000ae6e5a80ff0d86452f
7
+ data.tar.gz: 92da52ea6355ea365aaefa997f06982b9e9daca40649b7665f9c8128ab3d04810048dd3f6bc9e9459b7a4a98063ffc48743b5191de040c4ffd72b47fe7e59f74
@@ -0,0 +1,59 @@
1
+ require 'itriagetestrail'
2
+ module Itriagetestrail
3
+ class TRCucumber < TestRailInterface
4
+
5
+ def initialize
6
+ if ENV['TZINFO_TIME_ZONE'].nil? || ENV['TZINFO_TIME_ZONE'].empty?
7
+ time_zone = 'America/Denver'
8
+ else
9
+ time_zone = ENV['TZINFO_TIME_ZONE']
10
+ end
11
+
12
+ @testrail_config = {
13
+ site: ENV['TESTRAIL_SITE'],
14
+ user: ENV['TESTRAIL_USER'],
15
+ password: ENV['TESTRAIL_PASSWORD'],
16
+ tzinfoTimeZone: time_zone,
17
+ projectId: ENV['TESTRAIL_PROJECT_ID'],
18
+ projectName: ENV['UTOPIA_NAME'],
19
+ run_id: ENV['TESTRAIL_RUN_ID'],
20
+ close_run: ENV['TESTRAIL_CLOSE_RUN'],
21
+ origin: ENV['GIT_BRANCH'],
22
+ jenkinsBuild: ENV['BUILD_NUMBER'],
23
+ appVersion: nil
24
+ }
25
+ super(@testrail_config)
26
+ end
27
+
28
+ def record_result(scenario)
29
+ return if execute == false
30
+ if scenario.class == Cucumber::RunningTestCase::ScenarioOutlineExample
31
+ @external_id = "#{scenario.feature.short_name};#{scenario.name};#{scenario.cell_values}"[0,249]
32
+ else
33
+ @external_id = "#{scenario.feature.short_name};#{scenario.name}"
34
+ end
35
+ @scenario_title = scenario.name
36
+
37
+ steps = []
38
+
39
+ scenario.test_steps.select{'name'}.each { |name| steps << name.name unless name.name == 'Before hook' }
40
+ @scenario_steps = steps.each { |step| step }.join('\n')
41
+
42
+ if scenario.passed?
43
+ store_result(@scenario_title, @external_id, @scenario_steps, 1, '')
44
+ else
45
+ store_result(@scenario_title, @external_id, @scenario_steps, "#{ENV['RERUN'] ? 5 : 4}".to_i, "#{scenario.exception.class}\n#{scenario.exception}\n#{scenario.exception.backtrace}")
46
+ end
47
+ update_test_run
48
+ send_results_to_testrail
49
+ end
50
+
51
+ def shutdown
52
+ if execute
53
+ sleep 3 # testrail service rate limit precaution
54
+ send_results_to_testrail
55
+ super
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,48 @@
1
+ require 'itriagetestrail'
2
+ module Itriagetestrail
3
+ class TRMiniTest < TestRailInterface
4
+
5
+ def initialize
6
+ if ENV['TZINFO_TIME_ZONE'].nil? || ENV['TZINFO_TIME_ZONE'].empty?
7
+ time_zone = 'America/Denver'
8
+ else
9
+ time_zone = ENV['TZINFO_TIME_ZONE']
10
+ end
11
+
12
+ @testrail_config = {
13
+ site: ENV['TESTRAIL_SITE'],
14
+ user: ENV['TESTRAIL_USER'],
15
+ password: ENV['TESTRAIL_PASSWORD'],
16
+ tzinfoTimeZone: time_zone,
17
+ projectId: ENV['TESTRAIL_PROJECT_ID'],
18
+ projectName: ENV['UTOPIA_NAME'],
19
+ run_id: ENV['TESTRAIL_RUN_ID'],
20
+ close_run: ENV['TESTRAIL_CLOSE_RUN'],
21
+ origin: ENV['GIT_BRANCH'],
22
+ jenkinsBuild: ENV['BUILD_NUMBER'],
23
+ appVersion: nil
24
+ }
25
+ super(@testrail_config)
26
+ end
27
+
28
+ def record_result(test, name, failures)
29
+ return if execute == false
30
+ @external_id = "#{test.class}##{name}"
31
+ if self.passed?
32
+ store_result(name, @external_id, '', 1, '')
33
+ elsif failures.inspect.include? 'Minitest::Skip'
34
+ store_result(name, @external_id, '', 6, failures.inspect)
35
+ else
36
+ store_result(name, @external_id, '', 5, failures.inspect)
37
+ end
38
+ end
39
+
40
+ def shutdown
41
+ if execute
42
+ sleep 3 # testrail service rate limit precaution
43
+ send_results_to_testrail
44
+ super
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,3 +1,3 @@
1
1
  module Itriagetestrail
2
- VERSION = '0.5.6'
2
+ VERSION = '0.5.7'
3
3
  end
@@ -2,8 +2,6 @@ require_relative 'itriagetestrail/version'
2
2
  require_relative 'itriagetestrail/testrail_binding'
3
3
 
4
4
  require_relative 'itriagetestrail/pool'
5
- require_relative 'itriagetestrail/trcucumber'
6
- require_relative 'itriagetestrail/trminitest'
7
5
 
8
6
  require 'tzinfo'
9
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itriagetestrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - a801069
@@ -61,6 +61,8 @@ files:
61
61
  - lib/itriagetestrail.rb
62
62
  - lib/itriagetestrail/pool.rb
63
63
  - lib/itriagetestrail/testrail_binding.rb
64
+ - lib/itriagetestrail/trcucumber.rb
65
+ - lib/itriagetestrail/trminitest.rb
64
66
  - lib/itriagetestrail/version.rb
65
67
  homepage:
66
68
  licenses: []