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