From de124e1bb02a5897da7b1b99cb6fbfc5569ab6bd Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sat, 9 Dec 2023 23:11:05 -0800 Subject: [PATCH] ci: use ruby 3 (#821) * 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 --- Fastlane/Fastfile | 28 +++------------------------- Fastlane/Pluginfile | 2 -- Gemfile | 4 +--- azure-templates/bootstrap_steps.yml | 2 +- 4 files changed, 5 insertions(+), 31 deletions(-) diff --git a/Fastlane/Fastfile b/Fastlane/Fastfile index 39bb9f491..41fd63669 100644 --- a/Fastlane/Fastfile +++ b/Fastlane/Fastfile @@ -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 \ No newline at end of file +end diff --git a/Fastlane/Pluginfile b/Fastlane/Pluginfile index dc2f2aa91..273a6b6f4 100644 --- a/Fastlane/Pluginfile +++ b/Fastlane/Pluginfile @@ -1,5 +1,3 @@ # Autogenerated by fastlane # # Ensure this file is checked in to source control! - -gem 'fastlane-plugin-test_center', '3.15.3' diff --git a/Gemfile b/Gemfile index f8456a949..90c93561d 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/azure-templates/bootstrap_steps.yml b/azure-templates/bootstrap_steps.yml index 83847eb74..6c96e9ead 100644 --- a/azure-templates/bootstrap_steps.yml +++ b/azure-templates/bootstrap_steps.yml @@ -3,5 +3,5 @@ steps: - script: mkdir -p ./Resources/WebDriverAgent.bundle - task: UseRubyVersion@0 inputs: - versionSpec: '<3.0' + versionSpec: '3' addToPath: true