fastlane 2.201.0 → 2.203.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +88 -88
  3. data/deliver/lib/deliver/runner.rb +19 -2
  4. data/deliver/lib/deliver/submit_for_review.rb +25 -3
  5. data/fastlane/lib/fastlane/actions/run_tests.rb +18 -2
  6. data/fastlane/lib/fastlane/actions/xcov.rb +5 -0
  7. data/fastlane/lib/fastlane/version.rb +1 -1
  8. data/fastlane/swift/Deliverfile.swift +1 -1
  9. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  10. data/fastlane/swift/Fastlane.swift +177 -157
  11. data/fastlane/swift/Gymfile.swift +1 -1
  12. data/fastlane/swift/GymfileProtocol.swift +1 -1
  13. data/fastlane/swift/Matchfile.swift +1 -1
  14. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  15. data/fastlane/swift/Precheckfile.swift +1 -1
  16. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  17. data/fastlane/swift/Scanfile.swift +1 -1
  18. data/fastlane/swift/ScanfileProtocol.swift +6 -2
  19. data/fastlane/swift/Screengrabfile.swift +1 -1
  20. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  21. data/fastlane/swift/Snapshotfile.swift +1 -1
  22. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  23. data/fastlane/swift/formatting/Brewfile.lock.json +14 -14
  24. data/fastlane_core/lib/fastlane_core/.helper.rb.swp +0 -0
  25. data/scan/lib/scan/.detect_values.rb.swp +0 -0
  26. data/scan/lib/scan/.runner.rb.swp +0 -0
  27. data/scan/lib/scan/error_handler.rb +9 -0
  28. data/scan/lib/scan/options.rb +6 -1
  29. data/scan/lib/scan/runner.rb +36 -9
  30. data/scan/lib/scan/test_command_generator.rb +8 -3
  31. data/spaceship/lib/spaceship/connect_api/models/app.rb +2 -1
  32. data/trainer/lib/trainer/options.rb +11 -0
  33. metadata +25 -22
@@ -2,35 +2,35 @@
2
2
  "entries": {
3
3
  "brew": {
4
4
  "swiftformat": {
5
- "version": "0.49.2",
5
+ "version": "0.49.3",
6
6
  "bottle": {
7
7
  "rebuild": 0,
8
8
  "root_url": "https://ghcr.io/v2/homebrew/core",
9
9
  "files": {
10
10
  "arm64_monterey": {
11
11
  "cellar": ":any_skip_relocation",
12
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:2279db95259ddbc7ad83e47f5bbf8c308db55b74d5464ac79a027bd33138b023",
13
- "sha256": "2279db95259ddbc7ad83e47f5bbf8c308db55b74d5464ac79a027bd33138b023"
12
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:3fd0427fdb74e0cc88da322ce2b2cd0b9e021fd286f34978b01b0bb62f9e8529",
13
+ "sha256": "3fd0427fdb74e0cc88da322ce2b2cd0b9e021fd286f34978b01b0bb62f9e8529"
14
14
  },
15
15
  "arm64_big_sur": {
16
16
  "cellar": ":any_skip_relocation",
17
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:2f6bddbef7d750d6ed546ed5decd4d54d439f16009491bdb4e4999c99d877bcf",
18
- "sha256": "2f6bddbef7d750d6ed546ed5decd4d54d439f16009491bdb4e4999c99d877bcf"
17
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:cc99c52385e32a1d2bb42625a535cac9835313e65ba84776cbe2ad49ae41167d",
18
+ "sha256": "cc99c52385e32a1d2bb42625a535cac9835313e65ba84776cbe2ad49ae41167d"
19
19
  },
20
20
  "monterey": {
21
21
  "cellar": ":any_skip_relocation",
22
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:190bf822a188ec8e8be754de2fcd34166ffb07bbd40d67385653d898a251b167",
23
- "sha256": "190bf822a188ec8e8be754de2fcd34166ffb07bbd40d67385653d898a251b167"
22
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:39877fc1115e6f15d20a76c30ddbb23d45f52fb95eb81382c4f4abe2b98eb03b",
23
+ "sha256": "39877fc1115e6f15d20a76c30ddbb23d45f52fb95eb81382c4f4abe2b98eb03b"
24
24
  },
25
25
  "big_sur": {
26
26
  "cellar": ":any_skip_relocation",
27
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:fe294ff0fa69548876a70ef7aaf30b7221a43adc9f75f7c157c6f881089da6eb",
28
- "sha256": "fe294ff0fa69548876a70ef7aaf30b7221a43adc9f75f7c157c6f881089da6eb"
27
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:ead4633c1ec372b7cc6995dba2d3352691b4086f501e0346629072873bccef99",
28
+ "sha256": "ead4633c1ec372b7cc6995dba2d3352691b4086f501e0346629072873bccef99"
29
29
  },
30
30
  "catalina": {
31
31
  "cellar": ":any_skip_relocation",
32
- "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:2a174bf9c47a070b1fcaa32c066cd7c82604fc428db952f11c9bf1e4448c567a",
33
- "sha256": "2a174bf9c47a070b1fcaa32c066cd7c82604fc428db952f11c9bf1e4448c567a"
32
+ "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:359cd4f2c3eea7c28f485db06dc955d8b27eabab340420a0c52931004a3ee3e7",
33
+ "sha256": "359cd4f2c3eea7c28f485db06dc955d8b27eabab340420a0c52931004a3ee3e7"
34
34
  }
35
35
  }
36
36
  }
@@ -56,10 +56,10 @@
56
56
  "macOS": "11.6"
57
57
  },
58
58
  "monterey": {
59
- "HOMEBREW_VERSION": "3.3.11-80-g5ee14b9",
59
+ "HOMEBREW_VERSION": "3.3.12-34-gc40b2ba",
60
60
  "HOMEBREW_PREFIX": "/opt/homebrew",
61
- "Homebrew/homebrew-core": "9ca1b8fa2865504f50fcdbe679417daedfa274cc",
62
- "CLT": "13.1.0.0.1.1633545042",
61
+ "Homebrew/homebrew-core": "f896f406dfd6f06ab001c6ce36e7d2087459c77a",
62
+ "CLT": "13.2.0.0.1.1638488800",
63
63
  "Xcode": "13.2.1",
64
64
  "macOS": "12.0.1"
65
65
  }
Binary file
Binary file
@@ -27,6 +27,15 @@ module Scan
27
27
  print("If you are using zshell or another shell, make sure to edit the correct bash file.")
28
28
  print("For more information visit this stackoverflow answer:")
29
29
  print("https://stackoverflow.com/a/17031697/445598")
30
+ when /Testing failed on/
31
+ # This is important because xcbeautify and raw output will print:
32
+ # Testing failed on 'iPhone 13 Pro Max'
33
+ # when multiple devices are use.
34
+ # xcpretty hides this output so its not an issue with xcpretty.
35
+ # We need to catch "Testing failed on" before "Test failed"
36
+ # so that an error isn't raised.
37
+ # Raising an error prevents trainer from processing the xcresult
38
+ return
30
39
  when /Testing failed/
31
40
  UI.build_failure!("Error building the application. #{details}")
32
41
  when /Executed/, /Failing tests:/
@@ -328,6 +328,11 @@ module Scan
328
328
  default_value: false),
329
329
 
330
330
  # concurrency
331
+ FastlaneCore::ConfigItem.new(key: :parallel_testing,
332
+ type: Boolean,
333
+ env_name: "SCAN_PARALLEL_TESTING",
334
+ description: "Optionally override the per-target setting in the scheme for running tests in parallel. Equivalent to -parallel-testing-enabled",
335
+ optional: true),
331
336
  FastlaneCore::ConfigItem.new(key: :concurrent_workers,
332
337
  type: Integer,
333
338
  env_name: "SCAN_CONCURRENT_WORKERS",
@@ -515,7 +520,7 @@ module Scan
515
520
  default_value: false),
516
521
  FastlaneCore::ConfigItem.new(key: :number_of_retries,
517
522
  env_name: 'SCAN_NUMBER_OF_RETRIES',
518
- description: "The number of times a test can fail before scan should stop retrying",
523
+ description: "The number of times a test can fail",
519
524
  type: Integer,
520
525
  default_value: 0)
521
526
 
@@ -20,7 +20,8 @@ module Scan
20
20
  end
21
21
 
22
22
  def run
23
- handle_results(test_app)
23
+ @xcresults_before_run = find_xcresults_in_derived_data
24
+ return handle_results(test_app)
24
25
  end
25
26
 
26
27
  def test_app
@@ -106,7 +107,7 @@ module Scan
106
107
  tests = retryable_tests(error_output)
107
108
 
108
109
  if tests.empty?
109
- UI.crash!("Failed to find failed tests to retry (could not parse error output)")
110
+ UI.build_failure!("Failed to find failed tests to retry (could not parse error output)")
110
111
  end
111
112
 
112
113
  Scan.config[:only_testing] = tests
@@ -172,21 +173,44 @@ module Scan
172
173
  return find_filename('json-compilation-database')
173
174
  end
174
175
 
176
+ def find_xcresults_in_derived_data
177
+ derived_data_path = Scan.config[:derived_data_path]
178
+ return [] if derived_data_path.nil? # Swift packages might not have derived data
179
+
180
+ xcresults_path = File.join(derived_data_path, "Logs", "Test", "*.xcresult")
181
+ return Dir[xcresults_path]
182
+ end
183
+
175
184
  def trainer_test_results
176
185
  require "trainer"
177
186
 
178
187
  results = {
179
188
  number_of_tests: 0,
180
189
  number_of_failures: 0,
181
- number_of_retries: 0
190
+ number_of_retries: 0,
191
+ number_of_tests_excluding_retries: 0,
192
+ number_of_failures_excluding_retries: 0
182
193
  }
183
194
 
184
195
  result_bundle_path = Scan.cache[:result_bundle_path]
185
196
 
197
+ # Looks for xcresult file in derived data if not specifically set
198
+ if result_bundle_path.nil?
199
+ xcresults = find_xcresults_in_derived_data
200
+ new_xcresults = xcresults - @xcresults_before_run
201
+
202
+ if new_xcresults.size != 1
203
+ UI.build_failure!("Cannot find .xcresult in derived data which is needed to determine test results. This is an issue within scan. File an issue on GitHub or try setting option `result_bundle: true`")
204
+ end
205
+
206
+ result_bundle_path = new_xcresults.first
207
+ Scan.cache[:result_bundle_path] = result_bundle_path
208
+ end
209
+
186
210
  output_path = Scan.config[:output_directory] || Dir.mktmpdir
187
211
  output_path = File.absolute_path(output_path)
188
212
 
189
- UI.crash!("A -resultBundlePath is needed to parse the test results. This should not have happened. Please file an issue.") unless result_bundle_path
213
+ UI.build_failure!("A -resultBundlePath is needed to parse the test results. This should not have happened. Please file an issue.") unless result_bundle_path
190
214
 
191
215
  params = {
192
216
  path: result_bundle_path,
@@ -222,8 +246,10 @@ module Scan
222
246
 
223
247
  resulting_paths = Trainer::TestParser.auto_convert(params)
224
248
  resulting_paths.each do |path, data|
225
- results[:number_of_tests] += data[:number_of_tests_excluding_retries]
226
- results[:number_of_failures] += data[:number_of_failures_excluding_retries]
249
+ results[:number_of_tests] += data[:number_of_tests]
250
+ results[:number_of_failures] += data[:number_of_failures]
251
+ results[:number_of_tests_excluding_retries] += data[:number_of_tests_excluding_retries]
252
+ results[:number_of_failures_excluding_retries] += data[:number_of_failures_excluding_retries]
227
253
  results[:number_of_retries] += data[:number_of_retries]
228
254
  end
229
255
 
@@ -231,13 +257,13 @@ module Scan
231
257
  end
232
258
 
233
259
  def handle_results(tests_exit_status)
234
- return if Scan.config[:build_for_testing]
260
+ return nil if Scan.config[:build_for_testing]
235
261
 
236
262
  results = trainer_test_results
237
263
 
238
264
  number_of_retries = results[:number_of_retries]
239
- number_of_tests = results[:number_of_tests]
240
- number_of_failures = results[:number_of_failures]
265
+ number_of_tests = results[:number_of_tests_excluding_retries]
266
+ number_of_failures = results[:number_of_failures_excluding_retries]
241
267
 
242
268
  SlackPoster.new.run({
243
269
  tests: number_of_tests,
@@ -283,6 +309,7 @@ module Scan
283
309
  end
284
310
 
285
311
  open_report
312
+ return results
286
313
  end
287
314
 
288
315
  def open_report
@@ -53,8 +53,9 @@ module Scan
53
53
  if config[:use_system_scm] && !options.include?("-scmProvider system")
54
54
  options << "-scmProvider system"
55
55
  end
56
- options << "-resultBundlePath '#{result_bundle_path(config[:result_bundle])}'"
56
+ options << "-resultBundlePath '#{result_bundle_path(true)}'" if config[:result_bundle]
57
57
  if FastlaneCore::Helper.xcode_at_least?(10)
58
+ options << "-parallel-testing-enabled #{config[:parallel_testing] ? 'YES' : 'NO'}" unless config[:parallel_testing].nil?
58
59
  options << "-parallel-testing-worker-count #{config[:concurrent_workers]}" if config[:concurrent_workers]
59
60
  options << "-maximum-concurrent-test-simulator-destinations #{config[:max_concurrent_simulators]}" if config[:max_concurrent_simulators]
60
61
  options << "-disable-concurrent-testing" if config[:disable_concurrent_testing]
@@ -72,9 +73,13 @@ module Scan
72
73
  end
73
74
  options << "-xctestrun '#{config[:xctestrun]}'" if config[:xctestrun]
74
75
  options << config[:xcargs] if config[:xcargs]
75
- if config[:number_of_retries] >= 1 && FastlaneCore::Helper.xcode_at_least?(13)
76
+
77
+ # Number of retries does not equal xcodebuild's -test-iterations number
78
+ # It needs include 1 iteration by default
79
+ number_of_retries = config[:number_of_retries] + 1
80
+ if number_of_retries > 1 && FastlaneCore::Helper.xcode_at_least?(13)
76
81
  options << "-retry-tests-on-failure"
77
- options << "-test-iterations #{config[:number_of_retries]}"
82
+ options << "-test-iterations #{number_of_retries}"
78
83
  end
79
84
 
80
85
  # detect_values will ensure that these values are present as Arrays if
@@ -435,7 +435,8 @@ module Spaceship
435
435
  client ||= Spaceship::ConnectAPI
436
436
  filter = {
437
437
  state: [
438
- Spaceship::ConnectAPI::ReviewSubmission::ReviewSubmissionState::WAITING_FOR_REVIEW
438
+ Spaceship::ConnectAPI::ReviewSubmission::ReviewSubmissionState::WAITING_FOR_REVIEW,
439
+ Spaceship::ConnectAPI::ReviewSubmission::ReviewSubmissionState::IN_REVIEW
439
440
  ].join(","),
440
441
  platform: platform
441
442
  }
@@ -33,6 +33,12 @@ module Trainer
33
33
  default_value: nil,
34
34
  optional: true,
35
35
  description: "Directoy in which the xml files should be written to. Same directory as source by default"),
36
+ FastlaneCore::ConfigItem.new(key: :output_filename,
37
+ short_option: "-f",
38
+ env_name: "TRAINER_OUTPUT_FILENAME",
39
+ default_value: nil,
40
+ optional: true,
41
+ description: "Filename the xml file should be written to. Defaults to name of input file. (Only works if one input file is used)"),
36
42
  FastlaneCore::ConfigItem.new(key: :fail_build,
37
43
  env_name: "TRAINER_FAIL_BUILD",
38
44
  description: "Should this step stop the build if the tests fail? Set this to false if you're handling this with a test reporter",
@@ -48,6 +54,11 @@ module Trainer
48
54
  env_name: "TRAINER_SILENT",
49
55
  description: "Silences all output",
50
56
  is_string: false,
57
+ default_value: false),
58
+ FastlaneCore::ConfigItem.new(key: :output_remove_retry_attempts,
59
+ env_name: "TRAINER_OUTPUT_REMOVE_RETRY_ATTEMPTS",
60
+ description: "Doesn't include retry attempts in the output",
61
+ is_string: false,
51
62
  default_value: false)
52
63
  ]
53
64
  end
metadata CHANGED
@@ -1,39 +1,39 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.201.0
4
+ version: 2.203.0
5
5
  platform: ruby
6
6
  authors:
7
- - Jan Piotrowski
8
- - Jorge Revuelta H
9
- - Łukasz Grabowski
10
- - Max Ott
11
- - Joshua Liebowitz
12
- - Stefan Natchev
13
- - Andrew McBurney
7
+ - Jimmy Dee
8
+ - Felix Krause
9
+ - Maksym Grebenets
10
+ - Fumiya Nakamura
11
+ - Matthew Ellis
14
12
  - Jérôme Lacoste
13
+ - Iulian Onofrei
15
14
  - Kohki Miki
16
- - Helmut Januschka
17
- - Jimmy Dee
18
15
  - Olivier Halligon
19
- - Danielle Tomlinson
20
- - Maksym Grebenets
16
+ - Roger Oba
17
+ - Helmut Januschka
18
+ - Łukasz Grabowski
19
+ - Andrew McBurney
20
+ - Manu Wallner
21
+ - Stefan Natchev
22
+ - Joshua Liebowitz
21
23
  - Manish Rathi
22
- - Matthew Ellis
23
- - Daniel Jankowski
24
- - Luka Mirosevic
25
24
  - Satoshi Namai
26
- - Roger Oba
27
- - Felix Krause
28
- - Fumiya Nakamura
29
- - Aaron Brager
30
- - Iulian Onofrei
31
25
  - Josh Holtz
32
- - Manu Wallner
26
+ - Jorge Revuelta H
27
+ - Max Ott
28
+ - Aaron Brager
29
+ - Daniel Jankowski
30
+ - Danielle Tomlinson
31
+ - Luka Mirosevic
32
+ - Jan Piotrowski
33
33
  autorequire:
34
34
  bindir: bin
35
35
  cert_chain: []
36
- date: 2022-01-21 00:00:00.000000000 Z
36
+ date: 2022-01-28 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: xcodeproj
@@ -1395,6 +1395,7 @@ files:
1395
1395
  - fastlane_core/README.md
1396
1396
  - fastlane_core/lib/assets/XMLTemplate.xml.erb
1397
1397
  - fastlane_core/lib/fastlane_core.rb
1398
+ - fastlane_core/lib/fastlane_core/.helper.rb.swp
1398
1399
  - fastlane_core/lib/fastlane_core/analytics/action_completion_context.rb
1399
1400
  - fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb
1400
1401
  - fastlane_core/lib/fastlane_core/analytics/analytics_event_builder.rb
@@ -1577,6 +1578,8 @@ files:
1577
1578
  - scan/lib/assets/ScanfileTemplate
1578
1579
  - scan/lib/assets/ScanfileTemplate.swift
1579
1580
  - scan/lib/scan.rb
1581
+ - scan/lib/scan/.detect_values.rb.swp
1582
+ - scan/lib/scan/.runner.rb.swp
1580
1583
  - scan/lib/scan/commands_generator.rb
1581
1584
  - scan/lib/scan/detect_values.rb
1582
1585
  - scan/lib/scan/error_handler.rb