#ios #xcode #unit-testing
Вопрос:
При выполнении модульных тестов на машине M1 генерируется ряд ошибок пакета, которые немедленно приводят к сбою набора тестов.
Конкретно:
- Не удалось загрузить тестовый пакет
- Подходящего изображения не найдено
- Попытка загрузить неподписанную библиотеку
2021-11-04 08:53:33.378375-0600 xxx[81944:1274939] Failed to load test bundle from file:///Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests): no suitable image found. Did find: /Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests: code signature in (/Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests) not valid for use in process using Library Validation: Trying to load an unsigned library" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests, NSDebugDescription=dlopen_preflight(/Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests): no suitable image found. Did find: /Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests: code signature in (/Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests) not valid for use in process using Library Validation: Trying to load an unsigned library, NSBundlePath=/Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest, NSLocalizedDescription=The bundle “Unit Tests.xctest” couldn’t be loaded because it is damaged or missing necessary resources.} 2021-11-04 08:53:33.683690-0600 xxx[81944:1274939] The bundle “Unit Tests.xctest” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. 2021-11-04 08:53:33.683757-0600 xxx[81944:1274939] (dlopen_preflight(/Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests): no suitable image found. Did find: /Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests: code signature in (/Users/xxx/Library/Developer/XCTestDevices/FDCD6684-3D06-48C9-81E3-DE82C6AB2CCB/data/Containers/Bundle/Application/7143E7F2-E59A-4578-971A-A2A20D42DDB6/xxx.app/PlugIns/Unit Tests.xctest/Unit Tests) not valid for use in process using Library Validation: Trying to load an unsigned library)
Те же модульные тесты выполняются, как и ожидалось, на компьютере Mac на базе Intel.