fastlane-plugin-test_center 3.8.0.parallelizing.beta.6 → 3.8.0.parallelizing.beta.7
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/helper/multi_scan_manager/retrying_scan_helper.rb +5 -13
- data/lib/fastlane/plugin/test_center/helper/multi_scan_manager/runner.rb +40 -7
- data/lib/fastlane/plugin/test_center/helper/test_collector.rb +19 -13
- 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: 7d7647dee8a9311b8e18eeba2a4afbc906d0c751
|
4
|
+
data.tar.gz: 0074ac993896e002df67534365fe1e367a2bc71d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2da85b784f6d88a4b0022c07ec3d6b2def13c1a7f47d8634ae1a665255d814de59c783ff85d39765fdc523cba1bb260200c01f314d25cff846cd946747425f7c
|
7
|
+
data.tar.gz: 8fdec1723d3d712a5907c240a0121997553b3aa5750cd2eb856721d7b09e7a2f14d7358f41eb730522993508fa190e37d05e1ac34cb60249292d9eb0a853c0e4
|
@@ -49,7 +49,11 @@ module TestCenter
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def print_starting_scan_message
|
52
|
-
|
52
|
+
if @options[:only_testing]
|
53
|
+
scan_message = "Starting scan ##{@testrun_count + 1} with #{@options.fetch(:only_testing, []).size} tests"
|
54
|
+
else
|
55
|
+
scan_message = "Starting scan ##{@testrun_count + 1}"
|
56
|
+
end
|
53
57
|
scan_message << " for batch ##{@options[:batch]}" unless @options[:batch].nil?
|
54
58
|
FastlaneCore::UI.message("#{scan_message}.")
|
55
59
|
end
|
@@ -117,7 +121,6 @@ module TestCenter
|
|
117
121
|
|
118
122
|
def handle_test_failure
|
119
123
|
send_callback_testrun_info
|
120
|
-
reset_simulators
|
121
124
|
move_test_result_bundle_for_next_run
|
122
125
|
update_scan_options
|
123
126
|
@reportnamer.increment
|
@@ -189,12 +192,6 @@ module TestCenter
|
|
189
192
|
@options[:only_testing] = @options[:only_testing].map(&:strip_testcase).uniq
|
190
193
|
end
|
191
194
|
end
|
192
|
-
|
193
|
-
def reset_simulators
|
194
|
-
return unless @options[:reset_simulators]
|
195
|
-
|
196
|
-
@options[:simulators].each(&:reset)
|
197
|
-
end
|
198
195
|
|
199
196
|
def handle_build_failure(exception)
|
200
197
|
test_operation_failure = ''
|
@@ -219,11 +216,6 @@ module TestCenter
|
|
219
216
|
send_callback_testrun_info(test_operation_failure: test_operation_failure)
|
220
217
|
raise exception
|
221
218
|
end
|
222
|
-
if @options[:reset_simulators]
|
223
|
-
@options[:simulators].each do |simulator|
|
224
|
-
simulator.reset
|
225
|
-
end
|
226
|
-
end
|
227
219
|
send_callback_testrun_info(test_operation_failure: test_operation_failure)
|
228
220
|
end
|
229
221
|
|
@@ -12,11 +12,19 @@ module TestCenter
|
|
12
12
|
attr_reader :retry_total_count
|
13
13
|
|
14
14
|
def initialize(multi_scan_options)
|
15
|
-
@test_collector = TestCenter::Helper::TestCollector.new(multi_scan_options)
|
16
15
|
@options = multi_scan_options.merge(
|
17
16
|
clean: false,
|
18
17
|
disable_concurrent_testing: true
|
19
18
|
)
|
19
|
+
@batch_count = 1 # default count. Will be updated by setup_testcollector
|
20
|
+
setup_testcollector
|
21
|
+
end
|
22
|
+
|
23
|
+
def setup_testcollector
|
24
|
+
return if @options[:invocation_based_tests] && @options[:only_testing].nil?
|
25
|
+
return if @test_collector
|
26
|
+
|
27
|
+
@test_collector = TestCenter::Helper::TestCollector.new(@options)
|
20
28
|
@batch_count = @test_collector.test_batches.size
|
21
29
|
end
|
22
30
|
|
@@ -34,9 +42,13 @@ module TestCenter
|
|
34
42
|
def run
|
35
43
|
remove_preexisting_test_result_bundles
|
36
44
|
|
37
|
-
|
38
|
-
|
39
|
-
|
45
|
+
tests_passed = false
|
46
|
+
if @options[:invocation_based_tests] && @options[:only_testing].nil?
|
47
|
+
tests_passed = run_invocation_based_tests
|
48
|
+
end
|
49
|
+
|
50
|
+
unless tests_passed || @options[:try_count] < 1
|
51
|
+
setup_testcollector
|
40
52
|
run_test_batches
|
41
53
|
end
|
42
54
|
end
|
@@ -50,11 +62,32 @@ module TestCenter
|
|
50
62
|
end
|
51
63
|
|
52
64
|
def run_invocation_based_tests
|
53
|
-
@options[:only_testing] = @options[:only_testing]&.map(&:strip_testcase)&.uniq
|
54
65
|
@options[:skip_testing] = @options[:skip_testing]&.map(&:strip_testcase)&.uniq
|
55
66
|
@options[:output_directory] = output_directory
|
56
|
-
|
57
|
-
|
67
|
+
@options[:destination] = Scan.config[:destination]
|
68
|
+
|
69
|
+
options = @options.reject { |key| %i[device devices force_quit_simulator].include?(key) }
|
70
|
+
options[:try_count] = 1
|
71
|
+
|
72
|
+
tests_passed = RetryingScan.run(options)
|
73
|
+
@options[:try_count] -= 1
|
74
|
+
|
75
|
+
reportnamer = ReportNameHelper.new(
|
76
|
+
@options[:output_types],
|
77
|
+
@options[:output_files],
|
78
|
+
@options[:custom_report_file_name]
|
79
|
+
)
|
80
|
+
report_filepath = File.join(output_directory, reportnamer.junit_last_reportname)
|
81
|
+
config = FastlaneCore::Configuration.create(
|
82
|
+
Fastlane::Actions::TestsFromJunitAction.available_options,
|
83
|
+
{
|
84
|
+
junit: File.absolute_path(report_filepath)
|
85
|
+
}
|
86
|
+
)
|
87
|
+
@options[:only_testing] = Fastlane::Actions::TestsFromJunitAction.run(config)[:failed]
|
88
|
+
@options[:only_testing] = @options[:only_testing].map(&:strip_testcase).uniq
|
89
|
+
|
90
|
+
tests_passed
|
58
91
|
end
|
59
92
|
|
60
93
|
def run_test_batches
|
@@ -17,6 +17,7 @@ module TestCenter
|
|
17
17
|
end
|
18
18
|
@only_testing = options[:only_testing]
|
19
19
|
@skip_testing = options[:skip_testing]
|
20
|
+
@invocation_based_tests = options[:invocation_based_tests]
|
20
21
|
@batch_count = options[:batch_count]
|
21
22
|
if @batch_count == 1 && options[:parallel_testrun_count] > 1
|
22
23
|
@batch_count = options[:parallel_testrun_count]
|
@@ -67,23 +68,28 @@ module TestCenter
|
|
67
68
|
::Fastlane::Actions::TestsFromXctestrunAction.run(config)
|
68
69
|
end
|
69
70
|
|
71
|
+
def expand_testsuites_to_tests
|
72
|
+
return if @invocation_based_tests
|
73
|
+
|
74
|
+
known_tests = nil
|
75
|
+
@testables_tests.each do |testable, tests|
|
76
|
+
tests.each_with_index do |test, index|
|
77
|
+
if test.count('/') < 2
|
78
|
+
known_tests ||= xctestrun_known_tests[testable]
|
79
|
+
test_components = test.split('/')
|
80
|
+
testsuite = test_components.size == 1 ? test_components[0] : test_components[1]
|
81
|
+
@testables_tests[testable][index] = known_tests.select { |known_test| known_test.include?(testsuite) }
|
82
|
+
end
|
83
|
+
end
|
84
|
+
@testables_tests[testable].flatten!
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
70
88
|
def testables_tests
|
71
89
|
unless @testables_tests
|
72
90
|
if @only_testing
|
73
|
-
known_tests = nil
|
74
91
|
@testables_tests = only_testing_to_testables_tests
|
75
|
-
|
76
|
-
@testables_tests.each do |testable, tests|
|
77
|
-
tests.each_with_index do |test, index|
|
78
|
-
if test.count('/') < 2
|
79
|
-
known_tests ||= xctestrun_known_tests[testable]
|
80
|
-
test_components = test.split('/')
|
81
|
-
testsuite = test_components.size == 1 ? test_components[0] : test_components[1]
|
82
|
-
@testables_tests[testable][index] = known_tests.select { |known_test| known_test.include?(testsuite) }
|
83
|
-
end
|
84
|
-
end
|
85
|
-
@testables_tests[testable].flatten!
|
86
|
-
end
|
92
|
+
expand_testsuites_to_tests
|
87
93
|
else
|
88
94
|
@testables_tests = xctestrun_known_tests
|
89
95
|
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.8.0.parallelizing.beta.
|
4
|
+
version: 3.8.0.parallelizing.beta.7
|
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-07-
|
11
|
+
date: 2019-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|