Skip to content

Instantly share code, notes, and snippets.

@Austinate
Created February 10, 2022 17:29
Show Gist options
  • Save Austinate/4c102638d01cd1613c345d3a8438c0ae to your computer and use it in GitHub Desktop.
Save Austinate/4c102638d01cd1613c345d3a8438c0ae to your computer and use it in GitHub Desktop.
private_lane :perform_tests_run do |options|
devices = options[:devices] || ['iPhone 13 (15.2)', 'iPhone 8 (12.4)']
scan(
scheme: options[:scheme],
devices: devices,
ensure_devices_found: true,
reset_simulator: true,
fail_build: !is_ci, # do not fail the lane since we want test results to be published
# disable scan output since we need to generate a JUnit report with trainer
# scan supports only xcpretty (doesn't work correctly with parallel test runs) and xcbeautfiy (doesn't generate neither JUnit nor HTML reports)
output_types: ''
)
xcresult_path = Actions.lane_context[SharedValues::SCAN_GENERATED_XCRESULT_PATH]
# Produce JUnit test report
trainer(
path: xcresult_path,
output_directory: './fastlane/test_output',
extension: '.junit',
fail_build: !is_ci # do not fail on CI, azure will report fail after publishing the test results
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment