robottelo_reporter 0.1.0 → 0.1.1

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: 87e6bc43f306af72e800e8162dbf96691b90e64b
4
- data.tar.gz: 6ad226edbd1d177860237412650fcb737cad9b5c
3
+ metadata.gz: 28343a033673607e7759c1118e011afd5a5c739a
4
+ data.tar.gz: 78c9e043cd0fd10b08531861530cc51372e37623
5
5
  SHA512:
6
- metadata.gz: 250a82700401d611cef32f59b3d5910a4fe794c2acee325fbad5e4888539aefe459c3464b8163ff211bb086ea9a97c23525d2475b618eb7cb78e7aab8c1e6ae5
7
- data.tar.gz: 63ff363033b80d603bc9c25a8df2b53a1b6887327f07f19a90d803d6aefe4f6e956a8a8596526209da834dcee54f95cb417e0133f6d905c2035e2cd632513437
6
+ metadata.gz: 1fc843156d11b791c00a38f3592242a5ca8ff3fb6e373e2b08d7a3c3b74de9f76115ec2f926b99fcb14e5df57476a60f9dd384dc1f15315d0c6a793489e2b299
7
+ data.tar.gz: 6177988abb4e2dcaf25431cc6435c03a029db707438468402d36d4b67fc177fb61c185333ee6f5d25018ee4467a521a80f3ac4ba0bc4aef1ca3594183417a82e
@@ -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['ROBOTTELO_REPORT_NAME'] || "robottelo-results.xml"
19
- ci_reports_path = ENV['CI_REPORTS'] || File.expand_path("#{Dir.getwd}/test/reports")
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['ROBOTTELO_REPORT_PATH'] || "#{report_dir}/#{report_file_name}"
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[:pid]
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
- POLARION_ENV_NAME = 'POLARION_PROPERTIES'
12
- POLARION_CUSTOM_ENV_NAME = 'POLARION_CUSTOM_PROPERTIES'
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 POLARION_ENV_NAME, PROPERTY_PREFIX
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 POLARION_CUSTOM_ENV_NAME, PROPERTY_PREFIX_CUSTOM
48
+ prp = parse_env_properties ENV_POLARION_CUSTOM_PROPERTIES, PROPERTY_PREFIX_CUSTOM
49
49
  @properties = @properties.merge(prp)
50
50
  end
51
51
  end
@@ -18,7 +18,7 @@ module Robottelo
18
18
  end
19
19
 
20
20
  def properties_to_xml(xml_builder)
21
- pid = properties[:pid]
21
+ pid = properties[TEST_ATTRIBUTE_ID]
22
22
  return if pid.nil?
23
23
  xml_builder.properties do
24
24
  TESTCASE_PROPERTIES_MAPPING.each do |key, name|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Robottelo
4
4
  module Reporter
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robottelo_reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Djebran Lezzoum