У меня есть некоторые тестовые задания, которые не пройдены из-за нового сеанса тестирования, запущенного во время выполнения этого теста. Это делает текущий тестовый случай сбой. Как видно из предоставленных журналов, запущен первый сеанс тестирования:
[16:42:35]: ▸ 2019-10-22 16:42:35.341 xcodebuild[91170:10223499] [MT] IDETestOperationsObserverDebug: (BA6E9994-B774-43D3-A58C-DBD1AB068B48) Beginning test session ProjectExampleTests-BA6E9994-B774-43D3-A58C-DBD1AB068B48 at 2019-10-22 16:42:35.340 with Xcode 10E1001 on target <DVTiPhoneSimulator: 0x7fdf07a8f0f0> {
[16:42:35]: ▸ SimDevice: iPhone 5s iOS 9.0 (4353112F-6BFA-4DD4-AE7A-5E772AB438D5, iOS 9.0, Shutdown)
[16:42:35]: ▸ } (9.0 (13A344))
Затем, хотя тестовые примеры еще не все выполнены, другой сеанс запускается в том же симуляторе, делая текущий тестcase failing:
[16:43:15]: ▸ 2019-10-22 16:43:15.243 xcodebuild[91170:10223499] [MT] IDETestOperationsObserverDebug: (7BC2DA5F-0765-4705-83F0-D2F215E7F2ED) Beginning test session ProjectExampleTests-7BC2DA5F-0765-4705-83F0-D2F215E7F2ED at 2019-10-22 16:43:15.244 with Xcode 10E1001 on target <DVTiPhoneSimulator: 0x7fdf07a8f0f0> {
[16:43:15]: ▸ SimDevice: iPhone 5s iOS 9.0 (4353112F-6BFA-4DD4-AE7A-5E772AB438D5, iOS 9.0, Booted)
[16:43:15]: ▸ } (9.0 (13A344))
[16:43:15]: ▸ 2019-10-22 16:43:15.247 xcodebuild[91170:10223499] [MT] IDETestOperationsObserverDebug: (7BC2DA5F-0765-4705-83F0-D2F215E7F2ED) Finished requesting crash reports. Continuing with testing.
[16:43:16]: ▸ ✗ bridges_ProjectExample_Badge_set, Test crashed
Я уже проверил, что у меня есть только 1 симулятор, соответствующий каждому имени симулятора, указанному в команде. Также я установил max_concurrent_simulators
в 1 и disable_concurrent_testing
в true, но это не помогает решить эту проблему. Это связано с отсутствующей конфигурацией? Спасибо.
Полный вывод при запуске fastlane
<code>[16:41:32]: ------------------------------
[16:41:32]: --- Step: default_platform ---
[16:41:32]: ------------------------------
[16:41:33]: Driving the lane 'ios unit_tests' ?
[16:41:33]: --------------------------------
[16:41:33]: --- Step: clear_derived_data ---
[16:41:33]: --------------------------------
[16:41:33]: Derived Data path located at: /Users/claude/Library/Developer/Xcode/DerivedData
[16:41:34]: Successfully cleared Derived Data ♻️
[16:41:34]: ------------------
[16:41:34]: --- Step: scan ---
[16:41:34]: ------------------
[16:41:34]: $ xcodebuild -showBuildSettings -workspace ./ProjectExample.xcworkspace -scheme ProjectExampleTests
[16:41:36]: $ xcodebuild -showBuildSettings -workspace ./ProjectExample.xcworkspace -scheme ProjectExampleTests
+------------------------------------------------+-----------------------------------------------------------------------------------------------+
| Summary for scan 2.134.0 |
+------------------------------------------------+-----------------------------------------------------------------------------------------------+
| scheme | ProjectExampleTests |
| devices | ["iPhone 5s iOS 9.0", "iPhone 6s iOS 10.3", "iPhone X iOS 12.2"] |
| skip_build | true |
| disable_concurrent_testing | true |
| prelaunch_simulator | true |
| max_concurrent_simulators | 1 |
| workspace | ./ProjectExample.xcworkspace |
| derived_data_path | /Users/claude/Library/Developer/Xcode/DerivedData/ProjectExample-hkcobndhrmxnnkbkrtfhglxkvvbm |
| skip_detect_devices | false |
| force_quit_simulator | false |
| reset_simulator | false |
| reinstall_app | false |
| clean | false |
| open_report | false |
| output_directory | ./fastlane/test_output |
| output_types | html,junit |
| buildlog_path | ~/Library/Logs/scan |
| include_simulator_logs | false |
| should_zip_build_products | false |
| result_bundle | false |
| use_clang_report_name | false |
| slack_use_webhook_configured_username_and_icon | false |
| slack_username | fastlane |
| slack_icon_url | https://s3-eu-west-1.amazonaws.com/fastlane.tools/fastlane.png |
| skip_slack | false |
| slack_only_on_failure | false |
| xcodebuild_command | env NSUnbufferedIO=YES xcodebuild |
| fail_build | true |
| xcode_path | /Applications/Xcode.app |
+------------------------------------------------+-----------------------------------------------------------------------------------------------+
[16:41:38]: $ set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace ./ProjectExample.xcworkspace -scheme ProjectExampleTests -destination 'platform=iOS Simulator,id=4353112F-6BFA-4DD4-AE7A-5E772AB438D5' -destination 'platform=iOS Simulator,id=B2AD710C-3F80-4A5E-B02B-A72DE36B787A' -destination 'platform=iOS Simulator,id=CBD79494-ADD4-404D-AA94-87BF758EA8D3' -derivedDataPath '/Users/claude/Library/Developer/Xcode/DerivedData/ProjectExample-hkcobndhrmxnnkbkrtfhglxkvvbm' -maximum-concurrent-test-simulator-destinations 1 -disable-concurrent-testing test | tee '/Users/claude/Library/Logs/scan/ProjectExampleTests-ProjectExampleTests.log' | xcpretty --report html --output '/Users/claude/Dev/ProjectExample/fastlane/test_output/report.html' --report junit --output '/Users/claude/Dev/ProjectExample/fastlane/test_output/report.junit' --report junit --output '/var/folders/m7/y78wyb0n2rqf74b98_rc1rbr0000gn/T/junit_report20191022-91121-r6mvwk'
...
[16:42:35]: Running Tests: ▸ Touching ProjectExampleTests.xctest
[16:42:35]: ▸ Signing /Users/claude/Library/Developer/Xcode/DerivedData/ProjectExample-hkcobndhrmxnnkbkrtfhglxkvvbm/Build/Products/Debug-iphonesimulator/ProjectExampleTests.xctest
[16:42:35]: ▸ 2019-10-22 16:42:35.340 xcodebuild[91170:10223615] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
[16:42:35]: ▸ /Users/claude/Library/Developer/Xcode/DerivedData/ProjectExample-hkcobndhrmxnnkbkrtfhglxkvvbm/Logs/Test/Test-ProjectExampleTests-2019.10.22_16-41-41-+0200.xcresult/1_Test/Diagnostics/ProjectExampleTests-27FC4C1D-77D3-45BC-BC16-B20769DB5E27/ProjectExampleTests-CEB88879-DFF1-4E64-839E-D4625B7BA4C0/Session-ProjectExampleTests-2019-10-22_164235-Msfqlj.log
[16:42:35]: ▸ 2019-10-22 16:42:35.341 xcodebuild[91170:10223499] [MT] IDETestOperationsObserverDebug: (BA6E9994-B774-43D3-A58C-DBD1AB068B48) Beginning test session ProjectExampleTests-BA6E9994-B774-43D3-A58C-DBD1AB068B48 at 2019-10-22 16:42:35.340 with Xcode 10E1001 on target <DVTiPhoneSimulator: 0x7fdf07a8f0f0> {
[16:42:35]: ▸ SimDevice: iPhone 5s iOS 9.0 (4353112F-6BFA-4DD4-AE7A-5E772AB438D5, iOS 9.0, Shutdown)
[16:42:35]: ▸ } (9.0 (13A344))
[16:42:45]: ▸ 2019-10-22 16:42:45.014 xcodebuild[91170:10223499] [MT] IDETestOperationsObserverDebug: (BA6E9994-B774-43D3-A58C-DBD1AB068B48) Finished requesting crash reports. Continuing with testing.
[16:42:47]: ▸ All tests
[16:42:47]: ▸ Test Suite ProjectExampleTests.xctest started
...
[16:43:15]: ▸ 2019-10-22 16:43:15.243 xcodebuild[91170:10226022] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
[16:43:15]: ▸ /Users/claude/Library/Developer/Xcode/DerivedData/ProjectExample-hkcobndhrmxnnkbkrtfhglxkvvbm/Logs/Test/Test-ProjectExampleTests-2019.10.22_16-41-41-+0200.xcresult/1_Test/Diagnostics/ProjectExampleTests-27FC4C1D-77D3-45BC-BC16-B20769DB5E27/ProjectExampleTests-CEB88879-DFF1-4E64-839E-D4625B7BA4C0/Session-ProjectExampleTests-2019-10-22_164315-GhePTp.log
[16:43:15]: ▸ 2019-10-22 16:43:15.243 xcodebuild[91170:10223499] [MT] IDETestOperationsObserverDebug: (7BC2DA5F-0765-4705-83F0-D2F215E7F2ED) Beginning test session ProjectExampleTests-7BC2DA5F-0765-4705-83F0-D2F215E7F2ED at 2019-10-22 16:43:15.244 with Xcode 10E1001 on target <DVTiPhoneSimulator: 0x7fdf07a8f0f0> {
[16:43:15]: ▸ SimDevice: iPhone 5s iOS 9.0 (4353112F-6BFA-4DD4-AE7A-5E772AB438D5, iOS 9.0, Booted)
[16:43:15]: ▸ } (9.0 (13A344))
[16:43:15]: ▸ 2019-10-22 16:43:15.247 xcodebuild[91170:10223499] [MT] IDETestOperationsObserverDebug: (7BC2DA5F-0765-4705-83F0-D2F215E7F2ED) Finished requesting crash reports. Continuing with testing.
[16:43:16]: ▸ ✗ bridges_ProjectExample_Badge_set, Test crashed
[16:43:16]: ▸ Selected tests
[16:43:16]: ▸ Test Suite ProjectExampleTests.xctest started
Код
default_platform(:ios)
platform :ios do
desc "build and launch unit tests"
lane :unit_tests do
run_unit_tests
end
def run_unit_tests
clear_derived_data
run_tests(scheme: "ProjectExampleTests",
devices: ["iPhone 5s iOS 9.0", "iPhone 6s iOS 10.3", "iPhone X iOS 12.2"],
skip_build: true,
disable_concurrent_testing: true,
prelaunch_simulator: true,
max_concurrent_simulators: 1,
slack_url: "https://hooks.slack.com/services/xxx")
end
end