Add NetHttpCoverageTests to mainline presubmit

Mainline presubmit runs on older images. So we need to set:
- min_sdk_version to the minimum sdk we support otherwise
it would default to current
- enforce_default_target_sdk_version since mainline needs
all modules to target the latest sdk

Test: presubmit
Bug: 263294440
Change-Id: I20757b13ab9ab45908dae088c6cb6b0bbc51989d
This commit is contained in:
Chidera Olibie
2023-01-24 20:22:56 +00:00
parent 6477d7b697
commit d66799a20c
7 changed files with 18 additions and 3 deletions

View File

@@ -27,7 +27,9 @@ package {
android_test {
name: "NetHttpCoverageTests",
defaults: ["CronetTestJavaDefaults"],
enforce_default_target_sdk_version: true,
sdk_version: "test_current",
min_sdk_version: "30",
test_suites: ["general-tests", "mts-tethering"],
static_libs: [
"modules-utils-native-coverage-listener",

View File

@@ -18,6 +18,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.android.net.http.tests.coverage">
<!-- NetHttpCoverageTests combines CtsNetHttpTestCases and NetHttpTests targets,
so permissions and others are declared in their respective manifests -->
<application tools:replace="android:label"

View File

@@ -20,8 +20,11 @@
</target_preparer>
<option name="test-tag" value="NetHttpCoverageTests" />
<!-- Tethering/Connectivity is a SDK 30+ module -->
<!-- TODO Switch back to Sdk30 when b/270049141 is fixed -->
<object type="module_controller"
class="com.android.tradefed.testtype.suite.module.Sdk30ModuleController" />
class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
<option name="config-descriptor:metadata" key="mainline-param"
value="CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.net.http.tests.coverage" />
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />

View File

@@ -44,6 +44,7 @@ java_defaults {
android_library {
name: "CtsNetHttpTestsLib",
sdk_version: "test_current",
min_sdk_version: "30",
srcs: [
"src/**/*.java",
"src/**/*.kt",
@@ -62,6 +63,7 @@ android_library {
"framework-tethering",
"org.apache.http.legacy",
],
lint: { test: true }
}
android_test {

View File

@@ -20,6 +20,8 @@ package {
android_library {
name: "NetHttpTestsLibPreJarJar",
srcs: [":cronet_aml_javatests_sources"],
sdk_version: "test_current",
min_sdk_version: "30",
static_libs: [
"androidx.test.ext.junit",
"androidx.test.rules",
@@ -28,7 +30,8 @@ android_library {
libs: [
"android.test.base",
"framework-tethering-pre-jarjar",
]
],
lint: { test: true }
}
android_test {

View File

@@ -16,8 +16,9 @@
-->
<configuration description="Runs NetHttp Mainline Tests.">
<!-- Only run tests if the device under test is SDK version 30 or above. -->
<!-- TODO Switch back to Sdk30 when b/270049141 is fixed -->
<object type="module_controller"
class="com.android.tradefed.testtype.suite.module.Sdk30ModuleController" />
class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="test-file-name" value="NetHttpTests.apk" />

View File

@@ -213,6 +213,9 @@
},
{
"name": "libnetworkstats_test[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]"
},
{
"name": "NetHttpCoverageTests[CaptivePortalLoginGoogle.apk+NetworkStackGoogle.apk+com.google.android.resolv.apex+com.google.android.tethering.apex]"
}
],
"mainline-postsubmit": [