Merge "Clean up the CtsNetTestCasesMaxTargetSdk filters" into main

This commit is contained in:
Treehugger Robot 2025-04-18 01:09:38 -07:00 • committed by Android (Google) Code Review
commit 298954da0d
2 changed files with 27 additions and 11 deletions

View file

@ -135,6 +135,14 @@ android_test {
target_sdk_version: "33",
package_name: "android.net.cts.maxtargetsdk33",
instrumentation_target_package: "android.net.cts.maxtargetsdk33",
test_options: {
test_runner_options: [
{
name: "include-annotation",
value: "com.android.testutils.filters.CtsNetTestCasesMaxTargetSdk33",
},
],
},
}
android_test {
@ -143,6 +151,14 @@ android_test {
target_sdk_version: "31",
package_name: "android.net.cts.maxtargetsdk31", // CTS package names must be unique.
instrumentation_target_package: "android.net.cts.maxtargetsdk31",
test_options: {
test_runner_options: [
{
name: "include-annotation",
value: "com.android.testutils.filters.CtsNetTestCasesMaxTargetSdk31",
},
],
},
}
android_test {
@ -151,6 +167,14 @@ android_test {
target_sdk_version: "30",
package_name: "android.net.cts.maxtargetsdk30", // CTS package names must be unique.
instrumentation_target_package: "android.net.cts.maxtargetsdk30",
test_options: {
test_runner_options: [
{
name: "include-annotation",
value: "com.android.testutils.filters.CtsNetTestCasesMaxTargetSdk30",
},
],
},
}
android_test_helper_app {

View file

@ -47,18 +47,10 @@
<option name="hidden-api-checks" value="false" />
<option name="isolated-storage" value="false" />
<option name="instrumentation-arg" key="test-module-name" value="{MODULE}" />
<!-- Test filter that allows test APKs to select which tests they want to run by annotating
those tests with an annotation matching the name of the APK.
This allows us to maintain one AndroidTestTemplate.xml for all CtsNetTestCases*.apk,
and have CtsNetTestCases run all tests, but have CtsNetTestCasesMaxTargetSdk31 run only
tests that require target SDK 31.
This relies on the fact that if the class specified in include-annotation exists, then
the runner will only run the tests annotated with that annotation, but if it does not,
the runner will run all the tests. -->
<option name="include-annotation" value="com.android.testutils.filters.{MODULE}" />
<option name="device-listeners" value="com.android.testutils.ConnectivityDiagnosticsCollector" />
<!-- Extra configuration specified in the build rules (.bp). In particular, they may specify
include-annotation filters to only run a subset of the test cases. -->
{EXTRA_TEST_RUNNER_CONFIGS}
</test>
<metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
<!-- Pattern matching the fileKey used by ConnectivityDiagnosticsCollector when calling addFileMetric -->