1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.tradefed.command; 17 18 import com.android.tradefed.config.ConfigurationException; 19 import com.android.tradefed.config.Option; 20 import com.android.tradefed.config.Option.Importance; 21 import com.android.tradefed.config.OptionCopier; 22 import com.android.tradefed.device.metric.AutoLogCollector; 23 import com.android.tradefed.log.LogUtil.CLog; 24 import com.android.tradefed.util.UniqueMultiMap; 25 26 import java.io.File; 27 import java.time.Duration; 28 import java.util.ArrayList; 29 import java.util.LinkedHashMap; 30 import java.util.LinkedHashSet; 31 import java.util.List; 32 import java.util.Map; 33 import java.util.Set; 34 35 /** 36 * Implementation of {@link ICommandOptions}. 37 */ 38 public class CommandOptions implements ICommandOptions { 39 40 @Option(name = "help", description = 41 "display the help text for the most important/critical options.", 42 importance = Importance.ALWAYS) 43 private boolean mHelpMode = false; 44 45 @Option(name = "help-all", description = "display the full help text for all options.", 46 importance = Importance.ALWAYS) 47 private boolean mFullHelpMode = false; 48 49 public static final String DRY_RUN_OPTION = "dry-run"; 50 public static final String NOISY_DRY_RUN_OPTION = "noisy-dry-run"; 51 52 @Option( 53 name = DRY_RUN_OPTION, 54 description = 55 "build but don't actually run the command. Intended as a quick check " 56 + "to ensure that a command is runnable.", 57 importance = Importance.ALWAYS 58 ) 59 private boolean mDryRunMode = false; 60 61 @Option( 62 name = NOISY_DRY_RUN_OPTION, 63 description = 64 "build but don't actually run the command. This version prints the " 65 + "command to the console. Intended for cmdfile debugging.", 66 importance = Importance.ALWAYS 67 ) 68 private boolean mNoisyDryRunMode = false; 69 70 @Option(name = "min-loop-time", description = 71 "the minimum invocation time in ms when in loop mode.") 72 private Long mMinLoopTime = 10L * 60L * 1000L; 73 74 public static final String TEST_TAG_OPTION = "test-tag"; 75 76 @Option(name = TEST_TAG_OPTION, description = "Identifier for the invocation during reporting.") 77 private String mTestTag = "stub"; 78 79 @Option(name = "test-tag-suffix", description = "suffix for test-tag. appended to test-tag to " 80 + "represents some variants of one test.") 81 private String mTestTagSuffix = null; 82 83 @Option(name = "loop", description = "keep running continuously.", 84 importance = Importance.ALWAYS) 85 private boolean mLoopMode = false; 86 87 @Option(name = "max-loops", description = "the maximum number of loops.") 88 private long mMaxLoopCount = Long.MAX_VALUE; 89 90 @Option(name = "all-devices", description = 91 "fork this command to run on all connected devices.") 92 private boolean mAllDevices = false; 93 94 @Option(name = "bugreport-on-invocation-ended", description = 95 "take a bugreport when the test invocation has ended") 96 private boolean mTakeBugreportOnInvocationEnded = false; 97 98 @Option(name = "bugreportz-on-invocation-ended", description = "Attempt to take a bugreportz " 99 + "instead of bugreport during the test invocation final bugreport.") 100 private boolean mTakeBugreportzOnInvocationEnded = false; 101 102 @Option( 103 name = "disable-conditional-bugreport", 104 description = 105 "Disable the optimization to capture ANR instead of bugreport if no failure.") 106 private boolean mDisableConditionalBugreport = false; 107 108 @Option(name = "invocation-timeout", description = 109 "the maximum time to wait for an invocation to terminate before attempting to force" 110 + "stop it.", isTimeVal = true) 111 private long mInvocationTimeout = 0; 112 113 @Option(name = "shard-count", description = 114 "the number of total shards to run. Without --shard-index option, this will cause " + 115 "the command to spawn multiple shards in the current TF instance. With --shard-index " + 116 "option, it will cause the command to run a single shard of tests only.") 117 private Integer mShardCount; 118 119 @Option(name = "shard-index", description = 120 "the index of shard to run. Only set if shard-count > 1 and the value is in range " + 121 "[0, shard-count)") 122 private Integer mShardIndex; 123 124 @Option(name = "optimize-mainline-test", description = 125 "Whether or not to optimize the list of test modules for mainline.") 126 private boolean mOptimizeMainlineTest; 127 128 @Option( 129 name = "enable-token-sharding", 130 description = "Whether or not to allow sharding with the token support enabled." 131 ) 132 private boolean mTokenSharding = false; 133 134 @Option( 135 name = "dynamic-sharding", 136 description = 137 "Allow to dynamically move IRemoteTest from one shard to another. Only for local " 138 + "sharding." 139 ) 140 private boolean mDynamicSharding = true; 141 142 @Option( 143 name = "remote-dynamic-sharding", 144 description = 145 "Enable use of the dynamic sharding service to load balance across multiple" 146 + " hosts.") 147 private boolean mRemoteDynamicSharding = false; 148 149 @Option( 150 name = "use-even-module-sharding", 151 description = 152 "Enable use of a strategy that attempts to distribute number of " 153 + "modules evenly across shards") 154 private boolean mEvenModuleSharding = false; 155 156 public static final String INVOCATION_DATA = "invocation-data"; 157 158 @Option( 159 name = INVOCATION_DATA, 160 description = 161 "A map of values that describe the invocation, these values will be added to" 162 + " the invocation context.") 163 private UniqueMultiMap<String, String> mInvocationData = new UniqueMultiMap<>(); 164 165 public static final String USE_SANDBOX = "use-sandbox"; 166 public static final String ENABLE_SANDBOX_TEST_MODE = "sandbox-test-mode"; 167 public static final String USE_REMOTE_SANDBOX = "use-remote-sandbox"; 168 169 @Option( 170 name = "remote-files", 171 description = "A list of files references to store in build info") 172 private Set<String> mRemoteFiles = new LinkedHashSet<>(); 173 174 @Option( 175 name = USE_SANDBOX, 176 description = "Set if the invocation should use a sandbox to run or not." 177 ) 178 private boolean mUseSandbox = false; 179 180 @Option( 181 name = ENABLE_SANDBOX_TEST_MODE, 182 description = 183 "Sandbox test mode where the sandbox will use itself to generate another layer " 184 + "of sandboxing. This is used for the sandbox to validate itself.") 185 private boolean mSandboxTestMode = false; 186 187 @Option( 188 name = USE_REMOTE_SANDBOX, 189 description = "Whether or not to trigger --use-sandbox in the remote invocation." 190 ) 191 private boolean mUseRemoteSandbox = false; 192 193 @Option( 194 name = "deviceless-remote-exec", 195 description = "Whether or not to trigger --null-deviec in the remote invocation.") 196 private boolean mDevicelessRemoteExecution = false; 197 198 @Deprecated 199 @Option( 200 name = "parallel-remote-setup", 201 description = 202 "For remote sharded invocation, whether or not to attempt the setup in" 203 + " parallel.") 204 private boolean mUseParallelRemoteSetup = false; 205 206 @Option( 207 name = "parallel-pre-invocation-setup", 208 description = "Whether to execute pre-invocation setup in parallel.") 209 private boolean mUseParallelPreInvocationSetup = false; 210 211 @Option( 212 name = "parallel-pre-invocation-setup-timeout", 213 description = "Timeout for parallel pre-invocation setup.") 214 private Duration mParallelPreInvocationSetupTimeout = Duration.ofMinutes(30L); 215 216 @Option(name = "parallel-setup", description = "Whether to attempt the setup in parallel.") 217 private boolean mUseParallelSetup = false; 218 219 @Option(name = "parallel-setup-timeout", description = "Timeout to use during parallel setup.") 220 private Duration mParallelSetupTimeout = Duration.ofMinutes(30L); 221 222 @Option( 223 name = "replicate-parent-setup", 224 description = 225 "For remote sharded invocation, whether or not to replicate parent setup on " 226 + "all devices.") 227 private boolean mReplicateParentSetup = false; 228 229 @Option( 230 name = "report-module-progression", 231 description = "For remote invocation, whether or not to report progress at module level." 232 ) 233 private boolean mReportModuleProgression = false; 234 235 @Deprecated 236 @Option( 237 name = "extra-postsubmit-remote-instance", 238 description = 239 "Option that allows to run more instances in the remote VM in postsubmit. " 240 + "Used for experimentation.") 241 private int mExtraRemoteInstancePostsubmit = 0; 242 243 @Option( 244 name = "auto-collect", 245 description = 246 "Specify a set of collectors that will be automatically managed by the harness " 247 + "to collect logs." 248 ) 249 private Set<AutoLogCollector> mAutoCollectors = new LinkedHashSet<>(); 250 251 @Option( 252 name = "experiment-enabled", 253 description = "A feature flag used to enable experimental flags.") 254 private boolean mExperimentEnabled = false; 255 256 @Option( 257 name = "experimental-flags", 258 description = "Map of experimental flags that can be used for feature gating projects.") 259 private Map<String, String> mExperimentalFlags = new LinkedHashMap<>(); 260 261 @Option( 262 name = "skip-trybot-experiment", 263 description = "Whether to skip experiments for TRYBOT runs.") 264 private boolean mSkipTrybotExperiment = true; 265 266 @Deprecated 267 @Option( 268 name = "logcat-on-failure", 269 description = "take a logcat snapshot on every test failure." 270 ) 271 private boolean mLogcatOnFailure = false; 272 273 @Deprecated 274 @Option(name = "screenshot-on-failure", description = "Take a screenshot on every test failure") 275 private boolean mScreenshotOnFailure = false; 276 277 @Option( 278 name = "host-log-suffix", 279 description = "Suffix to add to Tradefed host_log before logging it." 280 ) 281 private String mHostLogSuffix = null; 282 283 @Option( 284 name = "early-device-release", 285 description = "Feature flag to release the device as soon as done with it.") 286 private boolean mEnableEarlyDeviceRelease = true; 287 288 @Option( 289 name = "delegated-early-device-release", 290 description = 291 "Feature flag to enable early device release when running in delegated mode.") 292 private boolean mEnableDelegatedEarlyDeviceRelease = true; 293 294 @Option( 295 name = "dynamic-download-args", 296 description = 297 "Extra args passed to the IRemoteFileResolver interface for dynamic download " 298 + "in the queryArgs.") 299 private Map<String, String> mDynamicDownloadArgs = new LinkedHashMap<>(); 300 301 @Option( 302 name = "report-counted-test-cases", 303 description = "Whether or not to report the number of test cases per test types.") 304 private boolean mCountTestCases = true; 305 306 @Option( 307 name = "report-passed-tests", 308 description = "Whether or not to report the passed tests in a file.") 309 private boolean mReportPassedTests = true; 310 311 @Option( 312 name = "filter-previous-passed", 313 description = "Feature flag to test filtering previously passed tests.") 314 private boolean mTestFilterPassed = true; 315 316 @Option( 317 name = "report-invocation-complete-logs", 318 description = "Whether or not to attempt to report the logs until invocationComplete.") 319 private boolean mReportInvocationCompleteLogs = true; 320 321 @Option( 322 name = "disable-invocation-setup-and-teardown", 323 description = "Disable the pre-invocation setup and post-invocation teardown phases.") 324 private boolean mDisableInvocationSetupAndTeardown = false; 325 326 @Option( 327 name = "multi-device-count", 328 description = "The number of devices for multi-device tests. For a new feature " 329 + "under developing, not for other uses.") 330 private Integer mMultiDeviceCount; 331 332 @Option(name = "enable-tracing", description = "Enable test invocation tracing.") 333 private boolean mTracingEnabled = true; 334 335 public static final String JDK_FOLDER_OPTION_NAME = "jdk-folder-for-subprocess"; 336 337 @Option( 338 name = "parallel-dynamic-download", 339 description = "Enable parallel download of dynamic files when supported.") 340 private boolean mEnableParallelDynamicDownload = false; 341 342 @Option( 343 name = JDK_FOLDER_OPTION_NAME, 344 description = 345 "Whenever the java execution is forked to another subprocess, use this jdk" 346 + " folder instead of current one.") 347 private File mJdkFolder; 348 349 @Option( 350 name = "remote-cache-instance-name", 351 description = 352 "The name of the instance used to handle remote caching. Set this option to" 353 + " enable caching in the test runners that support caching. The instance" 354 + " name should be in this format:" 355 + " projects/[PROJECT_ID]/instances/[INSTANCE_ID].") 356 private String mRemoteCacheInstanceName = null; 357 358 @Option( 359 name = "upload-cached-module-results", 360 description = "Whether or not to upload the results of a module to the cache") 361 private boolean mUploadCachedResults = false; 362 363 @Option( 364 name = "report-cache-results", 365 description = "Actually enable the reporting of caching status.") 366 private boolean mEnableModuleCachingResults = false; 367 368 @Option( 369 name = "report-cache-results-presubmit", 370 description = "Actually enable the reporting of caching status in presubmit.") 371 private boolean mEnableCachingResultsInPresubmit = false; 372 373 @Option( 374 name = "upload-cached-invocation-results", 375 description = "Whether or not to upload the results of a test invocation to the cache") 376 private boolean mUploadInvocationCachedResults = false; 377 378 @Option( 379 name = "report-cache-invocation-results-presubmit", 380 description = 381 "Actually enable the reporting of invocation caching status in presubmit.") 382 private boolean mEnableCachingInvocationResultsInPresubmit = false; 383 384 /** 385 * Set the help mode for the config. 386 * <p/> 387 * Exposed for testing. 388 */ setHelpMode(boolean helpMode)389 void setHelpMode(boolean helpMode) { 390 mHelpMode = helpMode; 391 } 392 393 /** 394 * {@inheritDoc} 395 */ 396 @Override isHelpMode()397 public boolean isHelpMode() { 398 return mHelpMode; 399 } 400 401 /** 402 * {@inheritDoc} 403 */ 404 @Override isFullHelpMode()405 public boolean isFullHelpMode() { 406 return mFullHelpMode; 407 } 408 409 /** 410 * Set the dry run mode for the config. 411 * <p/> 412 * Exposed for testing. 413 */ setDryRunMode(boolean dryRunMode)414 void setDryRunMode(boolean dryRunMode) { 415 mDryRunMode = dryRunMode; 416 } 417 418 /** 419 * {@inheritDoc} 420 */ 421 @Override isDryRunMode()422 public boolean isDryRunMode() { 423 return mDryRunMode || mNoisyDryRunMode; 424 } 425 426 /** 427 * {@inheritDoc} 428 */ 429 @Override isNoisyDryRunMode()430 public boolean isNoisyDryRunMode() { 431 return mNoisyDryRunMode; 432 } 433 434 /** 435 * Set the loop mode for the config. 436 */ 437 @Override setLoopMode(boolean loopMode)438 public void setLoopMode(boolean loopMode) { 439 mLoopMode = loopMode; 440 } 441 442 /** 443 * {@inheritDoc} 444 */ 445 @Override isLoopMode()446 public boolean isLoopMode() { 447 return mLoopMode; 448 } 449 450 /** 451 * Set the min loop time for the config. 452 * <p/> 453 * Exposed for testing. 454 */ setMinLoopTime(long loopTime)455 void setMinLoopTime(long loopTime) { 456 mMinLoopTime = loopTime; 457 } 458 459 /** 460 * {@inheritDoc} 461 */ 462 @Override getLoopTime()463 public long getLoopTime() { 464 return mMinLoopTime; 465 } 466 467 @Override getMaxLoopCount()468 public long getMaxLoopCount() { 469 return mMaxLoopCount; 470 } 471 472 @Override clone()473 public ICommandOptions clone() { 474 CommandOptions clone = new CommandOptions(); 475 try { 476 OptionCopier.copyOptions(this, clone); 477 } catch (ConfigurationException e) { 478 CLog.e("failed to clone command options: %s", e.getMessage()); 479 } 480 return clone; 481 } 482 483 /** 484 * {@inheritDoc} 485 */ 486 @Override runOnAllDevices()487 public boolean runOnAllDevices() { 488 return mAllDevices; 489 } 490 491 /** 492 * {@inheritDoc} 493 */ 494 @Override takeBugreportOnInvocationEnded()495 public boolean takeBugreportOnInvocationEnded() { 496 return mTakeBugreportOnInvocationEnded; 497 } 498 499 /** {@inheritDoc} */ 500 @Override setBugreportOnInvocationEnded(boolean takeBugreport)501 public void setBugreportOnInvocationEnded(boolean takeBugreport) { 502 mTakeBugreportOnInvocationEnded = takeBugreport; 503 } 504 505 /** 506 * {@inheritDoc} 507 */ 508 @Override takeBugreportzOnInvocationEnded()509 public boolean takeBugreportzOnInvocationEnded() { 510 return mTakeBugreportzOnInvocationEnded; 511 } 512 513 /** {@inheritDoc} */ 514 @Override setBugreportzOnInvocationEnded(boolean takeBugreportz)515 public void setBugreportzOnInvocationEnded(boolean takeBugreportz) { 516 mTakeBugreportzOnInvocationEnded = takeBugreportz; 517 } 518 519 /** {@inheritDoc} */ 520 @Override isConditionalBugreportDisabled()521 public boolean isConditionalBugreportDisabled() { 522 return mDisableConditionalBugreport; 523 } 524 525 /** 526 * {@inheritDoc} 527 */ 528 @Override getInvocationTimeout()529 public long getInvocationTimeout() { 530 return mInvocationTimeout; 531 } 532 533 /** 534 * {@inheritDoc} 535 */ 536 @Override setInvocationTimeout(Long invocationTimeout)537 public void setInvocationTimeout(Long invocationTimeout) { 538 mInvocationTimeout = invocationTimeout; 539 } 540 541 /** 542 * {@inheritDoc} 543 */ 544 @Override getOptimizeMainlineTest()545 public boolean getOptimizeMainlineTest() { 546 return mOptimizeMainlineTest; 547 } 548 549 /** 550 * {@inheritDoc} 551 */ 552 @Override getShardCount()553 public Integer getShardCount() { 554 return mShardCount; 555 } 556 557 /** 558 * {@inheritDoc} 559 */ 560 @Override setShardCount(Integer shardCount)561 public void setShardCount(Integer shardCount) { 562 mShardCount = shardCount; 563 } 564 565 /** 566 * {@inheritDoc} 567 */ 568 @Override getShardIndex()569 public Integer getShardIndex() { 570 return mShardIndex; 571 } 572 573 /** 574 * {@inheritDoc} 575 */ 576 @Override setShardIndex(Integer shardIndex)577 public void setShardIndex(Integer shardIndex) { 578 mShardIndex = shardIndex; 579 } 580 581 /** {@inheritDoc} */ 582 @Override shouldUseTokenSharding()583 public boolean shouldUseTokenSharding() { 584 return mTokenSharding; 585 } 586 587 /** 588 * {@inheritDoc} 589 */ 590 @Override setTestTag(String testTag)591 public void setTestTag(String testTag) { 592 mTestTag = testTag; 593 } 594 595 /** 596 * {@inheritDoc} 597 */ 598 @Override getTestTag()599 public String getTestTag() { 600 return mTestTag; 601 } 602 603 /** 604 * {@inheritDoc} 605 */ 606 @Override getTestTagSuffix()607 public String getTestTagSuffix() { 608 return mTestTagSuffix; 609 } 610 611 /** {@inheritDoc} */ 612 @Override shouldUseDynamicSharding()613 public boolean shouldUseDynamicSharding() { 614 return mDynamicSharding; 615 } 616 617 /** {@inheritDoc} */ 618 @Override getInvocationData()619 public UniqueMultiMap<String, String> getInvocationData() { 620 return mInvocationData; 621 } 622 623 /** {@inheritDoc} */ 624 @Override getRemoteFiles()625 public Set<String> getRemoteFiles() { 626 return mRemoteFiles; 627 } 628 629 /** {@inheritDoc} */ 630 @Override shouldUseSandboxing()631 public boolean shouldUseSandboxing() { 632 return mUseSandbox; 633 } 634 635 /** {@inheritDoc} */ 636 @Override setShouldUseSandboxing(boolean use)637 public void setShouldUseSandboxing(boolean use) { 638 mUseSandbox = use; 639 } 640 641 /** {@inheritDoc} */ 642 @Override shouldUseSandboxTestMode()643 public boolean shouldUseSandboxTestMode() { 644 return mSandboxTestMode; 645 } 646 647 /** {@inheritDoc} */ 648 @Override setUseSandboxTestMode(boolean use)649 public void setUseSandboxTestMode(boolean use) { 650 mSandboxTestMode = use; 651 } 652 653 /** {@inheritDoc} */ 654 @Override shouldUseRemoteSandboxMode()655 public boolean shouldUseRemoteSandboxMode() { 656 return mUseRemoteSandbox; 657 } 658 659 /** {@inheritDoc} */ 660 @Override isRemoteInvocationDeviceless()661 public boolean isRemoteInvocationDeviceless() { 662 return mDevicelessRemoteExecution; 663 } 664 665 /** {@inheritDoc} */ 666 @Override getAutoLogCollectors()667 public Set<AutoLogCollector> getAutoLogCollectors() { 668 return mAutoCollectors; 669 } 670 671 /** {@inheritDoc} */ 672 @Override setAutoLogCollectors(Set<AutoLogCollector> autoLogCollectors)673 public void setAutoLogCollectors(Set<AutoLogCollector> autoLogCollectors) { 674 mAutoCollectors = autoLogCollectors; 675 } 676 677 /** {@inheritDoc} */ 678 @Override isExperimentEnabled()679 public boolean isExperimentEnabled() { 680 return mExperimentEnabled; 681 } 682 683 /** {@inheritDoc} */ 684 @Override getExperimentalFlags()685 public Map<String, String> getExperimentalFlags() { 686 return mExperimentalFlags; 687 } 688 689 /** {@inheritDoc} */ 690 @Override skipTrybotExperiment()691 public boolean skipTrybotExperiment() { 692 return mSkipTrybotExperiment; 693 } 694 695 /** {@inheritDoc} */ 696 @Override captureScreenshotOnFailure()697 public boolean captureScreenshotOnFailure() { 698 return mScreenshotOnFailure; 699 } 700 701 /** {@inheritDoc} */ 702 @Override captureLogcatOnFailure()703 public boolean captureLogcatOnFailure() { 704 return mLogcatOnFailure; 705 } 706 707 /** {@inheritDoc} */ 708 @Override getHostLogSuffix()709 public String getHostLogSuffix() { 710 return mHostLogSuffix; 711 } 712 713 /** {@inheritDoc} */ 714 @Override setHostLogSuffix(String suffix)715 public void setHostLogSuffix(String suffix) { 716 mHostLogSuffix = suffix; 717 } 718 /** {@inheritDoc} */ 719 @Override shouldUseParallelRemoteSetup()720 public boolean shouldUseParallelRemoteSetup() { 721 return mUseParallelRemoteSetup; 722 } 723 724 /** {@inheritDoc} */ 725 @Override shouldUseParallelPreInvocationSetup()726 public boolean shouldUseParallelPreInvocationSetup() { 727 return mUseParallelPreInvocationSetup; 728 } 729 730 /** {@inheritDoc} */ 731 @Override getParallelPreInvocationSetupTimeout()732 public Duration getParallelPreInvocationSetupTimeout() { 733 return mParallelPreInvocationSetupTimeout; 734 } 735 /** {@inheritDoc} */ 736 @Override shouldUseParallelSetup()737 public boolean shouldUseParallelSetup() { 738 return mUseParallelSetup; 739 } 740 741 /** {@inheritDoc} */ 742 @Override getParallelSetupTimeout()743 public Duration getParallelSetupTimeout() { 744 return mParallelSetupTimeout; 745 } 746 747 /** {@inheritDoc} */ 748 @Override shouldUseReplicateSetup()749 public boolean shouldUseReplicateSetup() { 750 return mReplicateParentSetup; 751 } 752 753 /** {@inheritDoc} */ 754 @Override setReplicateSetup(boolean replicate)755 public void setReplicateSetup(boolean replicate) { 756 mReplicateParentSetup = replicate; 757 } 758 759 /** {@inheritDoc} */ 760 @Override shouldReportModuleProgression()761 public boolean shouldReportModuleProgression() { 762 return mReportModuleProgression; 763 } 764 765 /** {@inheritDoc} */ 766 @Override getExtraRemotePostsubmitInstance()767 public int getExtraRemotePostsubmitInstance() { 768 return mExtraRemoteInstancePostsubmit; 769 } 770 771 /** {@inheritDoc} */ 772 @Override earlyDeviceRelease()773 public boolean earlyDeviceRelease() { 774 return mEnableEarlyDeviceRelease; 775 } 776 777 /** {@inheritDoc} */ 778 @Override delegatedEarlyDeviceRelease()779 public boolean delegatedEarlyDeviceRelease() { 780 return mEnableDelegatedEarlyDeviceRelease; 781 } 782 783 /** {@inheritDoc} */ 784 @Override setDelegatedEarlyDeviceRelease(boolean earlyRelease)785 public void setDelegatedEarlyDeviceRelease(boolean earlyRelease) { 786 mEnableDelegatedEarlyDeviceRelease = earlyRelease; 787 } 788 789 /** {@inheritDoc} */ 790 @Override getDynamicDownloadArgs()791 public Map<String, String> getDynamicDownloadArgs() { 792 return mDynamicDownloadArgs; 793 } 794 795 /** {@inheritDoc} */ 796 @Override reportTestCaseCount()797 public boolean reportTestCaseCount() { 798 return mCountTestCases; 799 } 800 801 /** {@inheritDoc} */ 802 @Override setReportTestCaseCount(boolean report)803 public void setReportTestCaseCount(boolean report) { 804 mCountTestCases = report; 805 } 806 807 /** {@inheritDoc} */ 808 @Override reportPassedTests()809 public boolean reportPassedTests() { 810 return mReportPassedTests; 811 } 812 813 /** {@inheritDoc} */ 814 @Override filterPreviousPassedTests()815 public boolean filterPreviousPassedTests() { 816 return mTestFilterPassed; 817 } 818 819 /** {@inheritDoc} */ 820 @Override reportInvocationComplete()821 public boolean reportInvocationComplete() { 822 return mReportInvocationCompleteLogs; 823 } 824 825 /** {@inheritDoc} */ 826 @Override setReportInvocationComplete(boolean reportInvocationCompleteLogs)827 public void setReportInvocationComplete(boolean reportInvocationCompleteLogs) { 828 mReportInvocationCompleteLogs = reportInvocationCompleteLogs; 829 } 830 831 /** {@inheritDoc} */ 832 @Override reportingTags()833 public List<String> reportingTags() { 834 List<String> tags = new ArrayList<>(); 835 // Convert a few of the enabled features into easily consumable tag that can be displayed 836 // to see if a feature is enabled. 837 if (mAutoCollectors.contains(AutoLogCollector.DEVICE_TRACE)) { 838 tags.add("device_tracing_enable"); 839 } 840 return tags; 841 } 842 843 /** {@inheritDoc} */ 844 @Override shouldDisableInvocationSetupAndTeardown()845 public boolean shouldDisableInvocationSetupAndTeardown() { 846 return mDisableInvocationSetupAndTeardown; 847 } 848 849 /** {@inheritDoc} */ 850 @Override getMultiDeviceCount()851 public Integer getMultiDeviceCount() { 852 return mMultiDeviceCount; 853 } 854 855 /** {@inheritDoc} */ 856 @Override setMultiDeviceCount(int count)857 public void setMultiDeviceCount(int count) { 858 mMultiDeviceCount = count; 859 } 860 861 /** {@inheritDoc} */ 862 @Override isTracingEnabled()863 public boolean isTracingEnabled() { 864 return mTracingEnabled; 865 } 866 867 /** {@inheritDoc} */ 868 @Override getJdkFolderForSubprocess()869 public File getJdkFolderForSubprocess() { 870 return mJdkFolder; 871 } 872 873 /** {@inheritDoc} */ 874 @Override shouldRemoteDynamicShard()875 public boolean shouldRemoteDynamicShard() { 876 return mRemoteDynamicSharding; 877 } 878 879 /** {@inheritDoc} */ 880 @Override setShouldRemoteDynamicShard(boolean shouldRemoteDynamicShard)881 public void setShouldRemoteDynamicShard(boolean shouldRemoteDynamicShard) { 882 mRemoteDynamicSharding = shouldRemoteDynamicShard; 883 } 884 885 /** {@inheritDoc} */ 886 @Override shouldUseEvenModuleSharding()887 public boolean shouldUseEvenModuleSharding() { 888 return mEvenModuleSharding; 889 } 890 891 /** {@inheritDoc} */ 892 @Override setShouldUseEvenModuleSharding(boolean useEvenModuleSharding)893 public void setShouldUseEvenModuleSharding(boolean useEvenModuleSharding) { 894 mEvenModuleSharding = useEvenModuleSharding; 895 } 896 897 /** {@inheritDoc} */ 898 @Override getRemoteCacheInstanceName()899 public String getRemoteCacheInstanceName() { 900 return mRemoteCacheInstanceName; 901 } 902 903 /** {@inheritDoc} */ 904 @Override shouldUploadCacheResults()905 public boolean shouldUploadCacheResults() { 906 return mUploadCachedResults; 907 } 908 909 /** {@inheritDoc} */ 910 @Override reportCacheResults()911 public boolean reportCacheResults() { 912 return mEnableModuleCachingResults; 913 } 914 915 /** {@inheritDoc} */ 916 @Override reportCacheResultsInPresubmit()917 public boolean reportCacheResultsInPresubmit() { 918 return mEnableCachingResultsInPresubmit; 919 } 920 921 /** {@inheritDoc} */ 922 @Override shouldUploadInvocationCacheResults()923 public boolean shouldUploadInvocationCacheResults() { 924 return mUploadInvocationCachedResults; 925 } 926 927 /** {@inheritDoc} */ 928 @Override reportInvocationCacheResultsInPresubmit()929 public boolean reportInvocationCacheResultsInPresubmit() { 930 return mEnableCachingInvocationResultsInPresubmit; 931 } 932 } 933