fastlane-plugin-test_center 3.13.0 → 3.14.3
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 +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/actions/collate_test_result_bundles.rb +6 -4
- data/lib/fastlane/plugin/test_center/actions/collate_xcresults.rb +9 -5
- data/lib/fastlane/plugin/test_center/actions/multi_scan.rb +83 -1
- data/lib/fastlane/plugin/test_center/actions/tests_from_xcresult.rb +103 -0
- data/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb +30 -3
- data/lib/fastlane/plugin/test_center/helper/test_collector.rb +64 -18
- data/lib/fastlane/plugin/test_center/version.rb +1 -1
- metadata +23 -8
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
|
|
|
@@ -221,10 +221,12 @@ module Fastlane
|
|
|
221
221
|
'collate the test_result bundles to a temporary bundle \"result.test_result\"'
|
|
222
222
|
)
|
|
223
223
|
bundles = Dir['../spec/fixtures/*.test_result'].map { |relpath| File.absolute_path(relpath) }
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
Dir.mktmpdir('test_output') do |dir|
|
|
225
|
+
collate_test_result_bundles(
|
|
226
|
+
bundles: bundles,
|
|
227
|
+
collated_bundle: File.join(dir, 'result.test_result')
|
|
228
|
+
)
|
|
229
|
+
end
|
|
228
230
|
"
|
|
229
231
|
]
|
|
230
232
|
end
|
|
@@ -86,15 +86,19 @@ module Fastlane
|
|
|
86
86
|
def self.example_code
|
|
87
87
|
[
|
|
88
88
|
"
|
|
89
|
+
require 'tmpdir'
|
|
90
|
+
|
|
89
91
|
UI.important(
|
|
90
92
|
'example: ' \\
|
|
91
93
|
'collate the xcresult bundles to a temporary xcresult bundle \"result.xcresult\"'
|
|
92
94
|
)
|
|
93
|
-
xcresults = Dir['../spec/fixtures
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
xcresults = Dir['../spec/fixtures/AtomicBoyUITests-batch-{3,4}/result.xcresult'].map { |relpath| File.absolute_path(relpath) }
|
|
96
|
+
Dir.mktmpdir('test_output') do |dir|
|
|
97
|
+
collate_xcresults(
|
|
98
|
+
xcresults: xcresults,
|
|
99
|
+
collated_xcresult: File.join(dir, 'result.xcresult')
|
|
100
|
+
)
|
|
101
|
+
end
|
|
98
102
|
"
|
|
99
103
|
]
|
|
100
104
|
end
|
|
@@ -171,7 +171,10 @@ module Fastlane
|
|
|
171
171
|
use_scanfile_to_override_settings(scan_options)
|
|
172
172
|
turn_off_concurrent_workers(scan_options)
|
|
173
173
|
UI.important("Turning off :skip_build as it doesn't do anything with multi_scan") if scan_options[:skip_build]
|
|
174
|
-
scan_options
|
|
174
|
+
if scan_options[:disable_xcpretty]
|
|
175
|
+
UI.important("Turning off :disable_xcpretty as xcpretty is needed to generate junit reports for retrying failed tests")
|
|
176
|
+
end
|
|
177
|
+
scan_options.reject! { |k,v| %i[skip_build disable_xcpretty].include?(k) }
|
|
175
178
|
ScanHelper.remove_preexisting_simulator_logs(scan_options)
|
|
176
179
|
if scan_options[:test_without_building]
|
|
177
180
|
UI.verbose("Preparing Scan config options for multi_scan testing")
|
|
@@ -487,6 +490,85 @@ module Fastlane
|
|
|
487
490
|
]
|
|
488
491
|
end
|
|
489
492
|
|
|
493
|
+
def self.integration_tests
|
|
494
|
+
[
|
|
495
|
+
"
|
|
496
|
+
UI.header('Basic test')
|
|
497
|
+
multi_scan(
|
|
498
|
+
workspace: File.absolute_path('../AtomicBoy/AtomicBoy.xcworkspace'),
|
|
499
|
+
scheme: 'AtomicBoy',
|
|
500
|
+
fail_build: false,
|
|
501
|
+
try_count: 2,
|
|
502
|
+
disable_xcpretty: true
|
|
503
|
+
)
|
|
504
|
+
",
|
|
505
|
+
"
|
|
506
|
+
UI.header('Basic test with 1 specific test')
|
|
507
|
+
multi_scan(
|
|
508
|
+
workspace: File.absolute_path('../AtomicBoy/AtomicBoy.xcworkspace'),
|
|
509
|
+
scheme: 'AtomicBoy',
|
|
510
|
+
fail_build: false,
|
|
511
|
+
try_count: 2,
|
|
512
|
+
only_testing: ['AtomicBoyUITests/AtomicBoyUITests/testExample']
|
|
513
|
+
)
|
|
514
|
+
",
|
|
515
|
+
"
|
|
516
|
+
UI.header('Basic test with test target expansion')
|
|
517
|
+
multi_scan(
|
|
518
|
+
workspace: File.absolute_path('../AtomicBoy/AtomicBoy.xcworkspace'),
|
|
519
|
+
scheme: 'AtomicBoy',
|
|
520
|
+
fail_build: false,
|
|
521
|
+
try_count: 2,
|
|
522
|
+
only_testing: ['AtomicBoyUITests', 'AtomicBoyTests']
|
|
523
|
+
)
|
|
524
|
+
",
|
|
525
|
+
"
|
|
526
|
+
UI.header('Parallel test run')
|
|
527
|
+
multi_scan(
|
|
528
|
+
workspace: File.absolute_path('../AtomicBoy/AtomicBoy.xcworkspace'),
|
|
529
|
+
scheme: 'AtomicBoy',
|
|
530
|
+
fail_build: false,
|
|
531
|
+
try_count: 2,
|
|
532
|
+
parallel_testrun_count: 2
|
|
533
|
+
)
|
|
534
|
+
",
|
|
535
|
+
"
|
|
536
|
+
UI.header('Parallel test run with fewer tests than parallel test runs')
|
|
537
|
+
multi_scan(
|
|
538
|
+
workspace: File.absolute_path('../AtomicBoy/AtomicBoy.xcworkspace'),
|
|
539
|
+
scheme: 'AtomicBoy',
|
|
540
|
+
fail_build: false,
|
|
541
|
+
try_count: 2,
|
|
542
|
+
parallel_testrun_count: 4,
|
|
543
|
+
only_testing: ['AtomicBoyUITests/AtomicBoyUITests/testExample']
|
|
544
|
+
)
|
|
545
|
+
",
|
|
546
|
+
"
|
|
547
|
+
UI.header('Basic test with batches')
|
|
548
|
+
multi_scan(
|
|
549
|
+
workspace: File.absolute_path('../AtomicBoy/AtomicBoy.xcworkspace'),
|
|
550
|
+
scheme: 'AtomicBoy',
|
|
551
|
+
fail_build: false,
|
|
552
|
+
try_count: 2,
|
|
553
|
+
batch_count: 2
|
|
554
|
+
)
|
|
555
|
+
",
|
|
556
|
+
"
|
|
557
|
+
UI.header('Basic test with xcresult')
|
|
558
|
+
multi_scan(
|
|
559
|
+
workspace: File.absolute_path('../AtomicBoy/AtomicBoy.xcworkspace'),
|
|
560
|
+
scheme: 'AtomicBoy',
|
|
561
|
+
output_types: 'xcresult',
|
|
562
|
+
output_files: 'result.xcresult',
|
|
563
|
+
collate_reports: false,
|
|
564
|
+
fail_build: false,
|
|
565
|
+
try_count: 2,
|
|
566
|
+
batch_count: 2
|
|
567
|
+
)
|
|
568
|
+
"
|
|
569
|
+
]
|
|
570
|
+
end
|
|
571
|
+
|
|
490
572
|
def self.authors
|
|
491
573
|
["lyndsey-ferguson/@lyndseydf"]
|
|
492
574
|
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
require 'trainer'
|
|
2
|
+
require 'shellwords'
|
|
3
|
+
|
|
4
|
+
module Fastlane
|
|
5
|
+
module Actions
|
|
6
|
+
class TestsFromXcresultAction < Action
|
|
7
|
+
def self.run(params)
|
|
8
|
+
unless FastlaneCore::Helper.xcode_at_least?('11.0.0')
|
|
9
|
+
UI.error("Error: tests_from_xcresult requires at least Xcode 11.0")
|
|
10
|
+
return {}
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
xcresult_path = File.absolute_path(params[:xcresult])
|
|
14
|
+
|
|
15
|
+
# taken from the rubygem trainer, in the test_parser.rb module
|
|
16
|
+
result_bundle_object_raw = sh("xcrun xcresulttool get --path #{xcresult_path.shellescape} --format json", print_command: false, print_command_output: false)
|
|
17
|
+
result_bundle_object = JSON.parse(result_bundle_object_raw)
|
|
18
|
+
|
|
19
|
+
# Parses JSON into ActionsInvocationRecord to find a list of all ids for ActionTestPlanRunSummaries
|
|
20
|
+
actions_invocation_record = Trainer::XCResult::ActionsInvocationRecord.new(result_bundle_object)
|
|
21
|
+
test_refs = actions_invocation_record.actions.map do |action|
|
|
22
|
+
action.action_result.tests_ref
|
|
23
|
+
end.compact
|
|
24
|
+
|
|
25
|
+
ids = test_refs.map(&:id)
|
|
26
|
+
summaries = ids.map do |id|
|
|
27
|
+
raw = sh("xcrun xcresulttool get --format json --path #{xcresult_path.shellescape} --id #{id}", print_command: false, print_command_output: false)
|
|
28
|
+
json = JSON.parse(raw)
|
|
29
|
+
Trainer::XCResult::ActionTestPlanRunSummaries.new(json)
|
|
30
|
+
end
|
|
31
|
+
failures = actions_invocation_record.issues.test_failure_summaries || []
|
|
32
|
+
all_summaries = summaries.map(&:summaries).flatten
|
|
33
|
+
testable_summaries = all_summaries.map(&:testable_summaries).flatten
|
|
34
|
+
failed = []
|
|
35
|
+
passing = []
|
|
36
|
+
failure_details = {}
|
|
37
|
+
rows = testable_summaries.map do |testable_summary|
|
|
38
|
+
all_tests = testable_summary.all_tests.flatten
|
|
39
|
+
all_tests.each do |t|
|
|
40
|
+
if t.test_status == 'Success'
|
|
41
|
+
passing << "#{t.parent.name}/#{t.identifier}"
|
|
42
|
+
else
|
|
43
|
+
test_identifier = "#{t.parent.name}/#{t.identifier}"
|
|
44
|
+
failed << test_identifier
|
|
45
|
+
failure = t.find_failure(failures)
|
|
46
|
+
if failure
|
|
47
|
+
failure_details[test_identifier] = {
|
|
48
|
+
message: failure.failure_message
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
{
|
|
55
|
+
failed: failed.uniq,
|
|
56
|
+
passing: passing.uniq,
|
|
57
|
+
failure_details: failure_details
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
#####################################################
|
|
62
|
+
# @!group Documentation
|
|
63
|
+
#####################################################
|
|
64
|
+
|
|
65
|
+
def self.description
|
|
66
|
+
"☑️ Retrieves the failing and passing tests as reportedn an xcresult bundle"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def self.available_options
|
|
71
|
+
[
|
|
72
|
+
FastlaneCore::ConfigItem.new(
|
|
73
|
+
key: :xcresult,
|
|
74
|
+
env_name: "FL_TESTS_FROM_XCRESULT_XCRESULT_PATH",
|
|
75
|
+
description: "The path to the xcresult bundle to retrieve the tests from",
|
|
76
|
+
verify_block: proc do |path|
|
|
77
|
+
UI.user_error!("Error: cannot find the xcresult bundle at '#{path}'") unless Dir.exist?(path)
|
|
78
|
+
UI.user_error!("Error: cannot parse files that are not in the xcresult format") unless File.extname(path) == ".xcresult"
|
|
79
|
+
end
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def self.return_value
|
|
85
|
+
"A Hash with information about the test results:\r\n" \
|
|
86
|
+
"failed: an Array of the failed test identifiers\r\n" \
|
|
87
|
+
"passing: an Array of the passing test identifiers\r\n"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def self.authors
|
|
91
|
+
["lyndsey-ferguson/lyndseydf"]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def self.category
|
|
95
|
+
:testing
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def self.is_supported?(platform)
|
|
99
|
+
%i[ios mac].include?(platform)
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -66,9 +66,10 @@ module TestCenter
|
|
|
66
66
|
@test_collector = TestCollector.new(@options)
|
|
67
67
|
@options.reject! { |key| %i[testplan].include?(key) }
|
|
68
68
|
@batch_count = @test_collector.test_batches.size
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
tests = @test_collector.test_batches.flatten
|
|
70
|
+
if tests.size < @options[:parallel_testrun_count].to_i
|
|
71
|
+
FastlaneCore::UI.important(":parallel_testrun_count greater than the number of tests (#{tests.size}). Reducing to that number.")
|
|
72
|
+
@options[:parallel_testrun_count] = tests.size
|
|
72
73
|
end
|
|
73
74
|
end
|
|
74
75
|
|
|
@@ -233,6 +234,7 @@ module TestCenter
|
|
|
233
234
|
@test_collector.testables.each do |testable|
|
|
234
235
|
collate_batched_reports_for_testable(testable)
|
|
235
236
|
end
|
|
237
|
+
collate_multitarget_junits
|
|
236
238
|
move_single_testable_reports_to_final_location
|
|
237
239
|
end
|
|
238
240
|
|
|
@@ -294,6 +296,31 @@ module TestCenter
|
|
|
294
296
|
File.symlink(xcresult_bundlename_path, test_result_bundlename_path)
|
|
295
297
|
end
|
|
296
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
|
+
|
|
297
324
|
def collate_batched_reports_for_testable(testable)
|
|
298
325
|
FastlaneCore::UI.verbose("Collating results for all batches")
|
|
299
326
|
|
|
@@ -91,31 +91,77 @@ module TestCenter
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
def xctestrun_known_tests
|
|
94
|
-
|
|
95
|
-
::
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
unless @known_tests
|
|
95
|
+
config = FastlaneCore::Configuration.create(
|
|
96
|
+
::Fastlane::Actions::TestsFromXctestrunAction.available_options,
|
|
97
|
+
{
|
|
98
|
+
xctestrun: @xctestrun_path,
|
|
99
|
+
invocation_based_tests: @invocation_based_tests,
|
|
100
|
+
swift_test_prefix: @swift_test_prefix
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
@known_tests = ::Fastlane::Actions::TestsFromXctestrunAction.run(config)
|
|
104
|
+
end
|
|
105
|
+
@known_tests
|
|
103
106
|
end
|
|
104
107
|
|
|
105
|
-
def
|
|
108
|
+
def expand_short_testidentifiers_to_tests(testables_tests)
|
|
109
|
+
# Remember, testable_tests is of the format:
|
|
110
|
+
# {
|
|
111
|
+
# 'testable1' => [
|
|
112
|
+
# 'testsuite1/testcase1',
|
|
113
|
+
# 'testsuite1/testcase2',
|
|
114
|
+
# 'testsuite2/testcase1',
|
|
115
|
+
# 'testsuite2/testcase2',
|
|
116
|
+
# ...
|
|
117
|
+
# 'testsuiteN/testcase1', ... 'testsuiteN/testcaseM'
|
|
118
|
+
# ],
|
|
119
|
+
# ...
|
|
120
|
+
# 'testableO' => [
|
|
121
|
+
# 'testsuite1/testcase1',
|
|
122
|
+
# 'testsuite1/testcase2',
|
|
123
|
+
# 'testsuite2/testcase1',
|
|
124
|
+
# 'testsuite2/testcase2',
|
|
125
|
+
# ...
|
|
126
|
+
# 'testsuiteN/testcase1', ... 'testsuiteN/testcaseM'
|
|
127
|
+
# ]
|
|
128
|
+
# }
|
|
106
129
|
return if @invocation_based_tests
|
|
107
130
|
|
|
131
|
+
# iterate among all the test identifers for each testable
|
|
132
|
+
# A test identifier is seperated into components by '/'
|
|
133
|
+
# if a test identifier has only 2 separators, it probably is
|
|
134
|
+
# 'testable/testsuite' (but it could be 'testsuite/testcase' )
|
|
135
|
+
all_known_tests = nil
|
|
108
136
|
known_tests = []
|
|
109
|
-
|
|
137
|
+
testables_tests.each do |testable, tests|
|
|
110
138
|
tests.each_with_index do |test, index|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
139
|
+
test_components = test.split('/')
|
|
140
|
+
is_full_test_identifier = (test_components.size == 3)
|
|
141
|
+
next if is_full_test_identifier
|
|
142
|
+
|
|
143
|
+
all_known_tests ||= xctestrun_known_tests.clone
|
|
144
|
+
|
|
145
|
+
testsuite = ''
|
|
146
|
+
if test_components.size == 1
|
|
147
|
+
if test_components[0] == testable
|
|
148
|
+
# The following || [] is just in case the user provided multiple
|
|
149
|
+
# test targets or there are no actual tests found.
|
|
150
|
+
testables_tests[testable][index] = all_known_tests[testable] || []
|
|
151
|
+
all_known_tests.delete(testable)
|
|
152
|
+
next
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
testsuite = test_components[0]
|
|
156
|
+
else
|
|
157
|
+
testsuite = test_components[1]
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
testables_tests[testable][index], all_known_tests[testable] = all_known_tests[testable].partition do |known_test|
|
|
161
|
+
known_test.split('/')[1] == testsuite
|
|
116
162
|
end
|
|
117
163
|
end
|
|
118
|
-
|
|
164
|
+
testables_tests[testable].flatten!
|
|
119
165
|
end
|
|
120
166
|
end
|
|
121
167
|
|
|
@@ -123,7 +169,7 @@ module TestCenter
|
|
|
123
169
|
unless @testables_tests
|
|
124
170
|
if @only_testing
|
|
125
171
|
@testables_tests = only_testing_to_testables_tests
|
|
126
|
-
|
|
172
|
+
expand_short_testidentifiers_to_tests(@testables_tests)
|
|
127
173
|
else
|
|
128
174
|
@testables_tests = xctestrun_known_tests
|
|
129
175
|
if @skip_testing
|
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.
|
|
4
|
+
version: 3.14.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lyndsey Ferguson
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-09-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
@@ -38,6 +38,20 @@ dependencies:
|
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: trainer
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: xcodeproj
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,14 +72,14 @@ dependencies:
|
|
|
58
72
|
requirements:
|
|
59
73
|
- - ">="
|
|
60
74
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 1.2.
|
|
75
|
+
version: 1.2.1
|
|
62
76
|
type: :runtime
|
|
63
77
|
prerelease: false
|
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
79
|
requirements:
|
|
66
80
|
- - ">="
|
|
67
81
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 1.2.
|
|
82
|
+
version: 1.2.1
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: colorize
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -270,6 +284,7 @@ files:
|
|
|
270
284
|
- lib/fastlane/plugin/test_center/actions/test_options_from_testplan.rb
|
|
271
285
|
- lib/fastlane/plugin/test_center/actions/testplans_from_scheme.rb
|
|
272
286
|
- lib/fastlane/plugin/test_center/actions/tests_from_junit.rb
|
|
287
|
+
- lib/fastlane/plugin/test_center/actions/tests_from_xcresult.rb
|
|
273
288
|
- lib/fastlane/plugin/test_center/actions/tests_from_xctestrun.rb
|
|
274
289
|
- lib/fastlane/plugin/test_center/helper/fastlane_core/device_manager/simulator_extensions.rb
|
|
275
290
|
- lib/fastlane/plugin/test_center/helper/html_test_report.rb
|
|
@@ -295,7 +310,7 @@ homepage: https://github.com/lyndsey-ferguson/fastlane-plugin-test_center
|
|
|
295
310
|
licenses:
|
|
296
311
|
- MIT
|
|
297
312
|
metadata: {}
|
|
298
|
-
post_install_message:
|
|
313
|
+
post_install_message:
|
|
299
314
|
rdoc_options: []
|
|
300
315
|
require_paths:
|
|
301
316
|
- lib
|
|
@@ -310,8 +325,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
310
325
|
- !ruby/object:Gem::Version
|
|
311
326
|
version: '0'
|
|
312
327
|
requirements: []
|
|
313
|
-
rubygems_version: 3.
|
|
314
|
-
signing_key:
|
|
328
|
+
rubygems_version: 3.1.2
|
|
329
|
+
signing_key:
|
|
315
330
|
specification_version: 4
|
|
316
331
|
summary: Makes testing your iOS app easier
|
|
317
332
|
test_files: []
|