LUCIResultReporter
public
class
LUCIResultReporter
extends CollectingTestListener
implements
ILogSaverListener,
ISupportGranularResults
java.lang.Object | ||
↳ | com.android.tradefed.result.CollectingTestListener | |
↳ | com.android.tradefed.result.LUCIResultReporter |
結果回報器會將 ResultDB 和 LUCI 所需的測試結果儲存為 JSON 格式 (go/result-sink),並在主控台記錄檔案位置。https://pkg.go.dev/go.chromium.org/luci/resultdb/proto/v1#TestResult 這個類別會將測試執行期間的每個測試案例測試結果儲存在陣列中。
摘要
公用建構函式 | |
---|---|
LUCIResultReporter()
|
公用方法 | |
---|---|
void
|
invocationEnded(long elapsedTime)
回報叫用已終止,無論是成功或因某些錯誤條件而終止。 |
void
|
invocationFailed(Throwable cause)
因某些錯誤情況而回報不完整的叫用。 |
void
|
invocationStarted(IInvocationContext context)
回報測試叫用作業的開始時間。 |
void
|
logAssociation(String dataName, LogFile logFile)
收集結果檔案。 |
void
|
saveJsonFile(JSONObject jsonResults)
儲存 JSON 結果檔案。 |
void
|
setGranularResults(boolean granularResults)
|
boolean
|
supportGranularResults()
如果報表提供詳細結果,則傳回「是」;否則傳回「否」。 |
公用建構函式
LUCIResultReporter
public LUCIResultReporter ()
公用方法
invocationEnded
public void invocationEnded (long elapsedTime)
回報叫用已終止,無論是成功或因某些錯誤條件而終止。
會由 TradeFederation 架構自動呼叫。
參數 | |
---|---|
elapsedTime |
long :叫用作業的經過時間 (以毫秒為單位) |
invocationFailed
public void invocationFailed (Throwable cause)
由於某些錯誤情況,因此回報未完成的叫用作業。
會由 TradeFederation 架構自動呼叫。
參數 | |
---|---|
cause |
Throwable :失敗的 Throwable 原因 |
invocationStarted
public void invocationStarted (IInvocationContext context)
回報測試叫用作業的開始時間。
會由 TradeFederation 架構自動呼叫。回報器需要覆寫這個方法,才能支援多裝置回報。
參數 | |
---|---|
context |
IInvocationContext :叫用作業相關資訊 |
logAssociation
public void logAssociation (String dataName, LogFile logFile)
收集結果檔案。
參數 | |
---|---|
dataName |
String :資料名稱 |
logFile |
LogFile :先前記錄的 LogFile ,應與測試案例相關聯。 |
saveJsonFile
public void saveJsonFile (JSONObject jsonResults)
儲存 JSON 結果檔案。
參數 | |
---|---|
jsonResults |
JSONObject |
setGranularResults
public void setGranularResults (boolean granularResults)
參數 | |
---|---|
granularResults |
boolean |
supportGranularResults
public boolean supportGranularResults ()
如果回報器支援精細結果,則傳回 True,否則傳回 false。
傳回 | |
---|---|
boolean |