Class: Fastlane::Actions::XcodebuildonlytestingAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::XcodebuildonlytestingAction
- Defined in:
- lib/fastlane/plugin/xcodebuildonlytesting/actions/xcodebuildonlytesting_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/xcodebuildonlytesting/actions/xcodebuildonlytesting_action.rb', line 45 def self. ["Luís Esteves"] end |
.available_options ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/fastlane/plugin/xcodebuildonlytesting/actions/xcodebuildonlytesting_action.rb', line 58 def self. [ FastlaneCore::ConfigItem.new(key: :reportLocation, description: "junit report location", optional: false), ] end |
.description ⇒ Object
41 42 43 |
# File 'lib/fastlane/plugin/xcodebuildonlytesting/actions/xcodebuildonlytesting_action.rb', line 41 def self.description "Creates a array of tests from a junit to feed the xcodebuild only-testing" end |
.details ⇒ Object
53 54 55 56 |
# File 'lib/fastlane/plugin/xcodebuildonlytesting/actions/xcodebuildonlytesting_action.rb', line 53 def self.details # Optional: "Creates a array of tests from a junit to feed the xcodebuild only-testing[C" end |
.is_supported?(platform) ⇒ Boolean
66 67 68 |
# File 'lib/fastlane/plugin/xcodebuildonlytesting/actions/xcodebuildonlytesting_action.rb', line 66 def self.is_supported?(platform) platform == :ios end |
.return_value ⇒ Object
49 50 51 |
# File 'lib/fastlane/plugin/xcodebuildonlytesting/actions/xcodebuildonlytesting_action.rb', line 49 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fastlane/plugin/xcodebuildonlytesting/actions/xcodebuildonlytesting_action.rb', line 7 def self.run(params) UI.("The xcodebuildonlytesting plugin is working!") report_file = File.open(params[:reportLocation]) { |f| REXML::Document.new(f) } FastlaneCore::UI.user_error!("Malformed XML test report file given") if report_file.root.nil? FastlaneCore::UI.user_error!("Valid XML file is not an Xcode test report") if report_file.get_elements('testsuites').empty? failingTests = [] report_file.elements.each('testsuites') do |testsuites_element| testsuites_element.elements.each('testsuite') do |testsuite_element| testsuiteName = testsuite_element.attribute('name').value UI.("testsuite: #{testsuiteName}".green) testsuite_element.elements.each('testcase') do |testcase_element| className = testcase_element.attribute('classname').value testName = testcase_element.attribute('name').value testName.slice!('()') failure = testcase_element.elements['failure'] if failure UI.("Test: #{className} - #{testName}".red) failingTests << "#{testsuiteName}/#{className}/#{testName}" else UI.("Test: #{className} - #{testName}".green) end end end end return failingTests end |