LUCI結果報告器

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 ()

如果報告器支援精細結果,則傳回 True,否則傳回 false。

公共構造函數

LUCI結果報告器

public LUCIResultReporter ()

公共方法

呼叫結束

public void invocationEnded (long elapsedTime)

報告呼叫已終止,無論是成功還是由於某些錯誤情況。

將由 TradeFederation 框架自動呼叫。

參數
elapsedTime long :呼叫所花費的時間(以毫秒為單位)

呼叫失敗

public void invocationFailed (Throwable cause)

由於某些錯誤情況而報告不完整的呼叫。

將由 TradeFederation 框架自動呼叫。

參數
cause Throwable :失敗的Throwable原因

調用開始

public void invocationStarted (IInvocationContext context)

報告測試調用的開始。

將由 TradeFederation 框架自動呼叫。記者需要重寫此方法以支援多設備報告。

參數
context IInvocationContext :有關呼叫的信息

日誌關聯

public void logAssociation (String dataName, 
                LogFile logFile)

收集結果文件。

參數
dataName String : 資料的名稱

logFile LogFile :先前記錄的LogFile ,應與測試案例關聯。

儲存Json文件

public void saveJsonFile (JSONObject jsonResults)

儲存 JSON 結果檔。

參數
jsonResults JSONObject

設定粒度結果

public void setGranularResults (boolean granularResults)

參數
granularResults boolean

支援粒度結果

public boolean supportGranularResults ()

如果報告器支援精細結果,則傳回 True,否則傳回 false。

退貨
boolean