2016-11-09 84 views
7

我配置了jenkins來構建我的ios-swift應用程序。我已經使用 xcode版本8.1和swift版本3.我是詹金斯的新手,並繼續整合過程。基於我的控制檯輸出,我認爲構建是成功的。 bacause這樣的控制檯輸出打印缺少必需的模塊Firebase - Jenkins生成錯誤

Touch build/testinng.app 
     cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test 
     export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
     /usr/bin/touch -c /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app 

    CodeSign build/testinng.app 
     cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test 
     export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate 
     export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 

    Signing Identity:  "-" 

     /usr/bin/codesign --force --sign - --timestamp=none /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app 

    ** BUILD SUCCEEDED ** 

    2016-11-09 19:51:39.300 xcodebuild[2659:26623] [MT] IDETestOperationsObserverDebug: (E99CCCC3-8EED-4FBA-8A00-2CD3C0D7273F) Beginning test session testinngUITests-E99CCCC3-8EED-4FBA-8A00-2CD3C0D7273F at 2016-11-09 19:51:39.299 with Xcode 8B62 on target <DVTiPhoneSimulator: 0x7f9dce6bc690> { 
      SimDevice: SimDevice : iPhone 7 (223F7310-19DF-4FA7-B147-73AB8B48454F) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-7 } runtime={ SimRuntime : 10.1 (14B72) - com.apple.CoreSimulator.SimRuntime.iOS-10-1 } 
    } (10.1 (14B72)) 

但是在此控制檯輸出打印失敗消息之後。

failed to import required module: 'Firebase'. 

我gofinal控制檯輸出是這樣的。

Touch build/testinng.app 
     cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test 
     export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
     /usr/bin/touch -c /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app 

    CodeSign build/testinng.app 
     cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test 
     export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate 
     export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 

    Signing Identity:  "-" 

     /usr/bin/codesign --force --sign - --timestamp=none /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app 

    ** BUILD SUCCEEDED ** 

    2016-11-09 19:51:39.300 xcodebuild[2659:26623] [MT] IDETestOperationsObserverDebug: (E99CCCC3-8EED-4FBA-8A00-2CD3C0D7273F) Beginning test session testinngUITests-E99CCCC3-8EED-4FBA-8A00-2CD3C0D7273F at 2016-11-09 19:51:39.299 with Xcode 8B62 on target <DVTiPhoneSimulator: 0x7f9dce6bc690> { 
      SimDevice: SimDevice : iPhone 7 (223F7310-19DF-4FA7-B147-73AB8B48454F) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-7 } runtime={ SimRuntime : 10.1 (14B72) - com.apple.CoreSimulator.SimRuntime.iOS-10-1 } 
    } (10.1 (14B72)) 


=== BUILD TARGET testinngTests OF PROJECT testinng WITH CONFIGURATION Debug === 

Check dependencies 

Create product structure 
/bin/mkdir -p /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app/PlugIns/testinngTests.xctest 

ProcessInfoPlistFile build/testinng.app/PlugIns/testinngTests.xctest/Info.plist testinngTests/Info.plist 
    cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test 
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    builtin-infoPlistUtility /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/Info.plist -expandbuildsettings -format binary -platform iphonesimulator -o /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build/testinng.app/PlugIns/testinngTests.xctest/Info.plist 

CompileSwift normal x86_64 /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/testinngTests.swift 
    cd /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/testinngTests.swift -target x86_64-apple-ios10.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.1.sdk -I /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/build -F /--akyiibisusqoudfyyfxubyhwzzgz/Build/Intermediates/testinng.build/Debug-iphonesimulator/testinngTests.build/Objects-normal/x86_64/testinngTests.swiftdeps -o /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Build/Intermediates/testinng.build/Debug-iphonesimulator/testinngTests.build/Objects-normal/x86_64/testinngTests.o 
/Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/testinngTests.swift:10:18: error: missing required module 'Firebase' 
@testable import testinng 
       ^

2016-11-09 19:51:48.418 xcodebuild[2659:26623] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Logs/Test/B554B7BB-8F73-4B3F-8B9B-B07918ED46AB/Session-testinngUITests-2016-11-09_195139-CXzaIj.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Logs/Test/B554B7BB-8F73-4B3F-8B9B-B07918ED46AB/Session-testinngUITests-2016-11-09_195139-CXzaIj.log} 
2016-11-09 19:51:48.418 xcodebuild[2659:26623] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Logs/Test/B554B7BB-8F73-4B3F-8B9B-B07918ED46AB/Session-testinngTests-2016-11-09_195139-NdHjC1.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/testinng-akyiibisusqoudfyyfxubyhwzzgz/Logs/Test/B554B7BB-8F73-4B3F-8B9B-B07918ED46AB/Session-testinngTests-2016-11-09_195139-NdHjC1.log} 
2016-11-09 19:51:48.419 xcodebuild[2659:27966] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7f9dceef3b20> 
2016-11-09 19:51:48.419 xcodebuild[2659:26664] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7f9dcee7ded0> 

Testing failed: 
    Missing required module 'Firebase' 
** TEST FAILED ** 


The following build commands failed: 
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler 
    CompileSwift normal x86_64 /Users/Shared/Jenkins/Home/workspace/testinng_Bit_Test/testinngTests/testinngTests.swift 
(2 failures) 
Build step 'Xcode' marked build as failure 

與此相關的問題是什麼?

+1

我也面臨同樣的問題。在過去的兩天裏,我的腦袋開始轉動。搜索整個互聯網,SO,谷歌無處不在。應用所有提出的解決方但沒有成功。我期望有更深層次知識的人可以幫助解決這個問題。 – sreejesh

回答

10

經過廣泛的研究,我終於找到了解決這個問題的辦法。 我在Runpath Search Paths做的第二個修改是我相信實際上解決了這個問題。以下是我所做的/修改的內容。

1.I移動莢「火力地堡」在莢文件我的測試目標如下圖所示:

target 'MyAppTests' do 
    inherit! :search_paths 
    pod 'Firebase' 
end 

2.configure Runpath Search Paths指向$(FRAMEWORK_SEARCH_PATHS)

3.In除了所有以上,我卸載了我的老cocoapod(1.0.2)並安裝了最新版本(1.1.1),刪除了Firebase,重新安裝了它..然後pod installedpod updated在終端中。

0

好的,所以你的單元測試步驟失敗了。看起來可能存在網絡問題。僅僅從控制檯輸出中很難確切知道發生了什麼。當談到Jenkins服務器的環境時,存在很大的差異。查看詹金斯在發生問題時指出的日誌總是很好的。

看看@testable import testinng以下的行。他們指向你一些日誌。

如果你想讓你的Jenkins工作立即工作,那麼你總是可以跳過現在的單元測試,然後再回過頭去修復那部分。這樣做存在風險,但如果您希望儘快修復您的工作,那麼如果您無法足夠快地調試問題,那麼這可能是一條走向。

很難說如何在不查看日誌或至少獲得更多上下文的情況下解決問題,但我建議不要共享您的日誌。

+0

我沒有添加單元測試jenkins後構建行動。但在創建項目時,我選擇了xcode ide上的單元測試選項。 –

相關問題