Class: TestCenter::Helper::MultiScanManager::RetryingScan
- Inherits:
-
Object
- Object
- TestCenter::Helper::MultiScanManager::RetryingScan
- Defined in:
- lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan.rb
Class Method Summary collapse
-
.run(options) ⇒ Object
:nocov:.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RetryingScan
constructor
A new instance of RetryingScan.
-
#prepare_scan_config_for_destination ⇒ Object
:nocov:.
-
#run ⇒ Object
:nocov:.
- #scan_cache ⇒ Object
-
#scan_config ⇒ Object
:nocov:.
- #update_scan_options ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RetryingScan
Returns a new instance of RetryingScan.
5 6 7 8 |
# File 'lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan.rb', line 5 def initialize( = {}) @options = @retrying_scan_helper = RetryingScanHelper.new(@options) end |
Class Method Details
.run(options) ⇒ Object
:nocov:
44 45 46 |
# File 'lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan.rb', line 44 def self.run() RetryingScan.new().run end |
Instance Method Details
#prepare_scan_config_for_destination ⇒ Object
:nocov:
20 21 22 23 24 25 |
# File 'lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan.rb', line 20 def prepare_scan_config_for_destination # this allows multi_scan's `destination` option to be picked up by `scan` scan_config._values.delete(:device) scan_config._values.delete(:devices) scan_cache.clear end |
#run ⇒ Object
:nocov:
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan.rb', line 49 def run try_count = @options[:try_count] || 1 begin @retrying_scan_helper.before_testrun values = scan_config.values(ask: false) values[:xcode_path] = File.("../..", FastlaneCore::Helper.xcode_path) ScanHelper.print_scan_parameters(values) Scan::Runner.new.run @retrying_scan_helper.after_testrun true rescue FastlaneCore::Interface::FastlaneTestFailure => e @retrying_scan_helper.after_testrun(e) retry if @retrying_scan_helper.testrun_count < try_count false rescue FastlaneCore::Interface::FastlaneBuildFailure => e @retrying_scan_helper.after_testrun(e) retry if @retrying_scan_helper.testrun_count < try_count false end end |
#scan_cache ⇒ Object
15 16 17 |
# File 'lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan.rb', line 15 def scan_cache Scan.cache end |
#scan_config ⇒ Object
:nocov:
11 12 13 |
# File 'lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan.rb', line 11 def scan_config Scan.config end |
#update_scan_options ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fastlane/plugin/test_center/helper/multi_scan_manager/retrying_scan.rb', line 27 def valid_scan_keys = Fastlane::Actions::ScanAction..map(&:key) = @options.select { |k,v| valid_scan_keys.include?(k) } .merge(@retrying_scan_helper.) prepare_scan_config_for_destination [:build_for_testing] = false FastlaneCore::UI.verbose("retrying_scan #update_scan_options") .each do |k,v| next if v.nil? scan_config.set(k,v) unless v.nil? FastlaneCore::UI.verbose("\tSetting #{k.to_s} to #{v}") end end |