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 +4 -4
- data/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb +37 -3
- data/lib/fastlane/plugin/test_center/actions/collate_junit_reports.rb +3 -2
- data/lib/fastlane/plugin/test_center/helper/correcting_scan_helper.rb +4 -4
- data/lib/fastlane/plugin/test_center/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 979f6d96d1cdb22dc92053f3a47baa48dce9572c
|
4
|
+
data.tar.gz: 5a0c8b22ffae814e74d983d926d4d31b815cab29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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!('<', '<')
|
54
|
+
test_details.gsub!('>', '>')
|
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 \
|
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:
|
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 \
|
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:
|
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]
|
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.
|
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-
|
11
|
+
date: 2018-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plist
|