Skip to content

Commit

Permalink
ci: use ruby 3 (#821)
Browse files Browse the repository at this point in the history
* ci: use ruby 3

* set output type to not use result bundle

* try no multi_scan

* adjust params

* ci: make build fail when test fails
  • Loading branch information
KazuCocoa authored Dec 10, 2023
1 parent 296c19b commit de124e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
28 changes: 3 additions & 25 deletions Fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
XC_PROJECT = File.absolute_path('../WebDriverAgent.xcodeproj')
RETRIES = 3

lane :test do
test_run_block = lambda do |testrun_info|
failed_test_count = testrun_info[:failed].size

if failed_test_count > 0
UI.important("Failed tests count: #{failed_test_count}")

try_attempt = testrun_info[:try_count]
if try_attempt < RETRIES
UI.header("Re-running failing tests (attempt #{try_attempt} of #{RETRIES})")
reset_simulator_contents
end
end
end

# https://docs.fastlane.tools/actions/scan/
result = multi_scan(
run_tests(
project: XC_PROJECT,
try_count: RETRIES,
fail_build: false,
fail_build: true,
scheme: ENV['SCHEME'],
sdk: ENV['SDK'],
destination: ENV['DEST'],
testrun_completed_block: test_run_block
)
unless result[:failed_testcount].zero?
msg = "There are #{result[:failed_testcount]} legitimate failing tests"
UI.message(msg)
raise msg
end
end
end
2 changes: 0 additions & 2 deletions Fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-test_center', '3.15.3'
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source "https://rubygems.org"

gem "fastlane", '2.162.0'
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
gem "fastlane", '2.217.0'
2 changes: 1 addition & 1 deletion azure-templates/bootstrap_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ steps:
- script: mkdir -p ./Resources/WebDriverAgent.bundle
- task: UseRubyVersion@0
inputs:
versionSpec: '<3.0'
versionSpec: '3'
addToPath: true

0 comments on commit de124e1

Please sign in to comment.