CommandOptions

public class CommandOptions
extends Object implements ICommandOptions

java.lang.Object
   ↳ com.android.tradefed.command.CommandOptions


Implementation of ICommandOptions.

Summary

Constants

String DRY_RUN_OPTION

String ENABLE_SANDBOX_TEST_MODE

String INVOCATION_DATA

String JDK_FOLDER_OPTION_NAME

String NOISY_DRY_RUN_OPTION

String TEST_TAG_OPTION

String USE_REMOTE_SANDBOX

String USE_SANDBOX

Public constructors

CommandOptions()

Public methods

boolean captureLogcatOnFailure()

Whether or not to capture a logcat on test case failure

boolean captureScreenshotOnFailure()

Whether or not to capture a screenshot on test case failure

ICommandOptions clone()
boolean delegatedEarlyDeviceRelease()

Whether or not to release the device early in delegated mode.

boolean earlyDeviceRelease()

Whether or not to release the device early when done with it.

boolean enableDefaultLogProcessors()

Whether to auto deploy some post processors.

boolean filterPreviousPassedTests()

Whether or not to filters previous passed test cases from previous attempt.

List<String> getAutoCollectorSetOptions()

Returns the list of options to pass to the auto collectors.

Set<AutoLogCollector> getAutoLogCollectors()

Returns the set of auto log collectors to be added for an invocation

Set<AutoLogProcessor> getAutoLogProcessors()

Returns the set of auto log processors to be added for an invocation

Map<String, String> getDynamicDownloadArgs()

Returns the map of args to pass to the dynamic download query.

MultiMap<String, String> getExperimentalFlags()

Returns the experimental flags map, that can be used to feature gate projects.

int getExtraRemotePostsubmitInstance()

Whether or not to start extra instances in the remote VM in postsubmit.

String getGeminiApiKey()

The API key to use for Gemini API prompt queries.

String getHostLogSuffix()

Returns the suffix to append to the Tradefed host_log or null if no prefix.

UniqueMultiMap<String, String> getInvocationData()

Returns the data passed to the invocation to describe it

long getInvocationTimeout()

Return the invocation timeout specified.

File getJdkFolderForSubprocess()

Returns the jdk folder to use when forking execution in a subprocess.

long getLoopTime()

Get the time to wait before re-scheduling this command.

long getMaxLoopCount()

Returns the maximum number of times to scheduled the command.

Integer getMultiDeviceCount()

Return the number of devices for multi-device tests.

boolean getOptimizeMainlineTest()

Returns true if we should optimize the list of test modules for mainline test.

Duration getParallelPreInvocationSetupTimeout()

Return the timeout for parallel pre-invocation setup.

Duration getParallelSetupTimeout()

Returns the timeout to use during parallel setups.

String getRemoteCacheInstanceName()

Returns the name of the instance used to handle remote caching.

Set<String> getRemoteFiles()

Returns the list of remote files configured.

MultiMap<String, String> getRolloutFlags()

Returns the rollout flags map.

List<File> getRolloutFlagsFiles()

Returns a list of files containing rollout flags.

Integer getShardCount()

Return the total shard count for the command.

Integer getShardIndex()

Return the shard index for the command.

String getTestTag()

Return the test-tag for the invocation.

String getTestTagSuffix()

Return the test-tag suffix, appended to test-tag to represents some variants of one test.

boolean isConditionalBugreportDisabled()

Returns whether or not conditional bugreport is disabled

boolean isDryRunMode()

Return true if we should skip adding this command to the queue.

boolean isExperimentEnabled()

Whether or not to enable experiments through experimental flags.

boolean isFullHelpMode()

Returns true if full detailed help mode has been requested

boolean isGeminiLogOnlyMode()

Whether to silence the prompt execution of models.

boolean isHelpMode()

Returns true if abbreviated help mode has been requested

boolean isLoopMode()

Return the loop mode for the config.

boolean isNoisyDryRunMode()

Return true if we should print the command out to the console before we skip adding it to the queue.

boolean isRemoteInvocationDeviceless()

Whether or not to trigger a deviceless remote invocation.

boolean isTracingEnabled()

Returns whether or not invocation tracing is enabled.

boolean keepPostProcessorOrder()

Whether to apply post processors in the order they are mentioned in the config.

boolean reportCacheResults()

Returns true if we should report cache results when available.

boolean reportCacheResultsInPresubmit()

Returns true if we should report cache results when available in presubmit.

boolean reportInvocationCacheResultsInPostsubmit()

Returns true if we should report invocation cache result when available in postsubmit.

boolean reportInvocationCacheResultsInPresubmit()

Returns true if we should report invocation cache results when available in presubmit.

boolean reportInvocationComplete()

whether or not to report the logs until invocationComplete.

boolean reportPassedTests()

Whether or not to report passed test cases.

boolean reportTestCaseCount()

Whether or not to report the number of test cases per test types.

List<String> reportingTags()

List of tags used for reporting related to the invocation.

boolean runOnAllDevices()

Return true if command should run on all devices.

void setAutoCollectorSetOptions(List<String> autoCollectorSetOptions)

Sets the list of options to pass to the auto collectors.

void setAutoLogCollectors(Set<AutoLogCollector> autoLogCollectors)

Sets the set of auto log collectors that should be added to an invocation.

void setAutoLogProcessors(Set<AutoLogProcessor> autoLogProcessors)

Sets the set of auto log processors that should be added to an invocation.

void setBugreportOnInvocationEnded(boolean takeBugreport)

Sets whether or not to capture a bugreport at the end of the invocation.

void setBugreportzOnInvocationEnded(boolean takeBugreportz)

Sets whether or not to capture a bugreportz at the end of the invocation.

void setDelegatedEarlyDeviceRelease(boolean earlyRelease)

Set whether or not to release the device early in delegated mode.

void setHostLogSuffix(String suffix)

Sets the suffix to append to Tradefed host_log.

void setInvocationTimeout(Long invocationTimeout)

Set the invocation timeout.

void setLoopMode(boolean loopMode)

Set the loop mode for the config.

void setMultiDeviceCount(int count)

Sets the number of expected devices for multi-device tests.

void setReplicateSetup(boolean replicate)

Set whether or not to use replicated setup.

void setReportInvocationComplete(boolean reportInvocationCompleteLogs)

Set whether or not to report the logs until invocationComplete

void setReportTestCaseCount(boolean report)

Set whether or not to report test cases count per test types.

void setShardCount(Integer shardCount)

Sets the shard count for the command.

void setShardIndex(Integer shardIndex)

Sets the shard index for the command.

void setShouldRemoteDynamicShard(boolean shouldRemoteDynamicShard)

Sets whether to use remote dynamic sharding server or not

void setShouldUseEvenModuleSharding(boolean useEvenModuleSharding)

Set whether to attempt to distribute number of modules evenly across shards

void setShouldUseSandboxing(boolean use)

Sets whether or not we should use TF containers

void setTestTag(String testTag)

Sets the test-tag for the invocation.

void setUseSandboxTestMode(boolean use)

Sets whether or not we should use the TF sandbox test mode.

boolean shouldDisableInvocationSetupAndTeardown()

Whether or not to disable pre-invocaiton setup and post-invocation teardown.

boolean shouldEnableDeviceSpecificSetup()

Whether to enable device specific setup or not.

boolean shouldForcePreparerFailureAsTestFailure()

When a preparer failed for a test, it may fail test invocation as infra error, which leads to test run retry.

boolean shouldPassRetryAttemptNumber()

Whether to pass retry attempt number.

boolean shouldRemoteDynamicShard()

Returns whether to use remote dynamic sharding server or not

boolean shouldReportModuleProgression()

Whether or not to report progression of remote invocation at module level.

boolean shouldSkipParentProcessLogcat()

Whether to skip logcat for parent process.

boolean shouldUploadCacheResults()

Returns true if we should capture the results in the cache.

boolean shouldUploadInvocationCacheResults()

Returns true if we should capture the invocation results in the cache.

boolean shouldUseDynamicSharding()

Returns if we should use dynamic sharding or not

boolean shouldUseEvenModuleSharding()

Returns whether to attempt to distribute number of modules evenly across shards

boolean shouldUseParallelPreInvocationSetup()

Return whether to execute pre-invocation setup in parallel.

boolean shouldUseParallelRemoteSetup()

Whether or not to attempt parallel setup of the remote devices.

boolean shouldUseParallelSetup()

Whether or not to attempt parallel setup.

boolean shouldUseRemoteSandboxMode()

Whether or not to use sandbox mode in remote invocation.

boolean shouldUseReplicateSetup()

Whether or not to use replicated setup for all the remote devices.

boolean shouldUseSandboxTestMode()

Returns true if we should use the Tf sandbox in a test mode.

boolean shouldUseSandboxing()

Returns true if we should use Tf containers to run the invocation

boolean shouldUseTokenSharding()

Whether or not sharding should use the token support.

boolean skipTrybotExperiment()

Whether to skip experiments for TRYBOT runs.

boolean takeBugreportOnInvocationEnded()

Return true if a bugreport should be taken when the test invocation has ended.

boolean takeBugreportzOnInvocationEnded()

Return true if a bugreportz should be taken instead of bugreport during the test invocation final bugreport.

Constants

DRY_RUN_OPTION

public static final String DRY_RUN_OPTION

Constant Value: "dry-run"

ENABLE_SANDBOX_TEST_MODE

public static final String ENABLE_SANDBOX_TEST_MODE

Constant Value: "sandbox-test-mode"

INVOCATION_DATA

public static final String INVOCATION_DATA

Constant Value: "invocation-data"

JDK_FOLDER_OPTION_NAME

public static final String JDK_FOLDER_OPTION_NAME

Constant Value: "jdk-folder-for-subprocess"

NOISY_DRY_RUN_OPTION

public static final String NOISY_DRY_RUN_OPTION

Constant Value: "noisy-dry-run"

TEST_TAG_OPTION

public static final String TEST_TAG_OPTION

Constant Value: "test-tag"

USE_REMOTE_SANDBOX

public static final String USE_REMOTE_SANDBOX

Constant Value: "use-remote-sandbox"

USE_SANDBOX

public static final String USE_SANDBOX

Constant Value: "use-sandbox"

Public constructors

CommandOptions

public CommandOptions ()

Public methods

captureLogcatOnFailure

public boolean captureLogcatOnFailure ()

Whether or not to capture a logcat on test case failure

Returns
boolean

captureScreenshotOnFailure

public boolean captureScreenshotOnFailure ()

Whether or not to capture a screenshot on test case failure

Returns
boolean

clone

public ICommandOptions clone ()

Returns
ICommandOptions

delegatedEarlyDeviceRelease

public boolean delegatedEarlyDeviceRelease ()

Whether or not to release the device early in delegated mode.

Returns
boolean

earlyDeviceRelease

public boolean earlyDeviceRelease ()

Whether or not to release the device early when done with it.

Returns
boolean

enableDefaultLogProcessors

public boolean enableDefaultLogProcessors ()

Whether to auto deploy some post processors.

Returns
boolean

filterPreviousPassedTests

public boolean filterPreviousPassedTests ()

Whether or not to filters previous passed test cases from previous attempt.

Returns
boolean

getAutoCollectorSetOptions

public List<String> getAutoCollectorSetOptions ()

Returns the list of options to pass to the auto collectors.

Returns
List<String>

getAutoLogCollectors

public Set<AutoLogCollector> getAutoLogCollectors ()

Returns the set of auto log collectors to be added for an invocation

Returns
Set<AutoLogCollector>

getAutoLogProcessors

public Set<AutoLogProcessor> getAutoLogProcessors ()

Returns the set of auto log processors to be added for an invocation

Returns
Set<AutoLogProcessor>

getDynamicDownloadArgs

public Map<String, String> getDynamicDownloadArgs ()

Returns the map of args to pass to the dynamic download query.

Returns
Map<String, String>

getExperimentalFlags

public MultiMap<String, String> getExperimentalFlags ()

Returns the experimental flags map, that can be used to feature gate projects.

Returns
MultiMap<String, String>

getExtraRemotePostsubmitInstance

public int getExtraRemotePostsubmitInstance ()

Whether or not to start extra instances in the remote VM in postsubmit.

Returns
int

getGeminiApiKey

public String getGeminiApiKey ()

The API key to use for Gemini API prompt queries.

Returns
String

getHostLogSuffix

public String getHostLogSuffix ()

Returns the suffix to append to the Tradefed host_log or null if no prefix.

Returns
String

getInvocationData

public UniqueMultiMap<String, String> getInvocationData ()

Returns the data passed to the invocation to describe it

Returns
UniqueMultiMap<String, String>

getInvocationTimeout

public long getInvocationTimeout ()

Return the invocation timeout specified. 0 if no timeout to be used.

Returns
long

getJdkFolderForSubprocess

public File getJdkFolderForSubprocess ()

Returns the jdk folder to use when forking execution in a subprocess.

Returns
File

getLoopTime

public long getLoopTime ()

Get the time to wait before re-scheduling this command.

Returns
long time in ms

getMaxLoopCount

public long getMaxLoopCount ()

Returns the maximum number of times to scheduled the command. Has no effect if isLoopMode is false.

Returns
long

getMultiDeviceCount

public Integer getMultiDeviceCount ()

Return the number of devices for multi-device tests.

Returns
Integer

getOptimizeMainlineTest

public boolean getOptimizeMainlineTest ()

Returns true if we should optimize the list of test modules for mainline test.

Returns
boolean

getParallelPreInvocationSetupTimeout

public Duration getParallelPreInvocationSetupTimeout ()

Return the timeout for parallel pre-invocation setup.

Returns
Duration

getParallelSetupTimeout

public Duration getParallelSetupTimeout ()

Returns the timeout to use during parallel setups.

Returns
Duration

getRemoteCacheInstanceName

public String getRemoteCacheInstanceName ()

Returns the name of the instance used to handle remote caching.

Returns
String

getRemoteFiles

public Set<String> getRemoteFiles ()

Returns the list of remote files configured.

Returns
Set<String>

getRolloutFlags

public MultiMap<String, String> getRolloutFlags ()

Returns the rollout flags map. Rollout flags are different from experimental flags, as they are intended to be used for every invocation.

Returns
MultiMap<String, String>

getRolloutFlagsFiles

public List<File> getRolloutFlagsFiles ()

Returns a list of files containing rollout flags.

Returns
List<File>

getShardCount

public Integer getShardCount ()

Return the total shard count for the command.

Returns
Integer

getShardIndex

public Integer getShardIndex ()

Return the shard index for the command.

Returns
Integer

getTestTag

public String getTestTag ()

Return the test-tag for the invocation. Default is 'stub' if unspecified.

Returns
String

getTestTagSuffix

public String getTestTagSuffix ()

Return the test-tag suffix, appended to test-tag to represents some variants of one test.

Returns
String

isConditionalBugreportDisabled

public boolean isConditionalBugreportDisabled ()

Returns whether or not conditional bugreport is disabled

Returns
boolean

isDryRunMode

public boolean isDryRunMode ()

Return true if we should skip adding this command to the queue.

Returns
boolean

isExperimentEnabled

public boolean isExperimentEnabled ()

Whether or not to enable experiments through experimental flags.

Returns
boolean

isFullHelpMode

public boolean isFullHelpMode ()

Returns true if full detailed help mode has been requested

Returns
boolean

isGeminiLogOnlyMode

public boolean isGeminiLogOnlyMode ()

Whether to silence the prompt execution of models.

Returns
boolean

isHelpMode

public boolean isHelpMode ()

Returns true if abbreviated help mode has been requested

Returns
boolean

isLoopMode

public boolean isLoopMode ()

Return the loop mode for the config.

Returns
boolean

isNoisyDryRunMode

public boolean isNoisyDryRunMode ()

Return true if we should print the command out to the console before we skip adding it to the queue.

Returns
boolean

isRemoteInvocationDeviceless

public boolean isRemoteInvocationDeviceless ()

Whether or not to trigger a deviceless remote invocation.

Returns
boolean

isTracingEnabled

public boolean isTracingEnabled ()

Returns whether or not invocation tracing is enabled.

Returns
boolean

keepPostProcessorOrder

public boolean keepPostProcessorOrder ()

Whether to apply post processors in the order they are mentioned in the config.

Returns
boolean

reportCacheResults

public boolean reportCacheResults ()

Returns true if we should report cache results when available.

Returns
boolean

reportCacheResultsInPresubmit

public boolean reportCacheResultsInPresubmit ()

Returns true if we should report cache results when available in presubmit.

Returns
boolean

reportInvocationCacheResultsInPostsubmit

public boolean reportInvocationCacheResultsInPostsubmit ()

Returns true if we should report invocation cache result when available in postsubmit.

Returns
boolean

reportInvocationCacheResultsInPresubmit

public boolean reportInvocationCacheResultsInPresubmit ()

Returns true if we should report invocation cache results when available in presubmit.

Returns
boolean

reportInvocationComplete

public boolean reportInvocationComplete ()

whether or not to report the logs until invocationComplete.

Returns
boolean

reportPassedTests

public boolean reportPassedTests ()

Whether or not to report passed test cases.

Returns
boolean

reportTestCaseCount

public boolean reportTestCaseCount ()

Whether or not to report the number of test cases per test types.

Returns
boolean

reportingTags

public List<String> reportingTags ()

List of tags used for reporting related to the invocation.

Returns
List<String>

runOnAllDevices

public boolean runOnAllDevices ()

Return true if command should run on all devices.

Returns
boolean

setAutoCollectorSetOptions

public void setAutoCollectorSetOptions (List<String> autoCollectorSetOptions)

Sets the list of options to pass to the auto collectors.

Parameters
autoCollectorSetOptions List

setAutoLogCollectors

public void setAutoLogCollectors (Set<AutoLogCollector> autoLogCollectors)

Sets the set of auto log collectors that should be added to an invocation.

Parameters
autoLogCollectors Set

setAutoLogProcessors

public void setAutoLogProcessors (Set<AutoLogProcessor> autoLogProcessors)

Sets the set of auto log processors that should be added to an invocation.

Parameters
autoLogProcessors Set

setBugreportOnInvocationEnded

public void setBugreportOnInvocationEnded (boolean takeBugreport)

Sets whether or not to capture a bugreport at the end of the invocation.

Parameters
takeBugreport boolean

setBugreportzOnInvocationEnded

public void setBugreportzOnInvocationEnded (boolean takeBugreportz)

Sets whether or not to capture a bugreportz at the end of the invocation.

Parameters
takeBugreportz boolean

setDelegatedEarlyDeviceRelease

public void setDelegatedEarlyDeviceRelease (boolean earlyRelease)

Set whether or not to release the device early in delegated mode.

Parameters
earlyRelease boolean

setHostLogSuffix

public void setHostLogSuffix (String suffix)

Sets the suffix to append to Tradefed host_log.

Parameters
suffix String

setInvocationTimeout

public void setInvocationTimeout (Long invocationTimeout)

Set the invocation timeout. 0 if no timeout to be used.

Parameters
invocationTimeout Long

setLoopMode

public void setLoopMode (boolean loopMode)

Set the loop mode for the config.

setMultiDeviceCount

public void setMultiDeviceCount (int count)

Sets the number of expected devices for multi-device tests.

Parameters
count int

setReplicateSetup

public void setReplicateSetup (boolean replicate)

Set whether or not to use replicated setup.

Parameters
replicate boolean

setReportInvocationComplete

public void setReportInvocationComplete (boolean reportInvocationCompleteLogs)

Set whether or not to report the logs until invocationComplete

Parameters
reportInvocationCompleteLogs boolean

setReportTestCaseCount

public void setReportTestCaseCount (boolean report)

Set whether or not to report test cases count per test types.

Parameters
report boolean

setShardCount

public void setShardCount (Integer shardCount)

Sets the shard count for the command.

Parameters
shardCount Integer

setShardIndex

public void setShardIndex (Integer shardIndex)

Sets the shard index for the command.

Parameters
shardIndex Integer

setShouldRemoteDynamicShard

public void setShouldRemoteDynamicShard (boolean shouldRemoteDynamicShard)

Sets whether to use remote dynamic sharding server or not

Parameters
shouldRemoteDynamicShard boolean

setShouldUseEvenModuleSharding

public void setShouldUseEvenModuleSharding (boolean useEvenModuleSharding)

Set whether to attempt to distribute number of modules evenly across shards

Parameters
useEvenModuleSharding boolean

setShouldUseSandboxing

public void setShouldUseSandboxing (boolean use)

Sets whether or not we should use TF containers

Parameters
use boolean

setTestTag

public void setTestTag (String testTag)

Sets the test-tag for the invocation.

setUseSandboxTestMode

public void setUseSandboxTestMode (boolean use)

Sets whether or not we should use the TF sandbox test mode.

Parameters
use boolean

shouldDisableInvocationSetupAndTeardown

public boolean shouldDisableInvocationSetupAndTeardown ()

Whether or not to disable pre-invocaiton setup and post-invocation teardown.

Returns
boolean

shouldEnableDeviceSpecificSetup

public boolean shouldEnableDeviceSpecificSetup ()

Whether to enable device specific setup or not.

Returns
boolean

shouldForcePreparerFailureAsTestFailure

public boolean shouldForcePreparerFailureAsTestFailure ()

When a preparer failed for a test, it may fail test invocation as infra error, which leads to test run retry. This option allows such failure to be converted to a test failure, so infra does not waste resources to retry the whole test run.

Returns
boolean

shouldPassRetryAttemptNumber

public boolean shouldPassRetryAttemptNumber ()

Whether to pass retry attempt number.

Returns
boolean

shouldRemoteDynamicShard

public boolean shouldRemoteDynamicShard ()

Returns whether to use remote dynamic sharding server or not

Returns
boolean

shouldReportModuleProgression

public boolean shouldReportModuleProgression ()

Whether or not to report progression of remote invocation at module level.

Returns
boolean

shouldSkipParentProcessLogcat

public boolean shouldSkipParentProcessLogcat ()

Whether to skip logcat for parent process.

Returns
boolean

shouldUploadCacheResults

public boolean shouldUploadCacheResults ()

Returns true if we should capture the results in the cache.

Returns
boolean

shouldUploadInvocationCacheResults

public boolean shouldUploadInvocationCacheResults ()

Returns true if we should capture the invocation results in the cache.

Returns
boolean

shouldUseDynamicSharding

public boolean shouldUseDynamicSharding ()

Returns if we should use dynamic sharding or not

Returns
boolean

shouldUseEvenModuleSharding

public boolean shouldUseEvenModuleSharding ()

Returns whether to attempt to distribute number of modules evenly across shards

Returns
boolean

shouldUseParallelPreInvocationSetup

public boolean shouldUseParallelPreInvocationSetup ()

Return whether to execute pre-invocation setup in parallel.

Returns
boolean

shouldUseParallelRemoteSetup

public boolean shouldUseParallelRemoteSetup ()

Whether or not to attempt parallel setup of the remote devices.

Returns
boolean

shouldUseParallelSetup

public boolean shouldUseParallelSetup ()

Whether or not to attempt parallel setup.

Returns
boolean

shouldUseRemoteSandboxMode

public boolean shouldUseRemoteSandboxMode ()

Whether or not to use sandbox mode in remote invocation.

Returns
boolean

shouldUseReplicateSetup

public boolean shouldUseReplicateSetup ()

Whether or not to use replicated setup for all the remote devices.

Returns
boolean

shouldUseSandboxTestMode

public boolean shouldUseSandboxTestMode ()

Returns true if we should use the Tf sandbox in a test mode.

Returns
boolean

shouldUseSandboxing

public boolean shouldUseSandboxing ()

Returns true if we should use Tf containers to run the invocation

Returns
boolean

shouldUseTokenSharding

public boolean shouldUseTokenSharding ()

Whether or not sharding should use the token support.

Returns
boolean

skipTrybotExperiment

public boolean skipTrybotExperiment ()

Whether to skip experiments for TRYBOT runs.

Returns
boolean

takeBugreportOnInvocationEnded

public boolean takeBugreportOnInvocationEnded ()

Return true if a bugreport should be taken when the test invocation has ended.

Returns
boolean

takeBugreportzOnInvocationEnded

public boolean takeBugreportzOnInvocationEnded ()

Return true if a bugreportz should be taken instead of bugreport during the test invocation final bugreport.

Returns
boolean