Class: Fastlane::Actions::TestsFromXctestrunAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::TestsFromXctestrunAction
- Defined in:
- lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
Class Method Summary collapse
- .run(params) ⇒ Object
- .xctest_bundle_path(xctestrun_rootpath, xctestrun_config) ⇒ Object
- .xctestrun_tests(xctestrun_path) ⇒ Object
Class Method Details
.authors ⇒ Object
56 57 58 |
# File 'lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb', line 56 def self. ["lyndsey-ferguson/lyndseydf"] end |
.available_options ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb', line 39 def self. [ FastlaneCore::ConfigItem.new( key: :xctestrun, env_name: "FL_SUPPRESS_TESTS_FROM_XCTESTRUN_FILE", description: "The xctestrun file to use to find where the xctest bundle file is for test retrieval", verify_block: proc do |path| UI.user_error!("Error: cannot find the xctestrun file '#{path}'") unless File.exist?(path) end ) ] end |
.description ⇒ Object
35 36 37 |
# File 'lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb', line 35 def self.description "Retrieves all of the tests from xctest bundles referenced by the xctestrun file" end |
.is_supported?(platform) ⇒ Boolean
60 61 62 |
# File 'lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb', line 60 def self.is_supported?(platform) platform == :ios end |
.return_value ⇒ Object
52 53 54 |
# File 'lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb', line 52 def self.return_value "A Hash of testable => tests, where testable is the name of the test target and tests is an array of test identifiers" end |
.run(params) ⇒ Object
6 7 8 |
# File 'lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb', line 6 def self.run(params) return xctestrun_tests(params[:xctestrun]) end |
.xctest_bundle_path(xctestrun_rootpath, xctestrun_config) ⇒ Object
26 27 28 29 |
# File 'lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb', line 26 def self.xctest_bundle_path(xctestrun_rootpath, xctestrun_config) xctest_host_path = xctestrun_config['TestHostPath'].sub('__TESTROOT__', xctestrun_rootpath) xctestrun_config['TestBundlePath'].sub('__TESTHOST__', xctest_host_path).sub('__TESTROOT__', xctestrun_rootpath) end |
.xctestrun_tests(xctestrun_path) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fastlane/plugin/retry_tests/actions/tests_from_xctestrun.rb', line 10 def self.xctestrun_tests(xctestrun_path) xctestrun = Plist.parse_xml(xctestrun_path) xctestrun_rootpath = File.dirname(xctestrun_path) tests = Hash.new([]) xctestrun.each do |testable_name, xctestrun_config| test_identifiers = XCTestList.tests(xctest_bundle_path(xctestrun_rootpath, xctestrun_config)) if xctestrun_config.key?('SkipTestIdentifiers') test_identifiers.reject! { |test_identifier| xctestrun_config['SkipTestIdentifiers'].include?(test_identifier) } end tests[testable_name] = test_identifiers.map do |test_identifier| "#{testable_name.shellescape}/#{test_identifier}" end end tests end |