Class: Fastlane::Actions::TryScanAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::TryScanAction
- Defined in:
- lib/fastlane/plugin/try_scan/actions/try_scan_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .category ⇒ Object
- .coerce_destination_to_array(params) ⇒ Object
-
.description ⇒ Object
Documentation #.
- .is_supported?(platform) ⇒ Boolean
- .prepare_for_testing(params) ⇒ Object
- .prepare_scan_config(scan_options) ⇒ Object
- .run(params) ⇒ Object
- .scan_options ⇒ Object
- .turn_off_concurrent_workers(scan_options) ⇒ Object
- .use_scanfile_to_override_settings(scan_options) ⇒ Object
- .warn_of_xcode11_result_bundle_incompatability(params) ⇒ Object
Class Method Details
.authors ⇒ Object
75 76 77 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 75 def self. ["Alexey Alter-Pesotskiy"] end |
.available_options ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 83 def self. = ScanAction..reject { |config| i[output_types].include?(config.key) } + [ FastlaneCore::ConfigItem.new( key: :try_count, env_name: "FL_TRY_SCAN_TRY_COUNT", description: "The number of times to retry running tests via scan", type: Integer, is_string: false, default_value: 1 ) ] end |
.category ⇒ Object
97 98 99 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 97 def self.category :testing end |
.coerce_destination_to_array(params) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 36 def self.coerce_destination_to_array(params) destination = params[:destination] || Scan.config[:destination] || [] unless destination.kind_of?(Array) params[:destination] = Scan.config[:destination] = [destination] end end |
.description ⇒ Object
Documentation #
71 72 73 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 71 def self.description "Simple way to retry your scan action" end |
.is_supported?(platform) ⇒ Boolean
101 102 103 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 101 def self.is_supported?(platform) [:ios].include?(platform) end |
.prepare_for_testing(params) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 18 def self.prepare_for_testing(params) warn_of_xcode11_result_bundle_incompatability(params) use_scanfile_to_override_settings(params.values) turn_off_concurrent_workers(params.values) prepare_scan_config(params.values) coerce_destination_to_array(params) end |
.prepare_scan_config(scan_options) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 60 def self.prepare_scan_config() Scan.config ||= FastlaneCore::Configuration.create( Fastlane::Actions::ScanAction., FastlaneScanHelper.() ) end |
.run(params) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 11 def self.run(params) prepare_for_testing(params) success = TryScanManager::Runner.new(params.values).run raise FastlaneCore::UI.test_failure!('Tests have failed') if params[:fail_build] && !success end |
.scan_options ⇒ Object
79 80 81 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 79 def self. ScanAction..reject { |config| i[output_types].include?(config.key) } end |
.turn_off_concurrent_workers(scan_options) ⇒ Object
43 44 45 46 47 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 43 def self.turn_off_concurrent_workers() if Gem::Version.new(Fastlane::VERSION) >= Gem::Version.new('2.142.0') .delete(:concurrent_workers) if [:concurrent_workers].to_i > 0 end end |
.use_scanfile_to_override_settings(scan_options) ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 49 def self.use_scanfile_to_override_settings() = FastlaneScanHelper.( FastlaneScanHelper.() ) unless .empty? FastlaneCore::UI.important("Scanfile found: overriding try_scan options with it's values.") .each { |key, val| [key] = val } end end |
.warn_of_xcode11_result_bundle_incompatability(params) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/fastlane/plugin/try_scan/actions/try_scan_action.rb', line 26 def self.warn_of_xcode11_result_bundle_incompatability(params) if FastlaneCore::Helper.xcode_at_least?('11.0.0') if params[:result_bundle] FastlaneCore::UI.important('As of Xcode 11, test_result bundles created in the output directory are actually symbolic links to an xcresult bundle') end elsif params[:output_types]&.include?('xcresult') FastlaneCore::UI.important("The 'xcresult' :output_type is only supported for Xcode 11 and greater. You are using #{FastlaneCore::Helper.xcode_version}.") end end |