fastlane 2.198.0 → 2.201.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +88 -88
- data/deliver/lib/deliver/app_screenshot.rb +8 -0
- data/deliver/lib/deliver/app_screenshot_iterator.rb +1 -1
- data/fastlane/lib/.DS_Store +0 -0
- data/fastlane/lib/fastlane/.DS_Store +0 -0
- data/fastlane/lib/fastlane/actions/.DS_Store +0 -0
- data/fastlane/lib/fastlane/actions/download_dsyms.rb +26 -27
- data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +1 -1
- data/fastlane/lib/fastlane/actions/get_version_number.rb +1 -0
- data/fastlane/lib/fastlane/actions/trainer.rb +49 -0
- data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +18 -1
- data/fastlane/lib/fastlane/actions/xcversion.rb +18 -3
- data/fastlane/lib/fastlane/documentation/docs_generator.rb +17 -12
- data/fastlane/lib/fastlane/helper/xcodebuild_formatter_helper.rb +9 -0
- data/fastlane/lib/fastlane/tools.rb +2 -1
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Actions.swift +1 -1
- data/fastlane/swift/Appfile.swift +1 -1
- data/fastlane/swift/ArgumentProcessor.swift +1 -1
- data/fastlane/swift/ControlCommand.swift +1 -1
- data/fastlane/swift/Deliverfile.swift +2 -2
- data/fastlane/swift/DeliverfileProtocol.swift +2 -2
- data/fastlane/swift/Fastlane.swift +44 -15
- data/fastlane/swift/Gymfile.swift +2 -2
- data/fastlane/swift/GymfileProtocol.swift +6 -2
- data/fastlane/swift/LaneFileProtocol.swift +1 -1
- data/fastlane/swift/MainProcess.swift +1 -1
- data/fastlane/swift/Matchfile.swift +2 -2
- data/fastlane/swift/MatchfileProtocol.swift +2 -2
- data/fastlane/swift/OptionalConfigValue.swift +1 -1
- data/fastlane/swift/Plugins.swift +1 -1
- data/fastlane/swift/Precheckfile.swift +2 -2
- data/fastlane/swift/PrecheckfileProtocol.swift +2 -2
- data/fastlane/swift/RubyCommand.swift +1 -1
- data/fastlane/swift/RubyCommandable.swift +1 -1
- data/fastlane/swift/Runner.swift +4 -8
- data/fastlane/swift/RunnerArgument.swift +1 -1
- data/fastlane/swift/Scanfile.swift +2 -2
- data/fastlane/swift/ScanfileProtocol.swift +4 -4
- data/fastlane/swift/Screengrabfile.swift +2 -2
- data/fastlane/swift/ScreengrabfileProtocol.swift +2 -2
- data/fastlane/swift/Snapshotfile.swift +2 -2
- data/fastlane/swift/SnapshotfileProtocol.swift +2 -2
- data/fastlane/swift/SocketClient.swift +1 -1
- data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
- data/fastlane/swift/SocketResponse.swift +1 -1
- data/fastlane/swift/formatting/Brewfile.lock.json +14 -14
- data/fastlane/swift/main.swift +1 -1
- data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +10 -5
- data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +15 -5
- data/gym/lib/gym/generators/build_command_generator.rb +69 -23
- data/gym/lib/gym/options.rb +23 -5
- data/scan/lib/scan/options.rb +27 -7
- data/scan/lib/scan/runner.rb +58 -15
- data/scan/lib/scan/test_command_generator.rb +54 -5
- data/snapshot/lib/snapshot/options.rb +23 -7
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +1 -1
- data/snapshot/lib/snapshot/test_command_generator.rb +37 -2
- data/spaceship/lib/spaceship/client.rb +35 -15
- data/spaceship/lib/spaceship/commands_generator.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/models/app.rb +43 -0
- data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +2 -0
- data/spaceship/lib/spaceship/connect_api/models/review_submission.rb +73 -0
- data/spaceship/lib/spaceship/connect_api/models/review_submission_item.rb +40 -0
- data/spaceship/lib/spaceship/connect_api/response.rb +13 -0
- data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +83 -0
- data/spaceship/lib/spaceship/connect_api.rb +2 -0
- data/spaceship/lib/spaceship/globals.rb +9 -0
- data/spaceship/lib/spaceship/spaceauth_runner.rb +1 -1
- data/supply/lib/supply/options.rb +8 -0
- data/supply/lib/supply/uploader.rb +6 -2
- data/trainer/lib/.DS_Store +0 -0
- data/trainer/lib/assets/junit.xml.erb +20 -0
- data/trainer/lib/trainer/commands_generator.rb +51 -0
- data/trainer/lib/trainer/junit_generator.rb +31 -0
- data/trainer/lib/trainer/module.rb +10 -0
- data/trainer/lib/trainer/options.rb +55 -0
- data/trainer/lib/trainer/test_parser.rb +335 -0
- data/trainer/lib/trainer/xcresult.rb +403 -0
- data/trainer/lib/trainer.rb +7 -0
- metadata +38 -21
@@ -1,5 +1,5 @@
|
|
1
1
|
// Scanfile.swift
|
2
|
-
// Copyright (c)
|
2
|
+
// Copyright (c) 2022 FastlaneTools
|
3
3
|
|
4
4
|
// This class is automatically included in FastlaneRunner during build
|
5
5
|
|
@@ -17,4 +17,4 @@ public class Scanfile: ScanfileProtocol {
|
|
17
17
|
// during the `init` process, and you won't see this message
|
18
18
|
}
|
19
19
|
|
20
|
-
// Generated with fastlane 2.
|
20
|
+
// Generated with fastlane 2.200.0
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// ScanfileProtocol.swift
|
2
|
-
// Copyright (c)
|
2
|
+
// Copyright (c) 2022 FastlaneTools
|
3
3
|
|
4
4
|
public protocol ScanfileProtocol: class {
|
5
5
|
/// Path to the workspace file
|
@@ -14,10 +14,10 @@ public protocol ScanfileProtocol: class {
|
|
14
14
|
/// The project's scheme. Make sure it's marked as `Shared`
|
15
15
|
var scheme: String? { get }
|
16
16
|
|
17
|
-
/// The name of the simulator type you want to run tests on (e.g. 'iPhone 6')
|
17
|
+
/// The name of the simulator type you want to run tests on (e.g. 'iPhone 6' or 'iPhone SE (2nd generation) (14.5)')
|
18
18
|
var device: String? { get }
|
19
19
|
|
20
|
-
/// Array of devices to run the tests on (e.g. ['iPhone 6', 'iPad Air'])
|
20
|
+
/// Array of devices to run the tests on (e.g. ['iPhone 6', 'iPad Air', 'iPhone SE (2nd generation) (14.5)'])
|
21
21
|
var devices: [String]? { get }
|
22
22
|
|
23
23
|
/// Should skip auto detecting of devices if none were specified
|
@@ -296,4 +296,4 @@ public extension ScanfileProtocol {
|
|
296
296
|
|
297
297
|
// Please don't remove the lines below
|
298
298
|
// They are used to detect outdated files
|
299
|
-
// FastlaneRunnerAPIVersion [0.9.
|
299
|
+
// FastlaneRunnerAPIVersion [0.9.98]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// Screengrabfile.swift
|
2
|
-
// Copyright (c)
|
2
|
+
// Copyright (c) 2022 FastlaneTools
|
3
3
|
|
4
4
|
// This class is automatically included in FastlaneRunner during build
|
5
5
|
|
@@ -17,4 +17,4 @@ public class Screengrabfile: ScreengrabfileProtocol {
|
|
17
17
|
// during the `init` process, and you won't see this message
|
18
18
|
}
|
19
19
|
|
20
|
-
// Generated with fastlane 2.
|
20
|
+
// Generated with fastlane 2.200.0
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// ScreengrabfileProtocol.swift
|
2
|
-
// Copyright (c)
|
2
|
+
// Copyright (c) 2022 FastlaneTools
|
3
3
|
|
4
4
|
public protocol ScreengrabfileProtocol: class {
|
5
5
|
/// Path to the root of your Android SDK installation, e.g. ~/tools/android-sdk-macosx
|
@@ -96,4 +96,4 @@ public extension ScreengrabfileProtocol {
|
|
96
96
|
|
97
97
|
// Please don't remove the lines below
|
98
98
|
// They are used to detect outdated files
|
99
|
-
// FastlaneRunnerAPIVersion [0.9.
|
99
|
+
// FastlaneRunnerAPIVersion [0.9.88]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// Snapshotfile.swift
|
2
|
-
// Copyright (c)
|
2
|
+
// Copyright (c) 2022 FastlaneTools
|
3
3
|
|
4
4
|
// This class is automatically included in FastlaneRunner during build
|
5
5
|
|
@@ -17,4 +17,4 @@ public class Snapshotfile: SnapshotfileProtocol {
|
|
17
17
|
// during the `init` process, and you won't see this message
|
18
18
|
}
|
19
19
|
|
20
|
-
// Generated with fastlane 2.
|
20
|
+
// Generated with fastlane 2.200.0
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// SnapshotfileProtocol.swift
|
2
|
-
// Copyright (c)
|
2
|
+
// Copyright (c) 2022 FastlaneTools
|
3
3
|
|
4
4
|
public protocol SnapshotfileProtocol: class {
|
5
5
|
/// Path the workspace file
|
@@ -200,4 +200,4 @@ public extension SnapshotfileProtocol {
|
|
200
200
|
|
201
201
|
// Please don't remove the lines below
|
202
202
|
// They are used to detect outdated files
|
203
|
-
// FastlaneRunnerAPIVersion [0.9.
|
203
|
+
// FastlaneRunnerAPIVersion [0.9.82]
|
@@ -2,35 +2,35 @@
|
|
2
2
|
"entries": {
|
3
3
|
"brew": {
|
4
4
|
"swiftformat": {
|
5
|
-
"version": "0.
|
5
|
+
"version": "0.49.1",
|
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:
|
13
|
-
"sha256": "
|
12
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:c43caffb4d2cf9546b0a8fa732ffe5d95b1b1fd7ab03f1c5da39c8e7a0e8ecb4",
|
13
|
+
"sha256": "c43caffb4d2cf9546b0a8fa732ffe5d95b1b1fd7ab03f1c5da39c8e7a0e8ecb4"
|
14
14
|
},
|
15
15
|
"arm64_big_sur": {
|
16
16
|
"cellar": ":any_skip_relocation",
|
17
|
-
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:
|
18
|
-
"sha256": "
|
17
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:ad0ce5fc15fe1d339d366ece18694fdc1d14021684462a126ed20b537a1a9bf5",
|
18
|
+
"sha256": "ad0ce5fc15fe1d339d366ece18694fdc1d14021684462a126ed20b537a1a9bf5"
|
19
19
|
},
|
20
20
|
"monterey": {
|
21
21
|
"cellar": ":any_skip_relocation",
|
22
|
-
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:
|
23
|
-
"sha256": "
|
22
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:33652b8015d31dbe45e00bdc598f1b228cb63c7083b90137fdec66318a88010f",
|
23
|
+
"sha256": "33652b8015d31dbe45e00bdc598f1b228cb63c7083b90137fdec66318a88010f"
|
24
24
|
},
|
25
25
|
"big_sur": {
|
26
26
|
"cellar": ":any_skip_relocation",
|
27
|
-
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:
|
28
|
-
"sha256": "
|
27
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:f0ad88e5594a6a3e5a35834a9a22473a05511375942dbb046d1085cc537d60b8",
|
28
|
+
"sha256": "f0ad88e5594a6a3e5a35834a9a22473a05511375942dbb046d1085cc537d60b8"
|
29
29
|
},
|
30
30
|
"catalina": {
|
31
31
|
"cellar": ":any_skip_relocation",
|
32
|
-
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:
|
33
|
-
"sha256": "
|
32
|
+
"url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:564f5daf9cd82407843aed590bd4190f3e5aaa73a30b3bc8ae07135f1319ac97",
|
33
|
+
"sha256": "564f5daf9cd82407843aed590bd4190f3e5aaa73a30b3bc8ae07135f1319ac97"
|
34
34
|
}
|
35
35
|
}
|
36
36
|
}
|
@@ -56,11 +56,11 @@
|
|
56
56
|
"macOS": "11.6"
|
57
57
|
},
|
58
58
|
"monterey": {
|
59
|
-
"HOMEBREW_VERSION": "3.3.
|
59
|
+
"HOMEBREW_VERSION": "3.3.10-21-g3ba6afb",
|
60
60
|
"HOMEBREW_PREFIX": "/opt/homebrew",
|
61
|
-
"Homebrew/homebrew-core": "
|
61
|
+
"Homebrew/homebrew-core": "54f307bcd04cec374c7fd3f22fe7e6b13f1ad783",
|
62
62
|
"CLT": "13.1.0.0.1.1633545042",
|
63
|
-
"Xcode": "13.1",
|
63
|
+
"Xcode": "13.2.1",
|
64
64
|
"macOS": "12.0.1"
|
65
65
|
}
|
66
66
|
}
|
data/fastlane/swift/main.swift
CHANGED
@@ -73,12 +73,17 @@ module FastlaneCore
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def self.fetch_info_plist_with_unzip(path)
|
76
|
-
|
76
|
+
entry, error, = Open3.capture3("unzip", "-Z", "-1", path, "*Payload/*.app/Info.plist")
|
77
|
+
|
78
|
+
# unzip can return multiple Info.plist files if is an embedded app bundle (a WatchKit app)
|
79
|
+
# - ContainsWatchApp/Payload/Sample.app/Watch/Sample WatchKit App.app/Info.plist
|
80
|
+
# - ContainsWatchApp/Payload/Sample.app/Info.plist
|
81
|
+
#
|
82
|
+
# we can determine the main Info.plist by the shortest path
|
83
|
+
entry = entry.lines.map(&:chomp).min_by(&:size)
|
84
|
+
|
77
85
|
UI.command_output(error) unless error.empty?
|
78
|
-
return nil if
|
79
|
-
entry = list.chomp.split("\n").find do |e|
|
80
|
-
File.fnmatch("**/Payload/*.app/Info.plist", e, File::FNM_PATHNAME)
|
81
|
-
end
|
86
|
+
return nil if entry.nil? || entry.empty?
|
82
87
|
data, error, = Open3.capture3("unzip", "-p", path, entry)
|
83
88
|
UI.command_output(error) unless error.empty?
|
84
89
|
return nil if data.empty?
|
@@ -2,6 +2,7 @@ require 'shellwords'
|
|
2
2
|
require 'tmpdir'
|
3
3
|
require 'fileutils'
|
4
4
|
require 'credentials_manager/account_manager'
|
5
|
+
require 'securerandom'
|
5
6
|
|
6
7
|
require_relative 'features'
|
7
8
|
require_relative 'helper'
|
@@ -150,10 +151,13 @@ module FastlaneCore
|
|
150
151
|
end
|
151
152
|
|
152
153
|
def file_upload_option(source)
|
153
|
-
|
154
|
-
|
155
|
-
|
154
|
+
ext = File.extname(source).downcase
|
155
|
+
is_asset_file_type = !File.directory?(source) && [".ipa", ".pkg", ".dmg", ".zip"].include?(ext)
|
156
|
+
|
157
|
+
if is_asset_file_type
|
156
158
|
return "-assetFile #{source.shellescape}"
|
159
|
+
else
|
160
|
+
return "-f #{source.shellescape}"
|
157
161
|
end
|
158
162
|
end
|
159
163
|
|
@@ -492,9 +496,15 @@ module FastlaneCore
|
|
492
496
|
# However, -assetFile requires -assetDescription if Linux or Windows
|
493
497
|
# This will give the asset directly if macOS and asset_path exists
|
494
498
|
# otherwise it will use the .itmsp package
|
495
|
-
|
499
|
+
|
500
|
+
force_itmsp = FastlaneCore::Env.truthy?("ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD")
|
501
|
+
can_use_asset_path = Helper.is_mac? && asset_path
|
502
|
+
|
503
|
+
actual_dir = if can_use_asset_path && !force_itmsp
|
496
504
|
# The asset gets deleted upon completion so copying to a temp directory
|
497
|
-
|
505
|
+
# (with randomized filename, for multibyte-mixed filename upload fails)
|
506
|
+
new_file_name = "#{SecureRandom.uuid}#{File.extname(asset_path)}"
|
507
|
+
tmp_asset_path = File.join(Dir.tmpdir, new_file_name)
|
498
508
|
FileUtils.cp(asset_path, tmp_asset_path)
|
499
509
|
tmp_asset_path
|
500
510
|
elsif package_path
|
@@ -7,7 +7,7 @@ module Gym
|
|
7
7
|
class << self
|
8
8
|
def generate
|
9
9
|
parts = prefix
|
10
|
-
parts <<
|
10
|
+
parts << Gym.config[:xcodebuild_command]
|
11
11
|
parts += options
|
12
12
|
parts += buildactions
|
13
13
|
parts += setting
|
@@ -43,7 +43,7 @@ module Gym
|
|
43
43
|
options << "-scmProvider system"
|
44
44
|
end
|
45
45
|
options << config[:xcargs] if config[:xcargs]
|
46
|
-
options << "OTHER_SWIFT_FLAGS=\"-Xfrontend -debug-time-function-bodies\"" if config[:analyze_build_time]
|
46
|
+
options << "OTHER_SWIFT_FLAGS=\"\\\$(value) -Xfrontend -debug-time-function-bodies\"" if config[:analyze_build_time]
|
47
47
|
|
48
48
|
options
|
49
49
|
end
|
@@ -72,32 +72,78 @@ module Gym
|
|
72
72
|
def pipe
|
73
73
|
pipe = []
|
74
74
|
pipe << "| tee #{xcodebuild_log_path.shellescape}"
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
pipe << report_output_html.shellescape
|
92
|
-
elsif report_output_json
|
93
|
-
pipe << " --report json-compilation-database --output "
|
94
|
-
pipe << report_output_json.shellescape
|
95
|
-
end
|
75
|
+
|
76
|
+
formatter = Gym.config[:xcodebuild_formatter].chomp
|
77
|
+
options = legacy_xcpretty_options
|
78
|
+
|
79
|
+
if Gym.config[:disable_xcpretty] || formatter == ''
|
80
|
+
UI.verbose("Not using an xcodebuild formatter")
|
81
|
+
elsif !options.empty?
|
82
|
+
UI.important("Detected legacy xcpretty being used so formatting wth xcpretty")
|
83
|
+
UI.important("Option(s) used: #{options.join(', ')}")
|
84
|
+
pipe += pipe_xcpretty
|
85
|
+
elsif formatter == 'xcpretty'
|
86
|
+
pipe += pipe_xcpretty
|
87
|
+
elsif formatter == 'xcbeautify'
|
88
|
+
pipe += pipe_xcbeautify
|
89
|
+
else
|
90
|
+
pipe << "| #{formatter}"
|
96
91
|
end
|
92
|
+
|
97
93
|
pipe << "> /dev/null" if Gym.config[:suppress_xcode_output]
|
98
94
|
pipe
|
99
95
|
end
|
100
96
|
|
97
|
+
def pipe_xcbeautify
|
98
|
+
pipe = ['| xcbeautify']
|
99
|
+
|
100
|
+
if FastlaneCore::Helper.colors_disabled?
|
101
|
+
pipe << '--disable-colored-output'
|
102
|
+
end
|
103
|
+
|
104
|
+
return pipe
|
105
|
+
end
|
106
|
+
|
107
|
+
def legacy_xcpretty_options
|
108
|
+
options = []
|
109
|
+
|
110
|
+
options << "xcpretty_test_format" if Gym.config[:xcpretty_test_format]
|
111
|
+
options << "xcpretty_formatter" if Gym.config[:xcpretty_formatter]
|
112
|
+
options << "xcpretty_report_junit" if Gym.config[:xcpretty_report_junit]
|
113
|
+
options << "xcpretty_report_html" if Gym.config[:xcpretty_report_html]
|
114
|
+
options << "xcpretty_report_json" if Gym.config[:xcpretty_report_json]
|
115
|
+
options << "xcpretty_utf" if Gym.config[:xcpretty_utf]
|
116
|
+
|
117
|
+
return options
|
118
|
+
end
|
119
|
+
|
120
|
+
def pipe_xcpretty
|
121
|
+
pipe = []
|
122
|
+
|
123
|
+
formatter = Gym.config[:xcpretty_formatter]
|
124
|
+
pipe << "| xcpretty"
|
125
|
+
pipe << " --test" if Gym.config[:xcpretty_test_format]
|
126
|
+
pipe << " --no-color" if Helper.colors_disabled?
|
127
|
+
pipe << " --formatter " if formatter
|
128
|
+
pipe << formatter if formatter
|
129
|
+
pipe << "--utf" if Gym.config[:xcpretty_utf]
|
130
|
+
report_output_junit = Gym.config[:xcpretty_report_junit]
|
131
|
+
report_output_html = Gym.config[:xcpretty_report_html]
|
132
|
+
report_output_json = Gym.config[:xcpretty_report_json]
|
133
|
+
if report_output_junit
|
134
|
+
pipe << " --report junit --output "
|
135
|
+
pipe << report_output_junit.shellescape
|
136
|
+
elsif report_output_html
|
137
|
+
pipe << " --report html --output "
|
138
|
+
pipe << report_output_html.shellescape
|
139
|
+
elsif report_output_json
|
140
|
+
pipe << " --report json-compilation-database --output "
|
141
|
+
pipe << report_output_json.shellescape
|
142
|
+
end
|
143
|
+
|
144
|
+
pipe
|
145
|
+
end
|
146
|
+
|
101
147
|
def post_build
|
102
148
|
commands = []
|
103
149
|
commands << %{grep -E '^[0-9.]+ms' #{xcodebuild_log_path.shellescape} | grep -vE '^0\.[0-9]' | sort -nr > culprits.txt} if Gym.config[:analyze_build_time]
|
data/gym/lib/gym/options.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fastlane_core/configuration/config_item'
|
2
|
+
require 'fastlane/helper/xcodebuild_formatter_helper'
|
2
3
|
require 'credentials_manager/appfile_config'
|
3
4
|
require_relative 'module'
|
4
5
|
|
@@ -230,8 +231,18 @@ module Gym
|
|
230
231
|
description: "Suppress the output of xcodebuild to stdout. Output is still saved in buildlog_path",
|
231
232
|
optional: true,
|
232
233
|
type: Boolean),
|
234
|
+
|
235
|
+
FastlaneCore::ConfigItem.new(key: :xcodebuild_formatter,
|
236
|
+
env_names: ["GYM_XCODEBUILD_FORMATTER", "FASTLANE_XCODEBUILD_FORMATTER"],
|
237
|
+
description: "xcodebuild formatter to use (ex: 'xcbeautify', 'xcbeautify --quieter', 'xcpretty', 'xcpretty -test')",
|
238
|
+
type: String,
|
239
|
+
default_value: Fastlane::Helper::XcodebuildFormatterHelper.xcbeautify_installed? ? 'xcbeautify' : 'xcpretty',
|
240
|
+
default_value_dynamic: true),
|
241
|
+
|
242
|
+
# xcpretty
|
233
243
|
FastlaneCore::ConfigItem.new(key: :disable_xcpretty,
|
234
244
|
env_name: "DISABLE_XCPRETTY",
|
245
|
+
deprecated: "Use `xcodebuild_formatter: ''` instead",
|
235
246
|
description: "Disable xcpretty formatting of build output",
|
236
247
|
optional: true,
|
237
248
|
type: Boolean),
|
@@ -259,22 +270,29 @@ module Gym
|
|
259
270
|
env_name: "XCPRETTY_REPORT_JSON",
|
260
271
|
description: "Have xcpretty create a JSON compilation database at the provided path",
|
261
272
|
optional: true),
|
262
|
-
FastlaneCore::ConfigItem.new(key: :analyze_build_time,
|
263
|
-
env_name: "GYM_ANALYZE_BUILD_TIME",
|
264
|
-
description: "Analyze the project build time and store the output in 'culprits.txt' file",
|
265
|
-
optional: true,
|
266
|
-
type: Boolean),
|
267
273
|
FastlaneCore::ConfigItem.new(key: :xcpretty_utf,
|
268
274
|
env_name: "XCPRETTY_UTF",
|
269
275
|
description: "Have xcpretty use unicode encoding when reporting builds",
|
270
276
|
optional: true,
|
271
277
|
type: Boolean),
|
278
|
+
|
279
|
+
FastlaneCore::ConfigItem.new(key: :analyze_build_time,
|
280
|
+
env_name: "GYM_ANALYZE_BUILD_TIME",
|
281
|
+
description: "Analyze the project build time and store the output in 'culprits.txt' file",
|
282
|
+
optional: true,
|
283
|
+
type: Boolean),
|
272
284
|
FastlaneCore::ConfigItem.new(key: :skip_profile_detection,
|
273
285
|
env_name: "GYM_SKIP_PROFILE_DETECTION",
|
274
286
|
description: "Do not try to build a profile mapping from the xcodeproj. Match or a manually provided mapping should be used",
|
275
287
|
optional: true,
|
276
288
|
type: Boolean,
|
277
289
|
default_value: false),
|
290
|
+
FastlaneCore::ConfigItem.new(key: :xcodebuild_command,
|
291
|
+
env_name: "GYM_XCODE_BUILD_COMMAND",
|
292
|
+
description: "Allows for override of the default `xcodebuild` command",
|
293
|
+
type: String,
|
294
|
+
optional: true,
|
295
|
+
default_value: "xcodebuild"),
|
278
296
|
FastlaneCore::ConfigItem.new(key: :cloned_source_packages_path,
|
279
297
|
env_name: "GYM_CLONED_SOURCE_PACKAGES_PATH",
|
280
298
|
description: "Sets a custom path for Swift Package Manager dependencies",
|
data/scan/lib/scan/options.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fastlane_core/configuration/config_item'
|
2
|
+
require 'fastlane/helper/xcodebuild_formatter_helper'
|
2
3
|
require 'credentials_manager/appfile_config'
|
3
4
|
require_relative 'module'
|
4
5
|
|
@@ -60,7 +61,7 @@ module Scan
|
|
60
61
|
optional: true,
|
61
62
|
is_string: true,
|
62
63
|
env_name: "SCAN_DEVICE",
|
63
|
-
description: "The name of the simulator type you want to run tests on (e.g. 'iPhone 6')",
|
64
|
+
description: "The name of the simulator type you want to run tests on (e.g. 'iPhone 6' or 'iPhone SE (2nd generation) (14.5)')",
|
64
65
|
conflicting_options: [:devices],
|
65
66
|
conflict_block: proc do |value|
|
66
67
|
UI.user_error!("You can't use 'device' and 'devices' options in one run")
|
@@ -70,7 +71,7 @@ module Scan
|
|
70
71
|
is_string: false,
|
71
72
|
env_name: "SCAN_DEVICES",
|
72
73
|
type: Array,
|
73
|
-
description: "Array of devices to run the tests on (e.g. ['iPhone 6', 'iPad Air'])",
|
74
|
+
description: "Array of devices to run the tests on (e.g. ['iPhone 6', 'iPad Air', 'iPhone SE (2nd generation) (14.5)'])",
|
74
75
|
conflicting_options: [:device],
|
75
76
|
conflict_block: proc do |value|
|
76
77
|
UI.user_error!("You can't use 'device' and 'devices' options in one run")
|
@@ -214,11 +215,7 @@ module Scan
|
|
214
215
|
description: "Should the HTML report be opened when tests are completed?",
|
215
216
|
is_string: false,
|
216
217
|
default_value: false),
|
217
|
-
|
218
|
-
env_name: "SCAN_DISABLE_XCPRETTY",
|
219
|
-
description: "Disable xcpretty formatting of build, similar to `output_style='raw'` but this will also skip the test results table",
|
220
|
-
type: Boolean,
|
221
|
-
optional: true),
|
218
|
+
|
222
219
|
FastlaneCore::ConfigItem.new(key: :output_directory,
|
223
220
|
short_option: "-o",
|
224
221
|
env_name: "SCAN_OUTPUT_DIRECTORY",
|
@@ -227,6 +224,7 @@ module Scan
|
|
227
224
|
code_gen_default_value: "./test_output",
|
228
225
|
default_value: File.join(containing, "test_output"),
|
229
226
|
default_value_dynamic: true),
|
227
|
+
|
230
228
|
FastlaneCore::ConfigItem.new(key: :output_style,
|
231
229
|
short_option: "-b",
|
232
230
|
env_name: "SCAN_OUTPUT_STYLE",
|
@@ -263,9 +261,30 @@ module Scan
|
|
263
261
|
description: "Suppress the output of xcodebuild to stdout. Output is still saved in buildlog_path",
|
264
262
|
optional: true,
|
265
263
|
type: Boolean),
|
264
|
+
|
265
|
+
FastlaneCore::ConfigItem.new(key: :xcodebuild_formatter,
|
266
|
+
env_names: ["SCAN_XCODEBUILD_FORMATTER", "FASTLANE_XCODEBUILD_FORMATTER"],
|
267
|
+
description: "xcodebuild formatter to use (ex: 'xcbeautify', 'xcbeautify --quieter', 'xcpretty', 'xcpretty -test')",
|
268
|
+
type: String,
|
269
|
+
default_value: Fastlane::Helper::XcodebuildFormatterHelper.xcbeautify_installed? ? 'xcbeautify' : 'xcpretty',
|
270
|
+
default_value_dynamic: true),
|
271
|
+
|
272
|
+
# xcpretty
|
273
|
+
FastlaneCore::ConfigItem.new(key: :disable_xcpretty,
|
274
|
+
env_name: "SCAN_DISABLE_XCPRETTY",
|
275
|
+
deprecated: "Use `output_style: 'raw'` instead",
|
276
|
+
description: "Disable xcpretty formatting of build, similar to `output_style='raw'` but this will also skip the test results table",
|
277
|
+
type: Boolean,
|
278
|
+
optional: true),
|
266
279
|
FastlaneCore::ConfigItem.new(key: :formatter,
|
267
280
|
short_option: "-n",
|
268
281
|
env_name: "SCAN_FORMATTER",
|
282
|
+
deprecated: "Use 'xcpretty_formatter' instead",
|
283
|
+
description: "A custom xcpretty formatter to use",
|
284
|
+
optional: true),
|
285
|
+
FastlaneCore::ConfigItem.new(key: :xcpretty_formatter,
|
286
|
+
short_option: "-N",
|
287
|
+
env_name: "SCAN_XCPRETTY_FORMATTER",
|
269
288
|
description: "A custom xcpretty formatter to use",
|
270
289
|
optional: true),
|
271
290
|
FastlaneCore::ConfigItem.new(key: :xcpretty_args,
|
@@ -273,6 +292,7 @@ module Scan
|
|
273
292
|
description: "Pass in xcpretty additional command line arguments (e.g. '--test --no-color' or '--tap --no-utf')",
|
274
293
|
type: String,
|
275
294
|
optional: true),
|
295
|
+
|
276
296
|
FastlaneCore::ConfigItem.new(key: :derived_data_path,
|
277
297
|
short_option: "-j",
|
278
298
|
env_name: "SCAN_DERIVED_DATA_PATH",
|
data/scan/lib/scan/runner.rb
CHANGED
@@ -51,7 +51,9 @@ module Scan
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
|
54
|
+
# Set retries to 0 if Xcode 13 because TestCommandGenerator will set '-retry-tests-on-failure -test-iterations'
|
55
|
+
retries = Helper.xcode_at_least?(13) ? 0 : Scan.config[:number_of_retries]
|
56
|
+
execute(retries: retries)
|
55
57
|
end
|
56
58
|
|
57
59
|
def execute(retries: 0)
|
@@ -126,7 +128,7 @@ module Scan
|
|
126
128
|
|
127
129
|
test_cases = suite.split(":\n").fetch(1, []).split("\n").each
|
128
130
|
.select { |line| line.match?(/^\s+/) }
|
129
|
-
.map { |line| line.strip.gsub(
|
131
|
+
.map { |line| line.strip.gsub(/[\s\.]/, "/").gsub(/[\-\[\]\(\)]/, "") }
|
130
132
|
.map { |line| suite_name + "/" + line }
|
131
133
|
|
132
134
|
retryable_tests += test_cases
|
@@ -135,27 +137,68 @@ module Scan
|
|
135
137
|
return retryable_tests.uniq
|
136
138
|
end
|
137
139
|
|
138
|
-
def
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
140
|
+
def trainer_test_results
|
141
|
+
require "trainer"
|
142
|
+
|
143
|
+
results = {
|
144
|
+
number_of_tests: 0,
|
145
|
+
number_of_failures: 0,
|
146
|
+
number_of_retries: 0
|
147
|
+
}
|
148
|
+
|
149
|
+
result_bundle_path = Scan.cache[:result_bundle_path]
|
150
|
+
output_path = Scan.config[:output_directory] || Dir.mktmpdir
|
151
|
+
|
152
|
+
UI.crash!("A -resultBundlePath is needed to parse the test results. This should not have happened. Please file an issue.") unless result_bundle_path
|
153
|
+
|
154
|
+
params = {
|
155
|
+
path: result_bundle_path,
|
156
|
+
output_path: output_path,
|
157
|
+
silent: true,
|
158
|
+
extension: "xml"
|
159
|
+
}
|
160
|
+
|
161
|
+
resulting_paths = Trainer::TestParser.auto_convert(params)
|
162
|
+
resulting_paths.each do |path, data|
|
163
|
+
results[:number_of_tests] += data[:number_of_tests_excluding_retries]
|
164
|
+
results[:number_of_failures] += data[:number_of_failures_excluding_retries]
|
165
|
+
results[:number_of_retries] += data[:number_of_retries]
|
144
166
|
end
|
145
167
|
|
146
|
-
|
147
|
-
|
168
|
+
return results
|
169
|
+
end
|
170
|
+
|
171
|
+
def handle_results(tests_exit_status)
|
172
|
+
results = trainer_test_results
|
148
173
|
|
149
|
-
|
150
|
-
|
174
|
+
number_of_retries = results[:number_of_retries]
|
175
|
+
number_of_tests = results[:number_of_tests]
|
176
|
+
number_of_failures = results[:number_of_failures]
|
177
|
+
|
178
|
+
SlackPoster.new.run({
|
179
|
+
tests: number_of_tests,
|
180
|
+
failures: number_of_failures
|
181
|
+
})
|
182
|
+
|
183
|
+
if number_of_failures > 0
|
184
|
+
failures_str = number_of_failures.to_s.red
|
151
185
|
else
|
152
|
-
failures_str =
|
186
|
+
failures_str = number_of_failures.to_s.green
|
153
187
|
end
|
154
188
|
|
189
|
+
retries_str = case number_of_retries
|
190
|
+
when 0
|
191
|
+
""
|
192
|
+
when 1
|
193
|
+
" (and 1 retry)"
|
194
|
+
else
|
195
|
+
" (and #{number_of_retries} retries)"
|
196
|
+
end
|
197
|
+
|
155
198
|
puts(Terminal::Table.new({
|
156
199
|
title: "Test Results",
|
157
200
|
rows: [
|
158
|
-
["Number of tests",
|
201
|
+
["Number of tests", "#{number_of_tests}#{retries_str}"],
|
159
202
|
["Number of failures", failures_str]
|
160
203
|
]
|
161
204
|
}))
|
@@ -165,7 +208,7 @@ module Scan
|
|
165
208
|
zip_build_products
|
166
209
|
copy_xctestrun
|
167
210
|
|
168
|
-
if
|
211
|
+
if number_of_failures > 0
|
169
212
|
open_report
|
170
213
|
|
171
214
|
UI.test_failure!("Tests have failed")
|