fastlane-plugin-test_center 3.10.1 → 3.10.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc36397b53f7d85a7ab222aaef8fce6652c69d86462d81bac3f78c3d13124667
4
- data.tar.gz: 986cd2f40ac19802835a9d8f222730bc7d78e9f80ceb07e7e872b1038f2a20d5
3
+ metadata.gz: 7c6d2198915a9633a3ab0d6f284a76f9cf03682524747b73e546786852bf2a86
4
+ data.tar.gz: 494391029f0689f83a34b7babba3772294b7ee112e1505e69ce09db300743d3b
5
5
  SHA512:
6
- metadata.gz: cb0e4067df2bb853becfa2cdd5b15757de3f6f68f47b46fbd2611fe3d58c4378b792ed113df209a915f9cbc710894d8351bf2a6bc4a286c1f15d07949e607320
7
- data.tar.gz: eb701752e1efab0912c82e1b5ea6b9a280645012ae1f393d9d2a047fd823fbf9b723bb84fd823ab063624236109b1bd4b3503b01d660633008f9fa3ec572f5cb
6
+ metadata.gz: 77f8e4cbaa0235a71f34e849b95c0eb0321f0e666709fce63cd517af43c2d027cb5f0e8a32f3c10de692a97c5e496b83352e8aec294bb828098d85ff0bf4328c
7
+ data.tar.gz: 1cea423213b5ea48f5274a9efa1aa2765ad776ebfe414b699c5fa7411dbbdaf37ae00876f2175f81c2c95dd0d82892e5ab51599e692d2020d48b5ec945309b7a
@@ -17,16 +17,18 @@ module TestCenter
17
17
  end
18
18
  # :nocov:
19
19
 
20
- def prepare_scan_config_for_destination
20
+ def prepare_scan_config
21
21
  # this allows multi_scan's `destination` option to be picked up by `scan`
22
22
  scan_config._values.delete(:device)
23
23
  ENV.delete('SCAN_DEVICE')
24
24
  scan_config._values.delete(:devices)
25
25
  ENV.delete('SCAN_DEVICES')
26
+ # this prevents double -resultBundlePath args to xcodebuild
26
27
  if ReportNameHelper.includes_xcresult?(@options[:output_types])
27
28
  scan_config._values.delete(:result_bundle)
28
29
  ENV.delete('SCAN_RESULT_BUNDLE')
29
30
  end
31
+ scan_config._values.delete(:skip_testing)
30
32
  scan_cache.clear
31
33
  end
32
34
 
@@ -35,8 +37,9 @@ module TestCenter
35
37
  scan_options = @options.select { |k,v| valid_scan_keys.include?(k) }
36
38
  .merge(@retrying_scan_helper.scan_options)
37
39
 
38
- prepare_scan_config_for_destination
40
+ prepare_scan_config
39
41
  scan_options[:build_for_testing] = false
42
+ scan_options.delete(:skip_testing)
40
43
  FastlaneCore::UI.verbose("retrying_scan #update_scan_options")
41
44
  scan_options.each do |k,v|
42
45
  next if v.nil?
@@ -288,6 +288,25 @@ module TestCenter
288
288
  end
289
289
 
290
290
  def retrieve_test_operation_failure(test_session_last_messages)
291
+ if FastlaneCore::Helper.xcode_at_least?(11)
292
+ retrieve_test_operation_failure_post_xcode11(test_session_last_messages)
293
+ else
294
+ retrieve_test_operation_failure_pre_xcode11(test_session_last_messages)
295
+ end
296
+ end
297
+
298
+ def retrieve_test_operation_failure_post_xcode11(test_session_last_messages)
299
+ if /Connection peer refused channel request/ =~ test_session_last_messages
300
+ test_operation_failure = 'Lost connection to testmanagerd'
301
+ elsif /Please unlock your device and reattach/ =~ test_session_last_messages
302
+ test_operation_failure = 'Test device locked'
303
+ elsif /Test runner exited before starting test execution/ =~ test_session_last_messages
304
+ test_operation_failure = 'Test runner exited before starting test execution'
305
+ end
306
+ test_operation_failure
307
+ end
308
+
309
+ def retrieve_test_operation_failure_pre_xcode11(test_session_last_messages)
291
310
  test_operation_failure_match = /Test operation failure: (?<test_operation_failure>.*)$/ =~ test_session_last_messages
292
311
  if test_operation_failure_match.nil?
293
312
  test_operation_failure = 'Unknown test operation failure'
@@ -7,7 +7,7 @@ module TestCenter
7
7
  require 'json'
8
8
  require 'shellwords'
9
9
  require 'snapshot/reset_simulators'
10
-
10
+
11
11
  class Runner
12
12
  attr_reader :retry_total_count
13
13
 
@@ -66,12 +66,12 @@ module TestCenter
66
66
  end
67
67
 
68
68
  unless tests_passed || @options[:try_count] < 1
69
- setup_testcollector
69
+ setup_testcollector
70
70
  tests_passed = run_test_batches
71
71
  end
72
72
  tests_passed
73
73
  end
74
-
74
+
75
75
  def should_run_tests_through_single_try?
76
76
  should_run_for_invocation_tests = @options[:invocation_based_tests] && @options[:only_testing].nil?
77
77
  should_run_for_skip_build = @options[:skip_build]
@@ -114,16 +114,16 @@ module TestCenter
114
114
  end
115
115
  @options[:output_directory] = output_directory
116
116
  @options[:destination] = Scan.config[:destination]
117
-
117
+
118
118
  # We do not want Scan.config to _not_ have :device :devices, we want to
119
119
  # use :destination. We remove :force_quit_simulator as we do not want
120
120
  # Scan to handle it as multi_scan takes care of it in its own way
121
121
  options = @options.reject { |key| %i[device devices force_quit_simulator].include?(key) }
122
122
  options[:try_count] = 1
123
-
123
+
124
124
  tests_passed = RetryingScan.run(options)
125
125
  @options[:try_count] -= 1
126
-
126
+
127
127
  reportnamer = ReportNameHelper.new(
128
128
  @options[:output_types],
129
129
  @options[:output_files],
@@ -138,12 +138,12 @@ module TestCenter
138
138
  )
139
139
  @options[:only_testing] = retrieve_failed_single_try_tests
140
140
  @options[:only_testing] = @options[:only_testing].map(&:strip_testcase).uniq
141
-
141
+
142
142
  symlink_result_bundle_to_xcresult(output_directory, reportnamer)
143
143
 
144
144
  tests_passed
145
145
  end
146
-
146
+
147
147
  def retrieve_failed_single_try_tests
148
148
  reportnamer = ReportNameHelper.new(
149
149
  @options[:output_types],
@@ -168,10 +168,10 @@ module TestCenter
168
168
 
169
169
  pool = TestBatchWorkerPool.new(pool_options)
170
170
  pool.setup_workers
171
-
171
+
172
172
  remaining_test_batches = @test_collector.test_batches.clone
173
173
  remaining_test_batches.each_with_index do |test_batch, current_batch_index|
174
- worker = pool.wait_for_worker
174
+ worker = pool.wait_for_worker
175
175
  FastlaneCore::UI.message("Starting test run #{current_batch_index + 1}")
176
176
  worker.run(scan_options_for_worker(test_batch, current_batch_index))
177
177
  end
@@ -189,7 +189,7 @@ module TestCenter
189
189
  batch: batch_index + 1
190
190
  }
191
191
  end
192
-
192
+
193
193
  def collate_batched_reports
194
194
  return unless @batch_count > 1
195
195
  return unless @options[:collate_reports]
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module TestCenter
3
- VERSION = "3.10.1"
3
+ VERSION = "3.10.2"
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.10.1
4
+ version: 3.10.2
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-04-01 00:00:00.000000000 Z
11
+ date: 2020-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json