test_rail_integration 0.0.6 → 0.0.6.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/test_rail_integration/generator/API_client.rb +6 -6
- data/lib/test_rail_integration/generator/connection.rb +99 -16
- data/lib/test_rail_integration/generator/project/run_test_run.rb +13 -2
- data/lib/test_rail_integration/generator/project/test_rail_data.yml +7 -2
- data/lib/test_rail_integration/generator/test_case_result.rb +16 -12
- data/lib/test_rail_integration/generator/test_rail_data_load.rb +2 -2
- data/lib/test_rail_integration/generator/test_rail_hooks.rb +9 -7
- data/lib/test_rail_integration/generator/test_rail_tools.rb +9 -8
- data/lib/test_rail_integration/generator/test_run_creation.rb +49 -0
- data/lib/test_rail_integration/generator/test_run_parameters.rb +16 -10
- data/lib/test_rail_integration/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6263824e8e5d1a43a778b36cf67bbe5393bf3b5
|
4
|
+
data.tar.gz: 284c7b5c758ab95097f3576954a3fbbe3fad3299
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c51851ddf570b76059a2a5f477f5b6a4c4bbd2dc03608208fa3a53024982566aeb87efb2fda7605fc21d76019c8dff3f064bad9c72d4d6141acdb6f26ae0a80
|
7
|
+
data.tar.gz: 8a44411678195ea38890869efd3c9698988d60cd9133fd31560728c1ca4c0b1a45d9b90c12274f2dce0eea1d482acc162918e39dd0f528f75f165ccafdf8d780
|
@@ -14,8 +14,8 @@ require 'json'
|
|
14
14
|
|
15
15
|
module TestRail
|
16
16
|
class APIClient
|
17
|
-
@url
|
18
|
-
@user
|
17
|
+
@url = ''
|
18
|
+
@user = ''
|
19
19
|
@password = ''
|
20
20
|
|
21
21
|
attr_accessor :user
|
@@ -26,8 +26,8 @@ module TestRail
|
|
26
26
|
unless base_url.match(/\/$/)
|
27
27
|
base_url += '/'
|
28
28
|
end
|
29
|
-
@url
|
30
|
-
@user
|
29
|
+
@url = base_url + 'index.php?/api/v2/'
|
30
|
+
@user = connection_data[:username]
|
31
31
|
@password = connection_data[:password]
|
32
32
|
end
|
33
33
|
|
@@ -67,7 +67,7 @@ module TestRail
|
|
67
67
|
def _send_request(method, uri, data)
|
68
68
|
url = URI.parse(@url + uri)
|
69
69
|
if method == 'POST'
|
70
|
-
request
|
70
|
+
request = Net::HTTP::Post.new(url.path + '?' + url.query)
|
71
71
|
request.body = JSON.dump(data)
|
72
72
|
else
|
73
73
|
request = Net::HTTP::Get.new(url.path + '?' + url.query)
|
@@ -77,7 +77,7 @@ module TestRail
|
|
77
77
|
|
78
78
|
conn = Net::HTTP.new(url.host, url.port)
|
79
79
|
if url.scheme == 'https'
|
80
|
-
conn.use_ssl
|
80
|
+
conn.use_ssl = true
|
81
81
|
conn.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
82
82
|
end
|
83
83
|
response = conn.request(request)
|
@@ -5,13 +5,14 @@ require_relative 'test_case_result'
|
|
5
5
|
module TestRail
|
6
6
|
class Connection
|
7
7
|
|
8
|
-
ASSIGNED_TO
|
9
|
-
TEST_SUITE
|
8
|
+
ASSIGNED_TO ||= TestRailDataLoad.test_rail_data[:assigned_to]
|
9
|
+
TEST_SUITE ||= TestRailDataLoad.test_rail_data[:test_suite]
|
10
10
|
CONNECTION_DATA ||= TestRailDataLoad.test_rail_data[:connection_data]
|
11
|
-
PROJECT_ID
|
12
|
-
TEST_RUN_ID
|
13
|
-
IN_PROGRESS
|
14
|
-
|
11
|
+
PROJECT_ID ||= TestRailDataLoad.test_rail_data[:project]
|
12
|
+
TEST_RUN_ID ||= TestRailDataLoad.test_rail_data[:test_run_id]
|
13
|
+
IN_PROGRESS ||= TestRailDataLoad.test_rail_data[:in_progress]
|
14
|
+
TYPES ||= TestRailDataLoad.test_rail_data[:types]
|
15
|
+
NO_TEST_RAIL ||= 0
|
15
16
|
|
16
17
|
#
|
17
18
|
# Creates connection to TestRail server
|
@@ -41,17 +42,51 @@ module TestRail
|
|
41
42
|
client.send_get("get_results_for_case/#{test_run_id}/#{case_id}")
|
42
43
|
end
|
43
44
|
|
45
|
+
#
|
46
|
+
# Create test run in test rail for project with name
|
47
|
+
#
|
48
|
+
def self.create_test_run_with_name(name)
|
49
|
+
client.send_post("add_run/#{project_id}", {suite_id: test_suite_id, name: name, include_all: false, case_ids: cases_with_types})
|
50
|
+
end
|
51
|
+
|
44
52
|
#
|
45
53
|
# Parse results and returns Failed if this test was marked as failed.
|
46
54
|
#
|
47
55
|
def self.get_previous_test_result(case_id)
|
48
56
|
test_results = get_test_result(case_id).map { |status_hash| status_hash["status_id"] }
|
49
|
-
status
|
50
|
-
status
|
51
|
-
status
|
57
|
+
status = TestCaseResult::FAILED if test_results.include?(TestCaseResult::FAILED)
|
58
|
+
status ||= TestCaseResult::PASS if test_results.first == TestCaseResult::PASS
|
59
|
+
status ||= TestCaseResult::NEW
|
52
60
|
status
|
53
61
|
end
|
54
62
|
|
63
|
+
#
|
64
|
+
# Parse results and returns previous comment.
|
65
|
+
#
|
66
|
+
def self.get_previous_comments(case_id)
|
67
|
+
test_comment = get_test_result(case_id).map { |hash| hash["comment"] }
|
68
|
+
comment = test_comment
|
69
|
+
comment ||= []
|
70
|
+
comment
|
71
|
+
end
|
72
|
+
|
73
|
+
#
|
74
|
+
# Get indexes of failed results
|
75
|
+
#
|
76
|
+
def self.get_indexes_of_fails(test_case_id)
|
77
|
+
indexes = get_test_result(test_case_id).map.with_index { |result, index| result["status_id"] == TestCaseResult::COMMENT[:fail][:status] ? index : nil }
|
78
|
+
indexes.compact
|
79
|
+
end
|
80
|
+
|
81
|
+
#
|
82
|
+
# Get last failed comment for test case
|
83
|
+
#
|
84
|
+
def self.get_last_failed_comment(test_case_id)
|
85
|
+
comments = get_previous_comments(test_case_id)
|
86
|
+
index = Connection.get_indexes_of_fails(test_case_id).first
|
87
|
+
comments[index]
|
88
|
+
end
|
89
|
+
|
55
90
|
#
|
56
91
|
# Get ID of all test cases from current test run
|
57
92
|
#
|
@@ -70,24 +105,49 @@ module TestRail
|
|
70
105
|
end
|
71
106
|
|
72
107
|
#
|
73
|
-
#
|
108
|
+
# Setting test run id value
|
74
109
|
#
|
75
110
|
def self.test_run_id
|
76
111
|
@test_run_id ||= TEST_RUN_ID
|
77
112
|
end
|
78
113
|
|
114
|
+
#
|
115
|
+
# Setting project id
|
116
|
+
#
|
117
|
+
def self.project_id
|
118
|
+
@project_id ||= PROJECT_ID
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
#
|
123
|
+
# Setting test suite id
|
124
|
+
#
|
125
|
+
def self.test_suite_id
|
126
|
+
@test_suite_id ||= TEST_SUITE
|
127
|
+
end
|
128
|
+
|
79
129
|
#
|
80
130
|
# Getting information about test run
|
81
131
|
#
|
82
|
-
def self.test_run_data
|
83
|
-
client.send_get("get_run/#{
|
132
|
+
def self.test_run_data(id_of_run=test_run_id)
|
133
|
+
client.send_get("get_run/#{id_of_run}")
|
84
134
|
end
|
85
135
|
|
86
136
|
#
|
87
137
|
# Get test run name
|
88
138
|
#
|
89
|
-
def self.test_run_name
|
90
|
-
test_run_data["name"]
|
139
|
+
def self.test_run_name(id_of_run=test_run_id)
|
140
|
+
test_run_data(id_of_run)["name"]
|
141
|
+
end
|
142
|
+
|
143
|
+
#
|
144
|
+
# Take all test types
|
145
|
+
#
|
146
|
+
def self.cases_with_types
|
147
|
+
types = TYPES
|
148
|
+
cases = client.send_get("get_cases/#{project_id}&suite_id=#{test_suite_id}&type_id=#{types}")
|
149
|
+
case_ids = cases.map { |test_case| test_case["id"] }
|
150
|
+
case_ids
|
91
151
|
end
|
92
152
|
|
93
153
|
#
|
@@ -95,9 +155,32 @@ module TestRail
|
|
95
155
|
#
|
96
156
|
# VN LIVE_TEST in progress => VN LIVE_TEST
|
97
157
|
#
|
98
|
-
def self.change_test_run_name
|
158
|
+
def self.change_test_run_name(run_id = test_run_id)
|
99
159
|
new_name = test_run_name.gsub(IN_PROGRESS, "")
|
100
|
-
client.send_post("update_run/#{
|
160
|
+
client.send_post("update_run/#{run_id}", {name: new_name})
|
101
161
|
end
|
162
|
+
|
163
|
+
#
|
164
|
+
# Send request for creation test run with name
|
165
|
+
# ("add_run/3", {suite_id: 3, name "New test run", include_all: false, case_ids: C31, C32, C33}
|
166
|
+
#
|
167
|
+
def self.create_new_test_run_with_name
|
168
|
+
client.send_post("add_run/#{project_id}", {suite_id: test_suite_id, name: generate_test_run_name, include_all: false, case_ids: cases_with_types})
|
169
|
+
end
|
170
|
+
|
171
|
+
#
|
172
|
+
# Get all test runs for project
|
173
|
+
#
|
174
|
+
def self.get_test_runs
|
175
|
+
client.send_get("get_runs/#{project_id}")
|
176
|
+
end
|
177
|
+
|
178
|
+
#
|
179
|
+
# Generate name for test run with date
|
180
|
+
#
|
181
|
+
def self.generate_test_run_name
|
182
|
+
"Automation testrun #{Time.now.strftime("%d/%m/%Y")}"
|
183
|
+
end
|
184
|
+
|
102
185
|
end
|
103
186
|
end
|
@@ -4,6 +4,7 @@ require 'test_rail_integration'
|
|
4
4
|
require 'thor'
|
5
5
|
require 'test_rail_integration/generator/API_client'
|
6
6
|
require 'test_rail_integration/generator/connection'
|
7
|
+
require 'test_rail_integration/generator/test_run_creation'
|
7
8
|
require 'test_rail_integration/generator/test_rail_tools'
|
8
9
|
|
9
10
|
module TestRail
|
@@ -11,7 +12,17 @@ module TestRail
|
|
11
12
|
TestRailIntegration::TestTail::Generators::Project.copy_file("test_rail_data.yml")
|
12
13
|
raise "Please fill all required data in test rail data yml file"
|
13
14
|
end
|
14
|
-
|
15
|
-
|
15
|
+
|
16
|
+
parameters = ARGV
|
17
|
+
#TODO Make Hash instead of array for parameters
|
18
|
+
if parameters[0] == 'auto'
|
19
|
+
environment_for_run = parameters[1], parameters[2]
|
20
|
+
id_of_run = TestRunCreation.initialize_test_run
|
21
|
+
else
|
22
|
+
id_of_run = parameters[0].to_i
|
23
|
+
name_of_environment = Connection.test_run_name(id_of_run).downcase.match(/(#{TestRunParameters::VENTURE_REGEX}) (#{TestRunParameters::ENVIRONMENT_REGEX})*/)
|
24
|
+
environment_for_run = name_of_environment[1], name_of_environment[2] if name_of_environment
|
25
|
+
end
|
26
|
+
TestRailTools.prepare_config(id_of_run, environment_for_run)
|
16
27
|
end
|
17
28
|
|
@@ -14,8 +14,8 @@
|
|
14
14
|
:test_failed: 5
|
15
15
|
:new_test: 0
|
16
16
|
|
17
|
-
:test_passed_comment: "**passed:**"
|
18
|
-
:test_failed_comment: "**failed:**"
|
17
|
+
:test_passed_comment: "test **passed:**"
|
18
|
+
:test_failed_comment: "test **failed:**"
|
19
19
|
|
20
20
|
:ventures: vn|id|ph|my|sg|th #values for generating parametrized url for running test
|
21
21
|
:environments: live_test|staging|showroom #values for generating parametrized url for running test
|
@@ -23,3 +23,8 @@
|
|
23
23
|
:in_progress: " (in progress)" #value for changing test run name for monitoring complete of test run
|
24
24
|
|
25
25
|
:test_run_id: 0 #parametrized test run from "ruby run_test_run.rb <test run number>"
|
26
|
+
|
27
|
+
:exec_command: "cucumber -p lazada.#{parameters.venture}.#{parameters.environment} TESTRAIL=1 --color -f json -o cucumber.json -t "
|
28
|
+
|
29
|
+
:types: #types for filtering from Test Rail
|
30
|
+
|
@@ -3,23 +3,26 @@ require_relative 'test_rail_data_load'
|
|
3
3
|
module TestRail
|
4
4
|
class TestCaseResult
|
5
5
|
|
6
|
-
attr_accessor :test_case_id, :title, :comment, :exception_message
|
6
|
+
attr_accessor :test_case_id, :title, :comment, :exception_message, :assign_to, :previous_comment
|
7
7
|
|
8
8
|
COMMENT_STATUS ||= TestRail::TestRailDataLoad.test_rail_data[:status_comment]
|
9
|
-
PASS
|
10
|
-
FAILED
|
11
|
-
NEW
|
12
|
-
PASS_COMMENT
|
9
|
+
PASS ||= TestRail::TestRailDataLoad.test_rail_data[:test_pass]
|
10
|
+
FAILED ||= TestRail::TestRailDataLoad.test_rail_data[:test_failed]
|
11
|
+
NEW ||= TestRail::TestRailDataLoad.test_rail_data[:new_test]
|
12
|
+
PASS_COMMENT ||= TestRail::TestRailDataLoad.test_rail_data[:test_passed_comment]
|
13
13
|
FAILED_COMMENT ||= TestRail::TestRailDataLoad.test_rail_data[:test_failed_comment]
|
14
|
+
ASSIGN_TO ||= TestRail::TestRailDataLoad.test_rail_data[:assign_to]
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
|
17
|
+
COMMENT ||= {:pass => {status: PASS, comment: PASS_COMMENT},
|
18
|
+
:fail => {status: FAILED, comment: FAILED_COMMENT},
|
19
|
+
:unchanged_pass => {status: COMMENT_STATUS, comment: PASS_COMMENT}
|
18
20
|
}
|
19
21
|
|
20
22
|
def initialize(test_case_id, title)
|
21
23
|
self.test_case_id = test_case_id
|
22
|
-
self.title
|
24
|
+
self.title = title
|
25
|
+
self.previous_comment = TestRail::Connection.get_last_failed_comment(test_case_id) unless Connection.get_indexes_of_fails(test_case_id).empty?
|
23
26
|
end
|
24
27
|
|
25
28
|
#
|
@@ -30,10 +33,11 @@ module TestRail
|
|
30
33
|
def to_test_rail_api
|
31
34
|
comment_message = "#{self.comment[:comment]} \"#{self.title}\""
|
32
35
|
comment_message += "\n Exception : #{self.exception_message}" unless self.exception_message.nil?
|
33
|
-
if
|
34
|
-
|
36
|
+
comment_message += "\n #{self.previous_comment}" if self.comment[:status] == COMMENT[:fail][:status] || self.comment[:status] == COMMENT[:unchanged_pass][:status]
|
37
|
+
if self.comment[:status] == COMMENT_STATUS
|
38
|
+
{comment: comment_message}
|
35
39
|
else
|
36
|
-
{
|
40
|
+
{status_id: self.comment[:status], comment: comment_message}
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
@@ -2,13 +2,13 @@ require 'yaml'
|
|
2
2
|
|
3
3
|
module TestRail
|
4
4
|
class TestRailDataLoad
|
5
|
-
|
5
|
+
TEST_RAIL_FILE_CONFIG_PATH ||= ('config/data/test_rail_data.yml')
|
6
6
|
|
7
7
|
#
|
8
8
|
# Loading of test rail information
|
9
9
|
#
|
10
10
|
def self.test_rail_data
|
11
|
-
YAML.load(File.open(
|
11
|
+
YAML.load(File.open(TEST_RAIL_FILE_CONFIG_PATH))
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -9,21 +9,23 @@ module TestRail
|
|
9
9
|
def self.update_test_rail(scenario)
|
10
10
|
test_case_id = scenario.source_tag_names.find { |e| e.match(TEST_RAIL_ID_REGEX) }[2..-1]
|
11
11
|
|
12
|
-
prev_result
|
13
|
-
|
14
|
-
test_case_result
|
12
|
+
prev_result = TestRail::Connection.get_previous_test_result(test_case_id)
|
13
|
+
run_result = scenario.passed?
|
14
|
+
test_case_result = TestRail::TestCaseResult.new(test_case_id, scenario.title)
|
15
15
|
|
16
|
-
test_case_result.comment = TestRail::TestCaseResult::COMMENT[:pass] if passed_result?(
|
17
|
-
test_case_result.comment ||= TestRail::TestCaseResult::COMMENT[:unchanged_pass] if unchanged_pass_result?(
|
16
|
+
test_case_result.comment = TestRail::TestCaseResult::COMMENT[:pass] if passed_result?(run_result, prev_result)
|
17
|
+
test_case_result.comment ||= TestRail::TestCaseResult::COMMENT[:unchanged_pass] if unchanged_pass_result?(run_result, prev_result)
|
18
18
|
|
19
|
-
if failed_result?(
|
19
|
+
if failed_result?(run_result)
|
20
20
|
test_case_result.comment ||= TestRail::TestCaseResult::COMMENT[:fail]
|
21
21
|
test_case_result.exception_message = scenario.steps.exception rescue nil
|
22
|
+
test_case_result.assign_to = TestRail::TestCaseResult::ASSIGN_TO
|
22
23
|
end
|
23
24
|
|
24
|
-
raise("
|
25
|
+
raise("Invalid test case result : scenario.passed? #{scenario.passed?}, prev_result? #{prev_result}, run_result? #{run_result}") if test_case_result.comment.nil?
|
25
26
|
|
26
27
|
TestRail::Connection.commit_test_result(test_case_result)
|
28
|
+
|
27
29
|
end
|
28
30
|
|
29
31
|
def self.failed_result?(result)
|
@@ -10,13 +10,14 @@ module TestRail
|
|
10
10
|
#
|
11
11
|
# generate_cucumber_execution_file(2)
|
12
12
|
#
|
13
|
-
# cucumber -p
|
13
|
+
# cucumber -p profile.vn.live_test TESTRAIL=1 --color -f json -o cucumber.json -t @C666,@C777,@C555
|
14
14
|
#
|
15
15
|
# change this method for create your own cucumber executable
|
16
16
|
#
|
17
|
-
def self.generate_cucumber_execution_file(id_of_run)
|
18
|
-
parameters
|
19
|
-
|
17
|
+
def self.generate_cucumber_execution_file(id_of_run, env = nil)
|
18
|
+
parameters = TestRunParameters.new(env)
|
19
|
+
#TODO do smth with weird replacement
|
20
|
+
command = parameters.command.gsub("\#{parameters.venture}", parameters.venture).gsub("\#{parameters.environment}", parameters.environment) + Connection.cases_id(id_of_run).map { |id| "@C"+id.to_s }.join(",")
|
20
21
|
cucumber_file = File.new("cucumber_run.sh", "w")
|
21
22
|
cucumber_file.chmod(0700)
|
22
23
|
cucumber_file.write("#!/bin/sh\n")
|
@@ -28,8 +29,8 @@ module TestRail
|
|
28
29
|
# Writing test run ID into test rail data file
|
29
30
|
#
|
30
31
|
def self.write_test_run_id(test_run_id)
|
31
|
-
test_rail_data_file = File.read(TestRailDataLoad::
|
32
|
-
config_file
|
32
|
+
test_rail_data_file = File.read(TestRailDataLoad::TEST_RAIL_FILE_CONFIG_PATH).gsub(/^:test_run_id:.*/, ":test_run_id: #{test_run_id}")
|
33
|
+
config_file = File.open(TestRailDataLoad::TEST_RAIL_FILE_CONFIG_PATH, "w")
|
33
34
|
config_file.write (test_rail_data_file)
|
34
35
|
config_file.close
|
35
36
|
end
|
@@ -37,10 +38,10 @@ module TestRail
|
|
37
38
|
#
|
38
39
|
# Preparation for create right cucumber executable file
|
39
40
|
#
|
40
|
-
def self.prepare_config(run_id)
|
41
|
+
def self.prepare_config(run_id, env = nil)
|
41
42
|
Connection.test_run_id = run_id
|
42
43
|
write_test_run_id(run_id)
|
43
|
-
generate_cucumber_execution_file(run_id)
|
44
|
+
generate_cucumber_execution_file(run_id, env)
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative 'test_rail_data_load'
|
2
|
+
require_relative 'connection'
|
3
|
+
require_relative 'test_run_parameters'
|
4
|
+
|
5
|
+
module TestRail
|
6
|
+
class TestRunCreation
|
7
|
+
|
8
|
+
#
|
9
|
+
# Get all test run names for project
|
10
|
+
#
|
11
|
+
def self.get_test_runs_names
|
12
|
+
test_runs = Connection.get_test_runs
|
13
|
+
test_runs_names = []
|
14
|
+
test_runs.each { |test_run| test_runs_names.push(test_run.fetch("name")) }
|
15
|
+
test_runs_names
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# Get id for new test run that we created
|
20
|
+
#
|
21
|
+
def self.get_created_test_run_id
|
22
|
+
test_runs = Connection.get_test_runs
|
23
|
+
created_test_run_id = test_runs.map { |test_run|
|
24
|
+
test_run.fetch("id") if test_run.fetch("name").eql? Connection.generate_test_run_name
|
25
|
+
}
|
26
|
+
TestRailTools.write_test_run_id(created_test_run_id.first)
|
27
|
+
created_test_run_id.first
|
28
|
+
end
|
29
|
+
|
30
|
+
#
|
31
|
+
# Checking that test run already created
|
32
|
+
#
|
33
|
+
def self.check_presence_of_test_run
|
34
|
+
TestRunCreation.get_test_runs_names.include? Connection.generate_test_run_name
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Check and create test run
|
39
|
+
#
|
40
|
+
def self.initialize_test_run
|
41
|
+
unless TestRunCreation.check_presence_of_test_run
|
42
|
+
Connection.create_new_test_run_with_name
|
43
|
+
end
|
44
|
+
TestRunCreation.get_created_test_run_id
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -2,22 +2,28 @@ require_relative 'API_client'
|
|
2
2
|
|
3
3
|
module TestRail
|
4
4
|
class TestRunParameters
|
5
|
-
VENTURE_REGEX
|
5
|
+
VENTURE_REGEX ||= TestRail::TestRailDataLoad.test_rail_data[:ventures]
|
6
6
|
ENVIRONMENT_REGEX ||= TestRail::TestRailDataLoad.test_rail_data[:environments]
|
7
|
+
CHECK_TEST_RUN_NAME ||= TestRail::TestRailDataLoad.test_rail_data[:check_test_run_name]
|
8
|
+
EXEC_COMMAND ||= TestRail::TestRailDataLoad.test_rail_data[:exec_command]
|
7
9
|
|
8
|
-
attr_accessor :environment, :venture
|
10
|
+
attr_accessor :environment, :venture, :command
|
9
11
|
|
10
12
|
#
|
11
|
-
# Checking of correct naming of created test run and return parameters for
|
13
|
+
# Checking of correct naming of created test run and return parameters for running test run
|
12
14
|
#
|
13
|
-
def initialize
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
def initialize(env=nil)
|
16
|
+
@venture = ""
|
17
|
+
@environment = ""
|
18
|
+
if env
|
19
|
+
if env[0]
|
20
|
+
@venture = env[0] if env[0].match(/(#{VENTURE_REGEX})/)
|
21
|
+
end
|
22
|
+
if env[1]
|
23
|
+
@environment = env[1] if env[1].match(/(#{ENVIRONMENT_REGEX})/)
|
24
|
+
end
|
20
25
|
end
|
26
|
+
@command = EXEC_COMMAND
|
21
27
|
end
|
22
28
|
end
|
23
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_rail_integration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.6
|
4
|
+
version: 0.0.6.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirikami
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- lib/test_rail_integration/generator/test_rail_data_load.rb
|
174
174
|
- lib/test_rail_integration/generator/test_rail_hooks.rb
|
175
175
|
- lib/test_rail_integration/generator/test_rail_tools.rb
|
176
|
+
- lib/test_rail_integration/generator/test_run_creation.rb
|
176
177
|
- lib/test_rail_integration/generator/test_run_parameters.rb
|
177
178
|
- lib/test_rail_integration/version.rb
|
178
179
|
- test_rail_integration.gemspec
|