fastlane-plugin-test_center 3.2.5 → 3.2.6

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: 7055e4c4e362cf3647b591f874ae1cc561c34279
4
- data.tar.gz: a45fa48fe76822d543401ced301757a6243313a9
3
+ metadata.gz: 979f6d96d1cdb22dc92053f3a47baa48dce9572c
4
+ data.tar.gz: 5a0c8b22ffae814e74d983d926d4d31b815cab29
5
5
  SHA512:
6
- metadata.gz: ce30e5cabbe3a2583398aa9966183f6adc65727494c17a493b4d520c443f0fde8c85eff038251fb0689e76b7f154e0c8e5c5814c67451804cdc43da91e647a8a
7
- data.tar.gz: ad8780b6e25749ed2ae43c4f6c709002e4ceb3b358335453476c09de771ae74b4d317dfd22edaad67fb638a0653623e8d8ffce93b70dfb35ef4fbfa6c0131fc5
6
+ metadata.gz: 8e23bf8de429edee92f642f227a1d5beea919f8befb4173c09ce0e5731165d168d661235479dc52a3a21bc5599b5aaddf0499f32f69b7b52af4a1bcc6bf38afe
7
+ data.tar.gz: b459630434e7b4696a98f0cf1345edff9a520579d7b2d06bc011c973aceae4ffb3ab54ae4ce4de21b83990c8ef6e4c4ca0fae03edcc9283c5da0d3f920e8c282
@@ -6,7 +6,7 @@ module Fastlane
6
6
  if report_filepaths.size == 1
7
7
  FileUtils.cp(report_filepaths[0], params[:collated_report])
8
8
  else
9
- reports = report_filepaths.map { |report_filepath| REXML::Document.new(File.new(report_filepath)) }
9
+ reports = opened_reports(report_filepaths)
10
10
 
11
11
  # copy any missing testsuites
12
12
  target_report = reports.shift
@@ -26,6 +26,39 @@ module Fastlane
26
26
  end
27
27
  end
28
28
 
29
+ def self.opened_reports(report_filepaths)
30
+ report_filepaths.map do |report_filepath|
31
+ report = nil
32
+ repair_attempt = 0
33
+ begin
34
+ report = REXML::Document.new(File.new(report_filepath))
35
+ rescue REXML::ParseException
36
+ repair_attempt += 1
37
+ if repair_attempt < 2
38
+ repair_malformed_html(report_filepath)
39
+ retry
40
+ end
41
+ end
42
+ report
43
+ end
44
+ end
45
+
46
+ def self.repair_malformed_html(html_report_filepath)
47
+ html_file_contents = File.read(html_report_filepath)
48
+ File.open(html_report_filepath, 'w') do |file|
49
+ html_file_contents.each_line do |line|
50
+ m = %r{(<section class="test-detail[^"]*">)(.*(<|>).*)(</section>)}.match(line)
51
+ if m
52
+ test_details = m[2]
53
+ test_details.gsub!('<', '&lt;')
54
+ test_details.gsub!('>', '&gt;')
55
+ line = m[1] + test_details + m[4]
56
+ end
57
+ file.puts line
58
+ end
59
+ end
60
+ end
61
+
29
62
  def self.testsuite_from_report(report, testsuite)
30
63
  testsuite_name = testsuite.attributes['id']
31
64
  REXML::XPath.first(report, "//section[contains(@class, 'test-suite') and @id='#{testsuite_name}']")
@@ -168,10 +201,11 @@ module Fastlane
168
201
  "
169
202
  UI.important(
170
203
  'example: ' \\
171
- 'collate the html reports to a temporary file \'result.html\''
204
+ 'collate the html reports to a temporary file \"result.html\"'
172
205
  )
206
+ reports = Dir['../spec/fixtures/*.html'].map { |relpath| File.absolute_path(relpath) }
173
207
  collate_html_reports(
174
- reports: Dir['./spec/fixtures/*.html'],
208
+ reports: reports,
175
209
  collated_report: File.join(Dir.mktmpdir, 'result.html')
176
210
  )
177
211
  "
@@ -128,10 +128,11 @@ module Fastlane
128
128
  "
129
129
  UI.important(
130
130
  'example: ' \\
131
- 'collate the xml reports to a temporary file \'result.xml\''
131
+ 'collate the xml reports to a temporary file \"result.xml\"'
132
132
  )
133
+ reports = Dir['../spec/fixtures/*.xml'].map { |relpath| File.absolute_path(relpath) }
133
134
  collate_junit_reports(
134
- reports: Dir['./spec/fixtures/*.xml'],
135
+ reports: reports,
135
136
  collated_report: File.join(Dir.mktmpdir, 'result.xml')
136
137
  )
137
138
  "
@@ -145,13 +145,13 @@ module TestCenter
145
145
  tests_passed = true
146
146
  rescue FastlaneCore::Interface::FastlaneTestFailure => e
147
147
  FastlaneCore::UI.verbose("Scan failed with #{e}")
148
+ info = testrun_info(batch, try_count, reportnamer, scan_options[:output_directory])
149
+ @testrun_completed_block && @testrun_completed_block.call(
150
+ info
151
+ )
148
152
  if try_count < @try_count
149
153
  @retry_total_count += 1
150
154
 
151
- info = testrun_info(batch, try_count, reportnamer, scan_options[:output_directory])
152
- @testrun_completed_block && @testrun_completed_block.call(
153
- info
154
- )
155
155
  scan_options[:only_testing] = info[:failed].map(&:shellescape)
156
156
  FastlaneCore::UI.message('Re-running scan on only failed tests')
157
157
  if @scan_options[:result_bundle]
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module TestCenter
3
- VERSION = "3.2.5"
3
+ VERSION = "3.2.6"
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.2.5
4
+ version: 3.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lyndsey Ferguson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-01 00:00:00.000000000 Z
11
+ date: 2018-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plist