fastlane-plugin-test_center 3.14.2 → 3.14.3
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 +2 -1
- data/lib/fastlane/plugin/test_center/actions/collate_junit_reports.rb +17 -4
- data/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb +26 -0
- data/lib/fastlane/plugin/test_center/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e081e2a0d9d6bcb59c38f24072eb0059edef4457f03fed6e2318930260e9f5a4
|
4
|
+
data.tar.gz: 681403d6200f5d943e28f9c3fa6b90a6f450d7a9252c476eb7cf77c7e0c6101d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98e979a4fbafe31e6dc33bd1a3a94a1e1da316ce8226c3688e9d223461a33c5d75c9291dc837e256c227915959547f8964df38c524e40b45742408235ee94713
|
7
|
+
data.tar.gz: 3049728d26e108dea44480f7445e41be419f4189e3bb2b63b8cef7871a9d7bf58b5edcee01351dc40496209f6805706bfcb0b6cf08b9fee6c43bba1decbfecda
|
@@ -44,9 +44,10 @@ module Fastlane
|
|
44
44
|
html_file_contents = File.read(html_report_filepath)
|
45
45
|
File.open(html_report_filepath, 'w') do |file|
|
46
46
|
html_file_contents.each_line do |line|
|
47
|
-
m = %r{(<section class="test-detail[^"]*">)(.*(
|
47
|
+
m = %r{(<section class="test-detail[^"]*">)(.*(<|>|&(?!amp;)).*)(</section>)}.match(line)
|
48
48
|
if m
|
49
49
|
test_details = m[2]
|
50
|
+
test_details.gsub!(/&(?!amp;)/, '&')
|
50
51
|
test_details.gsub!('<', '<')
|
51
52
|
test_details.gsub!('>', '>')
|
52
53
|
line = m[1] + test_details + m[4]
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
3
|
class CollateJunitReportsAction < Action
|
4
|
+
require 'set'
|
4
5
|
|
5
6
|
def self.run(params)
|
6
7
|
report_filepaths = params[:reports]
|
@@ -9,17 +10,27 @@ module Fastlane
|
|
9
10
|
else
|
10
11
|
UI.verbose("collate_junit_reports with #{report_filepaths}")
|
11
12
|
reports = report_filepaths.map { |report_filepath| REXML::Document.new(File.new(report_filepath)) }
|
13
|
+
packages = reports.map { |r| r.root.attribute('name').value }.uniq
|
14
|
+
combine_multiple_targets = packages.size > 1
|
15
|
+
|
12
16
|
# copy any missing testsuites
|
13
17
|
target_report = reports.shift
|
14
|
-
|
18
|
+
|
19
|
+
package = target_report.root.attribute('name').value
|
20
|
+
preprocess_testsuites(target_report, package, combine_multiple_targets)
|
15
21
|
|
16
22
|
reports.each do |report|
|
17
23
|
increment_testable_tries(target_report.root, report.root)
|
18
|
-
|
24
|
+
package = report.root.attribute('name').value
|
25
|
+
preprocess_testsuites(report, package, combine_multiple_targets)
|
19
26
|
UI.verbose("> collating last report file #{report_filepaths.last}")
|
20
27
|
report.elements.each('//testsuite') do |testsuite|
|
21
28
|
testsuite_name = testsuite.attribute('name').value
|
22
|
-
|
29
|
+
package_attribute = ''
|
30
|
+
if combine_multiple_targets
|
31
|
+
package_attribute = "@package='#{package}'"
|
32
|
+
end
|
33
|
+
target_testsuite = REXML::XPath.first(target_report, "//testsuite[@name='#{testsuite_name}' #{package_attribute}]")
|
23
34
|
if target_testsuite
|
24
35
|
UI.verbose(" > collating testsuite #{testsuite_name}")
|
25
36
|
collate_testsuite(target_testsuite, testsuite)
|
@@ -36,6 +47,7 @@ module Fastlane
|
|
36
47
|
end
|
37
48
|
testable = REXML::XPath.first(target_report, 'testsuites')
|
38
49
|
update_testable_counts(testable)
|
50
|
+
testable.add_attribute('name', packages.to_a.join(', '))
|
39
51
|
|
40
52
|
FileUtils.mkdir_p(File.dirname(params[:collated_report]))
|
41
53
|
File.open(params[:collated_report], 'w') do |f|
|
@@ -81,10 +93,11 @@ module Fastlane
|
|
81
93
|
update_testsuite_counts(testsuite)
|
82
94
|
end
|
83
95
|
|
84
|
-
def self.preprocess_testsuites(report)
|
96
|
+
def self.preprocess_testsuites(report, package, combine_multiple_targets)
|
85
97
|
report.elements.each('//testsuite') do |testsuite|
|
86
98
|
flatten_duplicate_testsuites(report, testsuite)
|
87
99
|
collapse_testcase_multiple_failures_in_testsuite(testsuite)
|
100
|
+
testsuite.add_attribute('package', package) if combine_multiple_targets
|
88
101
|
end
|
89
102
|
end
|
90
103
|
|
@@ -234,6 +234,7 @@ module TestCenter
|
|
234
234
|
@test_collector.testables.each do |testable|
|
235
235
|
collate_batched_reports_for_testable(testable)
|
236
236
|
end
|
237
|
+
collate_multitarget_junits
|
237
238
|
move_single_testable_reports_to_final_location
|
238
239
|
end
|
239
240
|
|
@@ -295,6 +296,31 @@ module TestCenter
|
|
295
296
|
File.symlink(xcresult_bundlename_path, test_result_bundlename_path)
|
296
297
|
end
|
297
298
|
|
299
|
+
def collate_multitarget_junits
|
300
|
+
return if @test_collector.testables.size < 2
|
301
|
+
|
302
|
+
Fastlane::UI.verbose("Collating test targets's junit results")
|
303
|
+
|
304
|
+
given_custom_report_file_name = @options[:custom_report_file_name]
|
305
|
+
given_output_types = @options[:output_types]
|
306
|
+
given_output_files = @options[:output_files]
|
307
|
+
|
308
|
+
report_name_helper = ReportNameHelper.new(
|
309
|
+
given_output_types,
|
310
|
+
given_output_files,
|
311
|
+
given_custom_report_file_name
|
312
|
+
)
|
313
|
+
|
314
|
+
absolute_output_directory = File.absolute_path(output_directory)
|
315
|
+
source_reports_directory_glob = "#{absolute_output_directory}/*"
|
316
|
+
|
317
|
+
TestCenter::Helper::MultiScanManager::ReportCollator.new(
|
318
|
+
source_reports_directory_glob: source_reports_directory_glob,
|
319
|
+
output_directory: absolute_output_directory,
|
320
|
+
reportnamer: report_name_helper
|
321
|
+
).collate_junit_reports
|
322
|
+
end
|
323
|
+
|
298
324
|
def collate_batched_reports_for_testable(testable)
|
299
325
|
FastlaneCore::UI.verbose("Collating results for all batches")
|
300
326
|
|
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.14.
|
4
|
+
version: 3.14.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: 2020-09-
|
11
|
+
date: 2020-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|