module Trainer::XCResult::Parser
Public Class Methods
Source
# File trainer/lib/trainer/xcresult.rb, line 22 def parse_xcresult(path:, output_remove_retry_attempts: false) json = xcresult_to_json(path) TestPlan.from_json( json: json ).tap do |test_plan| test_plan.output_remove_retry_attempts = output_remove_retry_attempts end end
Parses an xcresult file and returns a TestPlan
object
@param path [String] The path to the xcresult file @param output_remove_retry_attempts [Boolean] Whether to remove retry attempts from the output @return [TestPlan] A TestPlan
object containing the test results
Private Class Methods
Source
# File trainer/lib/trainer/xcresult.rb, line 34 def xcresult_to_json(path) stdout, stderr, status = Open3.capture3('xcrun', 'xcresulttool', 'get', 'test-results', 'tests', '--path', path) raise "Failed to execute xcresulttool command - #{stderr}" unless status.success? JSON.parse(stdout) end