fastlane-plugin-test_center 3.8.2 → 3.8.3

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
  SHA256:
3
- metadata.gz: 8dc24c07b13301a9e4d68341cf5056931458ab70f34aca5022b732e56f6b2977
4
- data.tar.gz: a78788cd1e13a5ae2451cad5b1eb05dbad5e8656c9f50a70987ca561d7f6145e
3
+ metadata.gz: ab8e9047e79e8003a28bbf3bbf33459cdef0d6f7181cf44ef96b6e7e20a737be
4
+ data.tar.gz: bee4f6229d998f9bb5a4e222188c5a90bcbe6393c53fb7f6727b28e5cad1a9fa
5
5
  SHA512:
6
- metadata.gz: 722389bcd79ac2c2d8c2f245ab047c5b1106f3eceb97c7dd956a2d8400241c8b9452a0ac08be12140c3446e894207f5a3a94c840769e4b8db5f524e36fca0107
7
- data.tar.gz: d63b1a638372df7d38995ed66f964e05dedecb42c92480b2719e80dae4516912df0507d74a4134fddc88a1169e3aa3047e74c6a8dfb58992718f891066f75a42
6
+ metadata.gz: cb04f526bf70711598d88edd5b74938d4f059e9ccc25c0d3d111dd7174df722163d903389e8cf357373b9736b92794549f94bbc13bb6a55be1d725959eec910e
7
+ data.tar.gz: 37c8f937c76530b5ac3f2e77dce500908e4869df91ce97d34d652aab127e38c756916ad5fea3fcda2f13c2eb90a2fdae69fd1f99f25f6e4bbdecc389fcd2c96f
@@ -64,7 +64,7 @@ module Fastlane
64
64
  end
65
65
 
66
66
  def self.testsuite_from_report(report, testsuite)
67
- testsuite_name = testsuite.attributes['id']
67
+ testsuite_name = testsuite.attribute('id').value
68
68
  REXML::XPath.first(report, "//section[contains(@class, 'test-suite') and @id='#{testsuite_name}']")
69
69
  end
70
70
 
@@ -117,11 +117,11 @@ module Fastlane
117
117
  failing_tests_xpath = "./*[contains(@class, 'tests')]//*[" \
118
118
  "contains(@class, 'failing')]"
119
119
 
120
- class_attributes = testsuite.attributes['class']
120
+ class_attributes = testsuite.attribute('class').value
121
121
  test_failures = REXML::XPath.match(testsuite, failing_tests_xpath)
122
122
  test_status = test_failures.size.zero? ? 'passing' : 'failing'
123
123
 
124
- testsuite.attributes['class'] = class_attributes.sub('failing', test_status)
124
+ testsuite.add_attribute('class', class_attributes.sub('failing', test_status))
125
125
  end
126
126
  end
127
127
 
@@ -18,7 +18,7 @@ module Fastlane
18
18
  preprocess_testsuites(report)
19
19
  UI.verbose("> collating last report file #{report_filepaths.last}")
20
20
  report.elements.each('//testsuite') do |testsuite|
21
- testsuite_name = testsuite.attributes['name']
21
+ testsuite_name = testsuite.attribute('name').value
22
22
  target_testsuite = REXML::XPath.first(target_report, "//testsuite[@name='#{testsuite_name}']")
23
23
  if target_testsuite
24
24
  UI.verbose(" > collating testsuite #{testsuite_name}")
@@ -50,8 +50,8 @@ module Fastlane
50
50
  while testcases_with_failures.size > 1
51
51
  target_testcase = testcases_with_failures.shift
52
52
 
53
- name = target_testcase.attributes['name']
54
- classname = target_testcase.attributes['classname']
53
+ name = target_testcase.attribute('name').value
54
+ classname = target_testcase.attribute('classname').value
55
55
 
56
56
  failures = REXML::XPath.match(testsuite, "testcase[@name='#{name}'][@classname='#{classname}']/failure")
57
57
  next unless failures.size > 1
@@ -68,7 +68,7 @@ module Fastlane
68
68
  end
69
69
 
70
70
  def self.flatten_duplicate_testsuites(report, testsuite)
71
- testsuite_name = testsuite.attributes['name']
71
+ testsuite_name = testsuite.attribute('name').value
72
72
  duplicate_testsuites = REXML::XPath.match(report, "//testsuite[@name='#{testsuite_name}']")
73
73
  if duplicate_testsuites.size > 1
74
74
  UI.verbose(" > flattening_duplicate_testsuites")
@@ -90,8 +90,8 @@ module Fastlane
90
90
 
91
91
  def self.collate_testsuite(target_testsuite, other_testsuite)
92
92
  other_testsuite.elements.each('testcase') do |testcase|
93
- classname = testcase.attributes['classname']
94
- name = testcase.attributes['name']
93
+ classname = testcase.attribute('classname').value
94
+ name = testcase.attribute('name').value
95
95
  target_testcase = REXML::XPath.first(target_testsuite, "testcase[@name='#{name}' and @classname='#{classname}']")
96
96
  # Replace target_testcase with testcase
97
97
  if target_testcase
@@ -110,15 +110,16 @@ module Fastlane
110
110
  end
111
111
 
112
112
  def self.increment_testable_tries(target_testable, other_testable)
113
- try_count = target_testable.attributes['retries'] || 1
114
- other_try_count = other_testable['retries'] || 1
115
113
 
116
- target_testable.attributes['retries'] = (try_count.to_i + other_try_count.to_i).to_s
114
+ try_count = target_testable.attribute('retries')&.value || 1
115
+ other_try_count = other_testable.attribute('retries')&.value || 1
116
+
117
+ target_testable.add_attribute('retries', (try_count.to_i + other_try_count.to_i).to_s)
117
118
  end
118
119
 
119
120
  def self.increment_testcase_tries(target_testcase, testcase)
120
- try_count = target_testcase.attributes['retries']
121
- testcase.attributes['retries'] = (try_count.to_i + 1).to_s
121
+ try_count = target_testcase.attribute('retries')&.value || 0
122
+ testcase.add_attribute('retries', (try_count.to_i + 1).to_s)
122
123
  end
123
124
 
124
125
  def self.update_testable_counts(testable)
@@ -126,28 +127,28 @@ module Fastlane
126
127
  test_count = 0
127
128
  failure_count = 0
128
129
  testsuites.each do |testsuite|
129
- test_count += testsuite.attributes['tests'].to_i
130
- failure_count += testsuite.attributes['failures'].to_i
130
+ test_count += testsuite.attribute('tests').value.to_i
131
+ failure_count += testsuite.attribute('failures').value.to_i
131
132
  end
132
- testable.attributes['tests'] = test_count.to_s
133
- testable.attributes['failures'] = failure_count.to_s
133
+ testable.add_attribute('tests', test_count.to_s)
134
+ testable.add_attribute('failures', failure_count.to_s)
134
135
  end
135
136
 
136
137
  def self.update_testsuite_counts(testsuite)
137
138
  testcases = REXML::XPath.match(testsuite, 'testcase')
138
- testsuite.attributes['tests'] = testcases.size.to_s
139
+ testsuite.add_attribute('tests', testcases.size.to_s)
139
140
  failure_count = testcases.reduce(0) do |count, testcase|
140
141
  if REXML::XPath.first(testcase, 'failure')
141
142
  count += 1
142
143
  end
143
144
  count
144
145
  end
145
- testsuite.attributes['failures'] = failure_count.to_s
146
+ testsuite.add_attribute('failures', failure_count.to_s)
146
147
  end
147
148
 
148
149
  def self.attribute_sum_string(node1, node2, attribute)
149
- value1 = node1.attributes[attribute].to_i
150
- value2 = node2.attributes[attribute].to_i
150
+ value1 = node1.attribute(attribute).value.to_i
151
+ value2 = node2.attribute(attribute).value.to_i
151
152
  (value1 + value2).to_s
152
153
  end
153
154
 
@@ -73,7 +73,7 @@ module Fastlane
73
73
  failure_details.merge!(junit_results[:failure_details])
74
74
 
75
75
  report = REXML::Document.new(File.new(report_file))
76
- retry_total_count += (report.root.attributes['retries'] || 1).to_i
76
+ retry_total_count += (report.root.attribute('retries')&.value || 1).to_i
77
77
  end
78
78
 
79
79
  if reportnamer.includes_html?
@@ -32,7 +32,7 @@ module TestCenter
32
32
  end
33
33
 
34
34
  def name
35
- return @root.attributes['name']
35
+ return @root.attribute('name').value
36
36
  end
37
37
 
38
38
  def testsuites
@@ -50,7 +50,7 @@ module TestCenter
50
50
  end
51
51
 
52
52
  def name
53
- return @root.attributes['name']
53
+ return @root.attribute('name').value
54
54
  end
55
55
 
56
56
  def identifier
@@ -74,17 +74,17 @@ module TestCenter
74
74
 
75
75
  def initialize(xml_element)
76
76
  @root = xml_element
77
- name = xml_element.attributes['name']
77
+ name = xml_element.attribute('name').value
78
78
  failure_element = xml_element.elements['failure']
79
79
  if failure_element
80
- @message = failure_element.attributes['message'] || ''
80
+ @message = failure_element.attribute('message')&.value || ''
81
81
  @location = failure_element.text || ''
82
82
  end
83
- full_testsuite = xml_element.parent.attributes['name']
83
+ full_testsuite = xml_element.parent.attribute('name').value
84
84
  testsuite = full_testsuite.testsuite
85
85
  is_swift = full_testsuite.testsuite_swift?
86
86
 
87
- testable_filename = xml_element.parent.parent.attributes['name']
87
+ testable_filename = xml_element.parent.parent.attribute('name').value
88
88
  testable = File.basename(testable_filename, '.xctest')
89
89
  @identifier = "#{testable}/#{testsuite}/#{name}"
90
90
  @skipped_test = Xcodeproj::XCScheme::TestAction::TestableReference::SkippedTest.new
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module TestCenter
3
- VERSION = "3.8.2"
3
+ VERSION = "3.8.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-test_center
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.2
4
+ version: 3.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lyndsey Ferguson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-22 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json