/** Client that allows reporting usage metrics to clearcut. */publicclassClearcutClient{publicstaticfinalStringDISABLE_CLEARCUT_KEY="DISABLE_CLEARCUT";/** Returns True if clearcut is disabled, False otherwise. */@VisibleForTestingbooleanisClearcutDisabled(){return"1".equals(System.getenv(DISABLE_CLEARCUT_KEY));}/**
* Create Client with customized posting URL and forcing whether it's internal or external user.
*/@VisibleForTestingprotectedClearcutClient(Stringurl,StringsubToolName){mDisabled=isClearcutDisabled();// We still have to set the 'final' variable so go through the assignments before returningif(!mDisabled&&isGoogleUser()){mLogSource=INTERNAL_LOG_SOURCE;mUserType=UserType.GOOGLE;}else{mLogSource=EXTERNAL_LOG_SOURCE;mUserType=UserType.EXTERNAL;}if(url==null){mUrl=CLEARCUT_PROD_URL;}else{mUrl=url;}mRunId=UUID.randomUUID().toString();mExternalEventQueue=newArrayList<>();mSubToolName=subToolName;if(mDisabled){return;}
Add an option 'has-server-side-config' am: 6ede4f47c7
Original change: https://android-review.googlesource.com/c/platform/test/suite_harness/+/2719415
Change-Id: Ifa74a4cdcf22b6c1fe8ebaf4e848db7cf813feeb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
1
2
3
4
@Option(
name = "has-server-side-config",
description = "Whether there exists a service side dynamic config.")
private boolean mHasServerSideConfig = true;
根据这个值查找了 run cts –help-all 里面有如下说明:
1
2
3
4
5
6
7
8
9
10
11
12
'dynamic-config-pusher' device options:
--api-key API key for for dynamic configuration. Default: AIzaSyAbwX5JRlmsLeygY2WWihpIJPXFLueOQ3U.
--[no-]cleanup Whether to remove config files from the test target after test completion. Default: true.
--config-url The url path of the dynamic config. If set, will override the default config location defined in CompatibilityBuildProvider. Default: https://androidpartner.googleapis.com/v1/dynamicconfig/suites/{suite-name}/modules/{module}/version/{version}?key={api-key}.
--[no-]has-server-side-config
Whether there exists a service side dynamic config. Default: true.
--config-filename The module name for module-level configurations, or the suite name for suite-level configurations Default: cts.
--target The test target, "device" or "host" Default: HOST. Valid values: [DEVICE, HOST]
--version The version of the configuration to retrieve from the server, e.g. "1.0". Defaults to suite version string.
--[no-]extract-from-resource
Whether to look for the local dynamic config inside the jar resources or on the local disk. Default: true.
所以添加 –no-has-server-side-config 就可以跳过这一步了。
总结
需要在终端先执行: export DISABLE_CLEARCUT_KEY=1
跑测试用例的时候: run cts -d –skip-preconditions –no-has-server-side-config -m CtsIcuTestCases -t android.icu.dev.test.timezone.TimeZoneTest#TestCanonicalID