月份:八月 2014

[Appium][Issue][1.2.2] iOS log capture failed: spawn ENOENT (deviceconsole)

Appium 1.2.2 一啟動 iOS 時會出現下面的錯誤:

info: [debug] Starting iOS device log capture via deviceconsole
error: iOS log capture failed: spawn ENOENT
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: spawn ENOENT
info: [debug] Error: spawn ENOENT
    at errnoException (child_process.js:1000:11)
    at Process.ChildProcess._handle.onexit (child_process.js:791:34)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: spawn ENOENT)","code":"ENOENT","errno":"ENOENT","syscall":"spawn","origValue":"spawn ENOENT"},"sessionId":null}
info: <-- POST /wd/hub/session 500 1780.745 ms - 197
info: [debug] Not setting device type since we're connected to a device
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating iDevice object with udid 816008f7ad15fcdc53f97dec30ad6e543d186faa
info: [debug] Checking app install status using: /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 816008f7ad15fcdc53f97dec30ad6e543d186faa --bundle tw.com.skysoft.iPhone

原因是 Appium 1.2.2 開始改用 deviceconsole (#3430),但 $APPIUM_HOME/build/deviceconsole 底下卻又找不到 deviceconsole 的關係。

Continue reading “[Appium][Issue][1.2.2] iOS log capture failed: spawn ENOENT (deviceconsole)"

一些提升 Assertion 可讀性的方式

在使用 JUnit 時,我習慣使用一些方式以提升 Assertion 的可讀性:

1. 將預期的結果放在前面,以方便對照(也符合 JUnit Assert 的說明規範)
2. 在擁有多個 Assertions 的測試,選用有 message 參數的 Assertion,以方便在出現錯誤時印出我們給予的資訊,輔助判斷情況和位置
3. 如果要比物件的話,盡量善用比對其種類的 Assertion,盡量不要自己比過才 Assert,因為直接比對的話會比較貼近原始資料,若比對不符所印出來的資訊也比較完整
Continue reading “一些提升 Assertion 可讀性的方式"

[Jenkins][Issue] Artifact 的 Local Copy 毀損時仍被判定為有效而不會重新下載 (Python)

透過 Python API (JenkinsAPI 取得 artifacts 時,通常都是透過:
理想上,Artifact.save() 會檢查 local copy 的 fingerprint 是否跟 server 上的 artifact 一致,如果 local copy 有問題才會重新下載。但過程中,如果你觀察到有下面的 logs 出現,可能就得小心了…
DEBUG:requests.packages.urllib3.connectionpool:"GET /fingerprint/9fb189f24862ce8b96468df4ebc50629/api/python HTTP/1.1" 404 None
ERROR:root:Failed request at https://<JENKINS_SERVER>/fingerprint/9fb189f24862ce8b96468df4ebc50629/api/python with params: None
INFO:jenkinsapi.artifact:Local copy of <ARTIFACT_NAME> is already up to date.

Continue reading “[Jenkins][Issue] Artifact 的 Local Copy 毀損時仍被判定為有效而不會重新下載 (Python)"