/
githubmirror
/
fastlane
Обзор
Документация
Войти
/
githubmirror
/
fastlane
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
scan/spec/error_handler_spec.rb
92 строки
4 KB
Yusuf Özgül
[scan] Handle Xcode26 test failure during scan usage (#29854)
15 янв 2026, 18:35
Не верифицирован
15 янв 2026, 18:35
20ee632
Код
Авторство
О чём код?
require 'scan' describe Scan do describe Scan::ErrorHandler do let(:log_path) { '~/scan.log' } describe "handle_build_error" do describe "when parsing parallel test failure output" do it "does not report a build failure" do expect(Scan).to receive(:config).and_return({}) output = File.open('./scan/spec/fixtures/parallel_testing_failure.log', &:read) expect do Scan::ErrorHandler.handle_build_error(output, log_path) end.not_to raise_error end end describe "when parsing non-parallel test failure output" do it "does not report a build failure" do expect(Scan).to receive(:config).and_return({}) output = File.open('./scan/spec/fixtures/non_parallel_testing_failure.log', &:read) expect do Scan::ErrorHandler.handle_build_error(output, log_path) end.to_not(raise_error) end end describe "when parsing Xcode 26 test failure output" do it "does not report a build failure" do expect(Scan).to receive(:config).and_return({}) output = File.open('./scan/spec/fixtures/xcode26_testing_failure.log', &:read) expect do Scan::ErrorHandler.handle_build_error(output, log_path) end.not_to raise_error end end describe "when parsing Xcode 26 xcbeautify test failure output" do it "does not report a build failure" do expect(Scan).to receive(:config).and_return({}) output = File.open('./scan/spec/fixtures/xcode26_xcbeautify_failure.log', &:read) expect do Scan::ErrorHandler.handle_build_error(output, log_path) end.not_to raise_error end end describe "when parsing Xcode 26 test-without-building failure output" do it "does not report a build failure" do expect(Scan).to receive(:config).and_return({}) output = File.open('./scan/spec/fixtures/xcode26_test_execute_failure.log', &:read) expect do Scan::ErrorHandler.handle_build_error(output, log_path) end.not_to raise_error end end describe "when parsing early failure output" do let(:output_path) { './scan/spec/fixtures/early_testing_failure.log' } before(:each) do Scan.config = FastlaneCore::Configuration.create(Scan::Options.available_options, { project: './scan/examples/standard/app.xcodeproj' }) end it "reports a build failure", requires_xcodebuild: true do output = File.open(output_path, &:read) expect do Scan::ErrorHandler.handle_build_error(output, log_path) end.to(raise_error(FastlaneCore::Interface::FastlaneBuildFailure)) end it "mentions log above when not suppressing output", requires_xcodebuild: true do output = File.open(output_path, &:read) expect do Scan::ErrorHandler.handle_build_error(output, log_path) end.to(raise_error(FastlaneCore::Interface::FastlaneBuildFailure, "Error building the application. See the log above.")) end it "mentions log file when suppressing output", requires_xcodebuild: true do Scan.config[:suppress_xcode_output] = true output = File.open(output_path, &:read) expect do Scan::ErrorHandler.handle_build_error(output, log_path) end.to(raise_error(FastlaneCore::Interface::FastlaneBuildFailure, "Error building the application. See the log here: '#{log_path}'.")) end end end end end