Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f48efe6 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN
Browse files

Add tests for stable API NetworkStack to presubmit

The API stable (system_29 at the moment) version of the NetworkStack
needs to be covered by unit tests in presubmit.

At the moment any difference between NetworkStackNext and
NetworkStack is dead code, so NetworkStackNextTests and
NetworkStackTests are identical.
This change renames NetworkStackTests to NetworkStackNextTests (because
NetworkStackTests historically used the "current", non-stable-API
version of the NetworkStack library), and adds tests for the stable API
version of the code as NetworkStackTests.

Test: atest NetworkStackTests NetworkStackApiStableTests
Change-Id: Iff9a94a7398791adbe856008bc4f9b6c131c3de7
parent 6f0cef79
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
  "presubmit": [
    {
      "name": "NetworkStackTests"
    },
    {
      "name": "NetworkStackNextTests"
    }
  ],
  "postsubmit": [
+17 −4
Original line number Diff line number Diff line
@@ -14,18 +14,16 @@
// limitations under the License.
//

android_test {
    name: "NetworkStackTests",
java_defaults {
    name: "NetworkStackTestsDefaults",
    certificate: "platform",
    srcs: ["src/**/*.java", "src/**/*.kt"],
    test_suites: ["device-tests"],
    resource_dirs: ["res"],
    static_libs: [
        "androidx.test.rules",
        "kotlin-reflect",
        "mockito-target-extended-minus-junit4",
        "net-tests-utils",
        "NetworkStackApiCurrentLib",
        "testables",
    ],
    libs: [
@@ -42,6 +40,21 @@ android_test {
    ],
}

android_test {
    name: "NetworkStackNextTests",
    srcs: [], // TODO: tests that only apply to the current, non-stable API can be added here
    test_suites: ["device-tests"],
    defaults: ["NetworkStackTestsDefaults"],
    static_libs: ["NetworkStackApiCurrentLib"],
}

android_test {
    name: "NetworkStackTests",
    test_suites: ["device-tests"],
    defaults: ["NetworkStackTestsDefaults"],
    static_libs: ["NetworkStackApiStableLib"],
}

// Additional dependencies of libnetworkstackutilsjni that are not provided by the system when
// running as a test application.
// Using java_defaults as jni_libs does not support filegroups.