robottelo_reporter 0.1.0 → 0.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28343a033673607e7759c1118e011afd5a5c739a
|
4
|
+
data.tar.gz: 78c9e043cd0fd10b08531861530cc51372e37623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fc843156d11b791c00a38f3592242a5ca8ff3fb6e373e2b08d7a3c3b74de9f76115ec2f926b99fcb14e5df57476a60f9dd384dc1f15315d0c6a793489e2b299
|
7
|
+
data.tar.gz: 6177988abb4e2dcaf25431cc6435c03a029db707438468402d36d4b67fc177fb61c185333ee6f5d25018ee4467a521a80f3ac4ba0bc4aef1ca3594183417a82e
|
data/lib/robottelo/reporter.rb
CHANGED
@@ -15,16 +15,17 @@ module Robottelo
|
|
15
15
|
def initialize(io = $stdout, options = {})
|
16
16
|
@io = io
|
17
17
|
@options = options
|
18
|
-
report_file_name = ENV[
|
19
|
-
ci_reports_path = ENV[
|
18
|
+
report_file_name = ENV[ENV_ROBOTTELO_REPORT_NAME] || "robottelo-results.xml"
|
19
|
+
ci_reports_path = ENV[ENV_CI_REPORTS] || File.expand_path("#{Dir.getwd}/test/reports")
|
20
20
|
report_dir = "#{ci_reports_path}/robottelo"
|
21
|
-
report_file_path = ENV[
|
21
|
+
report_file_path = ENV[ENV_ROBOTTELO_REPORT_PATH] || "#{report_dir}/#{report_file_name}"
|
22
22
|
@report_file_path = File.expand_path(report_file_path)
|
23
23
|
@io.puts 'Robottelo Reporter initialization'
|
24
24
|
@xml_results = Robottelo::Reporter::ResultsToXML.new
|
25
25
|
@last_test_properties = {}
|
26
26
|
@last_test_klass = nil
|
27
27
|
@last_test_meth = nil
|
28
|
+
@last_test_meth = nil
|
28
29
|
end
|
29
30
|
|
30
31
|
def start
|
@@ -40,7 +41,7 @@ module Robottelo
|
|
40
41
|
end
|
41
42
|
|
42
43
|
def record(result)
|
43
|
-
pid = @last_test_properties[
|
44
|
+
pid = @last_test_properties[TEST_ATTRIBUTE_ID]
|
44
45
|
# record only if pid attribute exists
|
45
46
|
unless pid.nil?
|
46
47
|
test_result = Robottelo::Reporter::TestResult.new(
|
@@ -2,12 +2,16 @@
|
|
2
2
|
|
3
3
|
module Robottelo
|
4
4
|
module Reporter
|
5
|
+
TEST_ATTRIBUTE_ID = :pid
|
5
6
|
TESTCASE_PROPERTIES_MAPPING = {
|
6
7
|
pid: 'polarion-testcase-id'
|
7
8
|
}.freeze
|
8
9
|
end
|
9
10
|
PROPERTY_PREFIX = 'polarion'
|
10
11
|
PROPERTY_PREFIX_CUSTOM = 'polarion-custom'
|
11
|
-
|
12
|
-
|
12
|
+
ENV_POLARION_PROPERTIES = 'POLARION_PROPERTIES'
|
13
|
+
ENV_POLARION_CUSTOM_PROPERTIES = 'POLARION_CUSTOM_PROPERTIES'
|
14
|
+
ENV_ROBOTTELO_REPORT_NAME = 'ROBOTTELO_REPORT_NAME'
|
15
|
+
ENV_ROBOTTELO_REPORT_PATH = 'ROBOTTELO_REPORT_PATH'
|
16
|
+
ENV_CI_REPORTS = 'CI_REPORTS'
|
13
17
|
end
|
@@ -34,7 +34,7 @@ module Robottelo
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def parse_main_properties
|
37
|
-
prp = parse_env_properties
|
37
|
+
prp = parse_env_properties ENV_POLARION_PROPERTIES, PROPERTY_PREFIX
|
38
38
|
response_key = "#{PROPERTY_PREFIX}-response"
|
39
39
|
if prp.key?(response_key)
|
40
40
|
response_value = prp[response_key].split('=')
|
@@ -45,7 +45,7 @@ module Robottelo
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def parse_custom_properties
|
48
|
-
prp = parse_env_properties
|
48
|
+
prp = parse_env_properties ENV_POLARION_CUSTOM_PROPERTIES, PROPERTY_PREFIX_CUSTOM
|
49
49
|
@properties = @properties.merge(prp)
|
50
50
|
end
|
51
51
|
end
|