fastlane-plugin-try_scan 0.3.0 → 1.0.1
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/README.md +22 -19
- data/lib/fastlane/plugin/try_scan/actions/try_scan_action.rb +54 -61
- data/lib/fastlane/plugin/try_scan/helper/scan_helper.rb +1 -23
- data/lib/fastlane/plugin/try_scan/helper/try_scan_runner.rb +72 -96
- data/lib/fastlane/plugin/try_scan/version.rb +1 -1
- metadata +10 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8b1ddd52d18056454daac6439174007793d35118f4288fb081351b3afb4b9bd
|
4
|
+
data.tar.gz: ef591e6c38f9bccb374acd281c3b3b35b3cbc9e312b8f1148ed742f1a53819eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 464e74a6bc906a21eaba25240239e39c16892060e381375ee1312105e4e65ff639b198001f2cc96a420bb3afa50b655404314e08cefb863a99550778e6c31c12
|
7
|
+
data.tar.gz: c756f55f28a47ed440578aeb24aae388257a83b0a4ee773d0522c2a34b63a27a638d1ae5c6d81e21da550425cdd1e51e0f30011c9f1f25ee55f5d6c40861f67e
|
data/README.md
CHANGED
@@ -2,36 +2,39 @@
|
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/fastlane-plugin-try_scan)
|
4
4
|
|
5
|
+
## About try_scan
|
6
|
+
|
7
|
+
The easiest way to rerun tests of your iOS and Mac app 🚀
|
8
|
+
|
9
|
+
Under the hood `try_scan` uses official [`fastlane scan action`](https://docs.fastlane.tools/actions/scan/), it means that you are able to provide any `scan` options and use `Scanfile` as before — everything will work like a charm, `try_scan` just brings couple of new amazing options:
|
10
|
+
|
11
|
+
| Option | Description | Default |
|
12
|
+
| ------- |------------ | ------- |
|
13
|
+
| try_count | Number of times to try to get your tests green | 1 |
|
14
|
+
| try_parallel | Should first run be executed in parallel? Equivalent to `-parallel-testing-enabled` | true |
|
15
|
+
| retry_parallel | Should subsequent runs be executed in parallel? Required `try_parallel: true` | true |
|
16
|
+
| parallel_workers | Specify the exact number of test runners that will be spawned during parallel testing. Equivalent to `-parallel-testing-worker-count` and `concurrent_workers` | |
|
17
|
+
| retry_build | Should building be retried after failure? | false |
|
18
|
+
| retry_strategy | What would you like to retry after failure: test, class or suite? | test |
|
19
|
+
|
20
|
+
## Requirements
|
21
|
+
|
22
|
+
* Xcode 11.x or greater. Download it at the [Apple Developer - Downloads](https://developer.apple.com/downloads) or the [Mac App Store](https://apps.apple.com/us/app/xcode/id497799835?mt=12).
|
23
|
+
|
5
24
|
## Getting Started
|
6
25
|
|
7
|
-
|
26
|
+
To get started with `try_scan`, add it to your project by running:
|
8
27
|
|
9
28
|
```bash
|
10
|
-
fastlane add_plugin try_scan
|
29
|
+
$ fastlane add_plugin try_scan
|
11
30
|
```
|
12
31
|
|
13
|
-
## About try_scan
|
14
|
-
|
15
|
-
Simple way to retry your scan action 🚀
|
16
|
-
|
17
32
|
## Usage
|
18
33
|
|
19
34
|
```ruby
|
20
35
|
try_scan(
|
21
36
|
workspace: "Example.xcworkspace",
|
22
|
-
devices: ["iPhone
|
37
|
+
devices: ["iPhone 7", "iPad Air"],
|
23
38
|
try_count: 3
|
24
39
|
)
|
25
40
|
```
|
26
|
-
|
27
|
-
## Issues and Feedback
|
28
|
-
|
29
|
-
For any other issues and feedback about this plugin, please submit it to this repository.
|
30
|
-
|
31
|
-
## Troubleshooting
|
32
|
-
|
33
|
-
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
34
|
-
|
35
|
-
## About _fastlane_
|
36
|
-
|
37
|
-
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
|
-
|
4
3
|
require 'json'
|
5
|
-
require 'nokogiri'
|
6
4
|
require 'fastlane/actions/scan'
|
7
5
|
require_relative '../helper/scan_helper'
|
8
6
|
require_relative '../helper/try_scan_runner'
|
@@ -11,61 +9,16 @@ module Fastlane
|
|
11
9
|
|
12
10
|
class TryScanAction < Action
|
13
11
|
def self.run(params)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
raise FastlaneCore::UI.test_failure!('Tests have failed') if params[:fail_build] && !success
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.prepare_for_testing(params)
|
21
|
-
warn_of_xcode11_result_bundle_incompatability(params)
|
22
|
-
use_scanfile_to_override_settings(params.values)
|
23
|
-
turn_off_concurrent_workers(params.values)
|
24
|
-
prepare_scan_config(params.values)
|
25
|
-
coerce_destination_to_array(params)
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.warn_of_xcode11_result_bundle_incompatability(params)
|
29
|
-
if FastlaneCore::Helper.xcode_at_least?('11.0.0')
|
30
|
-
if params[:result_bundle]
|
31
|
-
FastlaneCore::UI.important('As of Xcode 11, test_result bundles created in the output directory are actually symbolic links to an xcresult bundle')
|
32
|
-
end
|
33
|
-
elsif params[:output_types]&.include?('xcresult')
|
34
|
-
FastlaneCore::UI.important("The 'xcresult' :output_type is only supported for Xcode 11 and greater. You are using #{FastlaneCore::Helper.xcode_version}.")
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.coerce_destination_to_array(params)
|
39
|
-
destination = params[:destination] || Scan.config[:destination] || []
|
40
|
-
unless destination.kind_of?(Array)
|
41
|
-
params[:destination] = Scan.config[:destination] = [destination]
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.turn_off_concurrent_workers(scan_options)
|
46
|
-
if Gem::Version.new(Fastlane::VERSION) >= Gem::Version.new('2.142.0')
|
47
|
-
scan_options.delete(:concurrent_workers) if scan_options[:concurrent_workers].to_i > 0
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def self.use_scanfile_to_override_settings(scan_options)
|
52
|
-
overridden_options = FastlaneScanHelper.options_from_configuration_file(
|
53
|
-
FastlaneScanHelper.scan_options_from_try_scan_options(scan_options)
|
54
|
-
)
|
12
|
+
if Helper.xcode_at_least?('11.0.0')
|
13
|
+
params[:destination] = [params[:destination]] if params[:destination] && !params[:destination].kind_of?(Array)
|
14
|
+
success = TryScanManager::Runner.new(params.values).run
|
55
15
|
|
56
|
-
|
57
|
-
|
58
|
-
|
16
|
+
raise FastlaneCore::UI.test_failure!('Tests have failed') if params[:fail_build] && !success
|
17
|
+
else
|
18
|
+
raise FastlaneCore::UI.user_error!("Minimum supported Xcode: `v11.0.0` (used: `v#{Helper.xcode_version}`)")
|
59
19
|
end
|
60
20
|
end
|
61
21
|
|
62
|
-
def self.prepare_scan_config(scan_options)
|
63
|
-
Scan.config ||= FastlaneCore::Configuration.create(
|
64
|
-
Fastlane::Actions::ScanAction.available_options,
|
65
|
-
FastlaneScanHelper.scan_options_from_try_scan_options(scan_options)
|
66
|
-
)
|
67
|
-
end
|
68
|
-
|
69
22
|
#####################################################
|
70
23
|
# Documentation #
|
71
24
|
#####################################################
|
@@ -78,20 +31,60 @@ module Fastlane
|
|
78
31
|
["Alexey Alter-Pesotskiy"]
|
79
32
|
end
|
80
33
|
|
81
|
-
def self.scan_options
|
82
|
-
ScanAction.available_options.reject { |config| %i[output_types].include?(config.key) }
|
83
|
-
end
|
84
|
-
|
85
34
|
def self.available_options
|
86
|
-
|
87
|
-
scan_options + [
|
35
|
+
ScanAction.available_options + [
|
88
36
|
FastlaneCore::ConfigItem.new(
|
89
37
|
key: :try_count,
|
90
38
|
env_name: "FL_TRY_SCAN_TRY_COUNT",
|
91
|
-
description: "
|
39
|
+
description: "Number of times to try to get your tests green",
|
92
40
|
type: Integer,
|
93
41
|
is_string: false,
|
42
|
+
optional: true,
|
94
43
|
default_value: 1
|
44
|
+
),
|
45
|
+
FastlaneCore::ConfigItem.new(
|
46
|
+
key: :try_parallel,
|
47
|
+
env_name: "FL_TRY_SCAN_TRY_PARALLEL",
|
48
|
+
description: "Should first run be executed in parallel? Equivalent to -parallel-testing-enabled",
|
49
|
+
is_string: false,
|
50
|
+
optional: true,
|
51
|
+
default_value: true
|
52
|
+
),
|
53
|
+
FastlaneCore::ConfigItem.new(
|
54
|
+
key: :retry_parallel,
|
55
|
+
env_name: "FL_TRY_SCAN_RETRY_PARALLEL",
|
56
|
+
description: "Should subsequent runs be executed in parallel? Required :try_parallel: true",
|
57
|
+
is_string: false,
|
58
|
+
optional: true,
|
59
|
+
default_value: true
|
60
|
+
),
|
61
|
+
FastlaneCore::ConfigItem.new(
|
62
|
+
key: :parallel_workers,
|
63
|
+
env_name: "FL_TRY_SCAN_PARALLEL_WORKERS",
|
64
|
+
description: "Specify the exact number of test runners that will be spawned during parallel testing. Equivalent to -parallel-testing-worker-count and :concurrent_workers",
|
65
|
+
type: Integer,
|
66
|
+
is_string: false,
|
67
|
+
optional: true
|
68
|
+
),
|
69
|
+
FastlaneCore::ConfigItem.new(
|
70
|
+
key: :retry_build,
|
71
|
+
env_name: "FL_TRY_SCAN_RETRY_BUILD",
|
72
|
+
description: "Should building be retried after failure?",
|
73
|
+
is_string: false,
|
74
|
+
optional: true,
|
75
|
+
default_value: false
|
76
|
+
),
|
77
|
+
FastlaneCore::ConfigItem.new(
|
78
|
+
key: :retry_strategy,
|
79
|
+
env_name: "FL_TRY_SCAN_RETRY_STRATEGY",
|
80
|
+
description: "What would you like to retry after failure: test, class or suite?",
|
81
|
+
is_string: true,
|
82
|
+
optional: true,
|
83
|
+
default_value: 'test',
|
84
|
+
verify_block: proc do |strategy|
|
85
|
+
possible_strategies = ['test', 'class', 'suite']
|
86
|
+
UI.user_error!("Error: :retry_strategy must equal to one of the following values: #{possible_strategies}") unless possible_strategies.include?(strategy)
|
87
|
+
end
|
95
88
|
)
|
96
89
|
]
|
97
90
|
end
|
@@ -101,7 +94,7 @@ module Fastlane
|
|
101
94
|
end
|
102
95
|
|
103
96
|
def self.is_supported?(platform)
|
104
|
-
[:ios].include?(platform)
|
97
|
+
[:ios, :mac].include?(platform)
|
105
98
|
end
|
106
99
|
end
|
107
100
|
end
|
@@ -19,31 +19,9 @@ module TryScanManager
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.scan_options_from_try_scan_options(params)
|
22
|
-
valid_scan_keys = Fastlane::Actions::ScanAction.available_options.map(&:key)
|
23
22
|
params.select { |key, _| valid_scan_keys.include?(key) }
|
24
23
|
end
|
25
24
|
|
26
|
-
def self.options_from_configuration_file(params)
|
27
|
-
config = FastlaneCore::Configuration.create(
|
28
|
-
Fastlane::Actions::ScanAction.available_options,
|
29
|
-
params
|
30
|
-
)
|
31
|
-
config_file = config.load_configuration_file(Scan.scanfile_name, nil, true)
|
32
|
-
overridden_options = config_file ? config_file.options : {}
|
33
|
-
|
34
|
-
FastlaneCore::Project.detect_projects(config)
|
35
|
-
project = FastlaneCore::Project.new(config)
|
36
|
-
|
37
|
-
imported_path = File.expand_path(Scan.scanfile_name)
|
38
|
-
Dir.chdir(File.expand_path("..", project.path)) do
|
39
|
-
if File.expand_path(Scan.scanfile_name) != imported_path
|
40
|
-
config_file = config.load_configuration_file(Scan.scanfile_name, nil, true)
|
41
|
-
end
|
42
|
-
overridden_options.merge!(config_file.options) if config_file
|
43
|
-
end
|
44
|
-
overridden_options
|
45
|
-
end
|
46
|
-
|
47
25
|
def self.remove_preexisting_simulator_logs(params)
|
48
26
|
return unless params[:include_simulator_logs]
|
49
27
|
|
@@ -90,4 +68,4 @@ module TryScanManager
|
|
90
68
|
end
|
91
69
|
end
|
92
70
|
end
|
93
|
-
end
|
71
|
+
end
|
@@ -1,46 +1,42 @@
|
|
1
1
|
module TryScanManager
|
2
2
|
class Runner
|
3
|
-
|
4
3
|
FastlaneScanHelper = TryScanManager::Helper::FastlaneScanHelper
|
5
4
|
|
6
5
|
def initialize(options = {})
|
7
6
|
@options = options
|
7
|
+
@options[:try_count] = 1 if @options[:try_count] < 1
|
8
|
+
@options[:result_bundle] = true
|
8
9
|
end
|
9
10
|
|
10
11
|
def run
|
11
|
-
|
12
|
+
configure_xcargs
|
13
|
+
prepare_scan_config(@options)
|
12
14
|
print_summary
|
13
15
|
@attempt = 1
|
14
16
|
begin
|
15
17
|
warn_of_performing_attempts
|
16
18
|
clear_preexisting_data
|
17
19
|
Scan::Runner.new.run
|
18
|
-
|
20
|
+
print_try_scan_result
|
19
21
|
return true
|
20
22
|
rescue FastlaneCore::Interface::FastlaneTestFailure => _
|
21
|
-
failed_tests =
|
22
|
-
|
23
|
-
|
24
|
-
return false if @attempt >= @options[:try_count]
|
23
|
+
failed_tests = failed_tests_from_xcresult_report
|
24
|
+
print_try_scan_result(failed_tests_count: failed_tests.size)
|
25
|
+
return false if finish?
|
25
26
|
|
26
27
|
@attempt += 1
|
27
28
|
update_scan_options(failed_tests)
|
28
29
|
retry
|
29
30
|
rescue FastlaneCore::Interface::FastlaneBuildFailure => _
|
30
|
-
return false if
|
31
|
+
return false if finish? || !@options[:retry_build]
|
31
32
|
|
32
33
|
@attempt += 1
|
33
34
|
retry
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
|
-
def
|
38
|
-
|
39
|
-
output_types = Scan.config[:output_types].split(',')
|
40
|
-
output_types << 'junit'
|
41
|
-
Scan.config[:output_types] = output_types.join(',')
|
42
|
-
end
|
43
|
-
@options[:try_count] = 1 if @options[:try_count] < 1
|
38
|
+
def finish?
|
39
|
+
@attempt >= @options[:try_count]
|
44
40
|
end
|
45
41
|
|
46
42
|
def print_summary
|
@@ -70,12 +66,10 @@ module TryScanManager
|
|
70
66
|
FastlaneScanHelper.remove_report_files
|
71
67
|
end
|
72
68
|
|
73
|
-
def
|
74
|
-
return unless parallel_running?
|
75
|
-
|
69
|
+
def print_try_scan_result(failed_tests_count: 0)
|
76
70
|
FastlaneCore::UI.important("TryScan: result after #{ordinalized_attempt} shot 👇")
|
77
71
|
FastlaneCore::PrintTable.print_values(
|
78
|
-
config: {"Number of tests" => tests_count_from_xcresult_report, "Number of failures" => failed_tests_count},
|
72
|
+
config: { "Number of tests" => tests_count_from_xcresult_report, "Number of failures" => failed_tests_count },
|
79
73
|
title: "Test Results"
|
80
74
|
)
|
81
75
|
end
|
@@ -93,98 +87,73 @@ module TryScanManager
|
|
93
87
|
end
|
94
88
|
end
|
95
89
|
|
96
|
-
def
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
scan_options[:test_without_building] = true
|
103
|
-
scan_options[:build_for_testing] = false
|
104
|
-
scan_options.delete(:skip_testing)
|
105
|
-
Scan.cache.clear
|
106
|
-
scan_options.each do |key, val|
|
107
|
-
next if val.nil?
|
90
|
+
def prepare_scan_config(scan_options)
|
91
|
+
Scan.config = FastlaneCore::Configuration.create(
|
92
|
+
Fastlane::Actions::ScanAction.available_options,
|
93
|
+
FastlaneScanHelper.scan_options_from_try_scan_options(scan_options)
|
94
|
+
)
|
95
|
+
end
|
108
96
|
|
109
|
-
|
110
|
-
|
97
|
+
def configure_xcargs
|
98
|
+
if @options[:xcargs]&.include?('-parallel-testing-enabled')
|
99
|
+
FastlaneCore::UI.important("TryScan overwrites `-parallel-testing-enabled` in :xcargs, use :try_parallel option instead")
|
100
|
+
@options[:xcargs].gsub!(/-parallel-testing-enabled(=|\s+)(YES|NO)/, '')
|
111
101
|
end
|
112
|
-
end
|
113
102
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
FastlaneCore::UI.important(":xcargs, #{xcargs}, contained 'build-for-testing', removing it")
|
118
|
-
xcargs.slice!('build-for-testing')
|
103
|
+
if @options[:xcargs]&.include?('-parallel-testing-worker-count')
|
104
|
+
FastlaneCore::UI.important("TryScan overwrites `-parallel-testing-worker-count` in :xcargs, use :concurrent_workers option instead")
|
105
|
+
@options[:xcargs].gsub!(/-parallel-testing-worker-count(=|\s+)(\d+)/, '')
|
119
106
|
end
|
120
|
-
|
121
|
-
|
122
|
-
|
107
|
+
|
108
|
+
if @options[:xcargs]&.include?('build-for-testing') || @options[:build_for_testing]
|
109
|
+
FastlaneCore::UI.important("TryScan rejects `build-for-testing` request, use it in a separate scan lane")
|
110
|
+
@options[:xcargs].slice!('build-for-testing')
|
111
|
+
@options[:build_for_testing] = nil
|
123
112
|
end
|
124
|
-
@options.select { |key, _| FastlaneScanHelper.valid_scan_keys.include?(key) }.merge({ xcargs: xcargs })
|
125
|
-
end
|
126
113
|
|
127
|
-
|
128
|
-
if
|
129
|
-
|
114
|
+
xcargs = []
|
115
|
+
if @options[:try_parallel]
|
116
|
+
xcargs << '-parallel-testing-enabled YES'
|
117
|
+
if @options[:parallel_workers] || @options[:concurrent_workers]
|
118
|
+
workers_count = [@options[:parallel_workers].to_i, @options[:concurrent_workers].to_i].max
|
119
|
+
xcargs << "-parallel-testing-worker-count #{workers_count}"
|
120
|
+
@options[:concurrent_workers] = nil
|
121
|
+
end
|
130
122
|
else
|
131
|
-
|
123
|
+
xcargs << '-parallel-testing-enabled NO'
|
132
124
|
end
|
125
|
+
@options[:xcargs] = "#{@options[:xcargs]} #{xcargs.join(' ')}"
|
133
126
|
end
|
134
127
|
|
135
|
-
def
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
128
|
+
def update_scan_options(failed_tests)
|
129
|
+
scan_options = FastlaneScanHelper.scan_options_from_try_scan_options(@options)
|
130
|
+
scan_options[:only_testing] = failed_tests
|
131
|
+
scan_options[:skip_build] = true
|
132
|
+
scan_options.delete(:skip_testing)
|
133
|
+
if @options[:try_parallel] && !@options[:retry_parallel]
|
134
|
+
scan_options[:xcargs].gsub!(/-parallel-testing-enabled(=|\s+)(YES|NO)/, '-parallel-testing-enabled NO')
|
135
|
+
scan_options[:xcargs].gsub!(/-parallel-testing-worker-count(=|\s+)(\d+)/, '')
|
136
|
+
end
|
140
137
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
test_cases = report.xpath('//testcase')
|
145
|
-
only_testing = []
|
146
|
-
test_cases.each do |test_case|
|
147
|
-
next if test_case.xpath('failure').empty?
|
138
|
+
Scan.cache.clear
|
139
|
+
scan_options.each do |key, val|
|
140
|
+
next if val.nil?
|
148
141
|
|
149
|
-
|
150
|
-
|
151
|
-
only_testing << "#{suite_name}/#{test_class}/#{test_name}"
|
142
|
+
Scan.config.set(key, val)
|
143
|
+
FastlaneCore::UI.verbose("\tSetting #{key} to #{val}")
|
152
144
|
end
|
153
|
-
only_testing
|
154
145
|
end
|
155
146
|
|
156
|
-
def
|
157
|
-
|
158
|
-
report_options = FastlaneScanHelper.report_options
|
159
|
-
output_files = report_options.instance_variable_get(:@output_files)
|
160
|
-
output_directory = report_options.instance_variable_get(:@output_directory)
|
161
|
-
file_name = output_files.select { |name| name.include?('.xml') }.first
|
162
|
-
@junit_report_path = "#{output_directory}/#{file_name}"
|
163
|
-
@cached_junit_report = File.open(@junit_report_path) { |f| Nokogiri::XML(f) }
|
164
|
-
end
|
165
|
-
@cached_junit_report
|
147
|
+
def retry_failed_test?
|
148
|
+
@options[:retry_strategy] == 'test'
|
166
149
|
end
|
167
150
|
|
168
|
-
def
|
169
|
-
|
170
|
-
|
171
|
-
old_junit_report = junit_report(cached: true)
|
172
|
-
new_junit_report = junit_report(cached: false)
|
173
|
-
|
174
|
-
new_junit_report.css("testsuites").zip(old_junit_report.css("testsuites")).each do |new_suites, old_suites|
|
175
|
-
old_suites.attributes["failures"].value = new_suites.attributes["failures"].value
|
176
|
-
new_suites.css("testsuite").zip(old_suites.css("testsuite")).each do |new_suite, old_suite|
|
177
|
-
old_suite.attributes["failures"].value = new_suite.attributes["failures"].value
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
|
-
new_junit_report.css('testcase').each do |node1|
|
182
|
-
old_junit_report.css('testcase').each do |node2|
|
183
|
-
node2.children = node1.children if node1['name'] == node2['name']
|
184
|
-
end
|
185
|
-
end
|
151
|
+
def retry_failed_class?
|
152
|
+
@options[:retry_strategy] == 'class'
|
153
|
+
end
|
186
154
|
|
187
|
-
|
155
|
+
def retry_failed_suite?
|
156
|
+
@options[:retry_strategy] == 'suite'
|
188
157
|
end
|
189
158
|
|
190
159
|
def parse_xcresult_report
|
@@ -205,13 +174,20 @@ module TryScanManager
|
|
205
174
|
begin
|
206
175
|
test_class = test_path.split('.').first
|
207
176
|
test_name = test_path.split('.')[1].split('(').first
|
208
|
-
rescue
|
177
|
+
rescue
|
209
178
|
test_class = test_path.split('[')[1].split(' ').first
|
210
179
|
test_name = test_path.split(' ')[1].split(']').first
|
211
180
|
end
|
212
|
-
only_testing <<
|
181
|
+
only_testing <<
|
182
|
+
if retry_failed_test?
|
183
|
+
"#{suite_name}/#{test_class}/#{test_name}"
|
184
|
+
elsif retry_failed_class?
|
185
|
+
"#{suite_name}/#{test_class}"
|
186
|
+
elsif retry_failed_suite?
|
187
|
+
suite_name
|
188
|
+
end
|
213
189
|
end
|
214
|
-
only_testing
|
190
|
+
only_testing.uniq
|
215
191
|
end
|
216
192
|
|
217
193
|
def tests_count_from_xcresult_report
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-try_scan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Alter-Pesotskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: nokogiri
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: json
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: pry
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,21 +39,7 @@ dependencies:
|
|
67
39
|
- !ruby/object:Gem::Version
|
68
40
|
version: '0'
|
69
41
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec_junit_formatter
|
42
|
+
name: rake
|
85
43
|
requirement: !ruby/object:Gem::Requirement
|
86
44
|
requirements:
|
87
45
|
- - ">="
|
@@ -95,19 +53,19 @@ dependencies:
|
|
95
53
|
- !ruby/object:Gem::Version
|
96
54
|
version: '0'
|
97
55
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
56
|
+
name: fasterer
|
99
57
|
requirement: !ruby/object:Gem::Requirement
|
100
58
|
requirements:
|
101
|
-
- -
|
59
|
+
- - '='
|
102
60
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
61
|
+
version: 0.8.3
|
104
62
|
type: :development
|
105
63
|
prerelease: false
|
106
64
|
version_requirements: !ruby/object:Gem::Requirement
|
107
65
|
requirements:
|
108
|
-
- -
|
66
|
+
- - '='
|
109
67
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
68
|
+
version: 0.8.3
|
111
69
|
- !ruby/object:Gem::Dependency
|
112
70
|
name: rubocop
|
113
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +123,7 @@ dependencies:
|
|
165
123
|
- !ruby/object:Gem::Version
|
166
124
|
version: 2.144.0
|
167
125
|
description:
|
168
|
-
email:
|
126
|
+
email: a.alterpesotskiy@mail.ru
|
169
127
|
executables: []
|
170
128
|
extensions: []
|
171
129
|
extra_rdoc_files: []
|
@@ -200,5 +158,5 @@ requirements: []
|
|
200
158
|
rubygems_version: 3.0.3
|
201
159
|
signing_key:
|
202
160
|
specification_version: 4
|
203
|
-
summary:
|
161
|
+
summary: The easiest way to retry your fastlane scan action
|
204
162
|
test_files: []
|