diff options
author | 2025-03-04 18:35:57 -0500 | |
---|---|---|
committer | 2025-03-10 13:16:53 -0400 | |
commit | ed131a3117ee5dbafe44701a97ed643b1aa62420 (patch) | |
tree | 6c30f38d958f7509b2095586ffa44498e65ca115 | |
parent | e93b5715393a706841604c2fc4fce02281768ce7 (diff) |
Split up FrameworksUiServicesTests
This separates out non-zen notification tests and zen tests into individual test modules by filtering on the source files.
Fixes: 399685959
Bug: 398023814
Test: this
Flag: EXEMPT test rearrangement only
Change-Id: Id7b776bf9f3fcc790cbd06855dc9b94d884a8c7d
-rw-r--r-- | TEST_MAPPING | 6 | ||||
-rw-r--r-- | core/java/android/service/notification/TEST_MAPPING | 5 | ||||
-rw-r--r-- | services/core/java/com/android/server/notification/TEST_MAPPING | 5 | ||||
-rw-r--r-- | services/tests/uiservicestests/Android.bp | 83 | ||||
-rw-r--r-- | services/tests/uiservicestests/AndroidTest.xml | 1 | ||||
-rw-r--r-- | services/tests/uiservicestests/notification-tests.xml | 30 | ||||
-rw-r--r-- | services/tests/uiservicestests/notification-zen-tests.xml | 30 |
7 files changed, 144 insertions, 16 deletions
diff --git a/TEST_MAPPING b/TEST_MAPPING index e469f167d32f..ce0da7e21071 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -25,6 +25,12 @@ "name": "FrameworksUiServicesTests" }, { + "name": "FrameworksUiServicesNotificationTests" + }, + { + "name": "FrameworksUiServicesZenTests" + }, + { "name": "FrameworksInputMethodSystemServerTests_server_inputmethod" }, { diff --git a/core/java/android/service/notification/TEST_MAPPING b/core/java/android/service/notification/TEST_MAPPING index dc7129cde5e5..ea7ee4addbe6 100644 --- a/core/java/android/service/notification/TEST_MAPPING +++ b/core/java/android/service/notification/TEST_MAPPING @@ -4,7 +4,10 @@ "name": "CtsNotificationTestCases_notification" }, { - "name": "FrameworksUiServicesTests_notification" + "name": "FrameworksUiServicesNotificationTests" + }, + { + "name": "FrameworksUiServicesZenTests" } ], "postsubmit": [ diff --git a/services/core/java/com/android/server/notification/TEST_MAPPING b/services/core/java/com/android/server/notification/TEST_MAPPING index dc7129cde5e5..ea7ee4addbe6 100644 --- a/services/core/java/com/android/server/notification/TEST_MAPPING +++ b/services/core/java/com/android/server/notification/TEST_MAPPING @@ -4,7 +4,10 @@ "name": "CtsNotificationTestCases_notification" }, { - "name": "FrameworksUiServicesTests_notification" + "name": "FrameworksUiServicesNotificationTests" + }, + { + "name": "FrameworksUiServicesZenTests" } ], "postsubmit": [ diff --git a/services/tests/uiservicestests/Android.bp b/services/tests/uiservicestests/Android.bp index 66d7611a29c6..d34d74d80882 100644 --- a/services/tests/uiservicestests/Android.bp +++ b/services/tests/uiservicestests/Android.bp @@ -11,13 +11,8 @@ package { default_applicable_licenses: ["frameworks_base_license"], } -android_test { - name: "FrameworksUiServicesTests", - - // Include test java files - srcs: [ - "src/**/*.java", - ], +java_defaults { + name: "FrameworksUiServicesTests-defaults", static_libs: [ "compatibility-device-util-axt-minus-dexmaker", @@ -95,12 +90,72 @@ android_test { javacflags: ["-parameters"], } -test_module_config { - name: "FrameworksUiServicesTests_notification", - base: "FrameworksUiServicesTests", - test_suites: [ - "automotive-tests", - "device-tests", +// Utility files used by multiple tests +filegroup { + name: "shared-srcs", + srcs: [ + "src/android/app/ExampleActivity.java", + "src/android/app/NotificationSystemUtil.java", + "src/com/android/frameworks/tests/uiservices/DummyProvider.java", + "src/com/android/internal/logging/InstanceIdSequenceFake.java", + "src/com/android/server/UiServiceTestCase.java", + "src/com/android/server/notification/ZenChangeOrigin.java", + "src/com/android/server/notification/ZenModeEventLoggerFake.java", + ], + visibility: ["//visibility:private"], +} + +filegroup { + name: "notification-srcs", + srcs: [ + "src/**/Notification*.java", + "src/com/android/server/notification/*.java", + ], + visibility: ["//visibility:private"], +} + +filegroup { + name: "notification-zen-srcs", + srcs: [ + "src/android/app/NotificationManagerZenTest.java", + "src/com/android/server/notification/Zen*Test.java", + ], + visibility: ["//visibility:private"], +} + +android_test { + name: "FrameworksUiServicesTests", + + // Include test java files but not the notification & zen ones which are separated + srcs: [ + "src/**/*.java", + ], + + exclude_srcs: [ + ":notification-srcs", + ":notification-zen-srcs", + ], + + defaults: ["FrameworksUiServicesTests-defaults"], +} + +android_test { + name: "FrameworksUiServicesNotificationTests", + srcs: [ + ":notification-srcs", + ":shared-srcs", + ], + exclude_srcs: [":notification-zen-srcs"], + defaults: ["FrameworksUiServicesTests-defaults"], + test_config: "notification-tests.xml", +} + +android_test { + name: "FrameworksUiServicesZenTests", + srcs: [ + ":notification-zen-srcs", + ":shared-srcs", ], - exclude_annotations: ["androidx.test.filters.LargeTest"], + defaults: ["FrameworksUiServicesTests-defaults"], + test_config: "notification-zen-tests.xml", } diff --git a/services/tests/uiservicestests/AndroidTest.xml b/services/tests/uiservicestests/AndroidTest.xml index 11e8f090a8fa..93c8c72630f1 100644 --- a/services/tests/uiservicestests/AndroidTest.xml +++ b/services/tests/uiservicestests/AndroidTest.xml @@ -15,6 +15,7 @@ --> <configuration description="Runs Frameworks UI Services Tests."> <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup"> + <option name="cleanup-apks" value="true" /> <option name="test-file-name" value="FrameworksUiServicesTests.apk" /> </target_preparer> diff --git a/services/tests/uiservicestests/notification-tests.xml b/services/tests/uiservicestests/notification-tests.xml new file mode 100644 index 000000000000..acfd844efe26 --- /dev/null +++ b/services/tests/uiservicestests/notification-tests.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2025 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<configuration description="Runs Frameworks UI Services Tests (notifications subset)."> + <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup"> + <option name="cleanup-apks" value="true" /> + <option name="test-file-name" value="FrameworksUiServicesNotificationTests.apk" /> + </target_preparer> + + <option name="test-suite-tag" value="apct" /> + <option name="test-suite-tag" value="framework-base-presubmit" /> + <option name="test-tag" value="FrameworksUiServicesNotificationTests" /> + <test class="com.android.tradefed.testtype.AndroidJUnitTest" > + <option name="package" value="com.android.frameworks.tests.uiservices" /> + <option name="runner" value="android.testing.TestableInstrumentation" /> + <option name="hidden-api-checks" value="false"/> + </test> +</configuration> diff --git a/services/tests/uiservicestests/notification-zen-tests.xml b/services/tests/uiservicestests/notification-zen-tests.xml new file mode 100644 index 000000000000..01d8aab83d59 --- /dev/null +++ b/services/tests/uiservicestests/notification-zen-tests.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2025 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<configuration description="Runs Frameworks UI Services Tests (zen mode subset)."> + <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup"> + <option name="cleanup-apks" value="true" /> + <option name="test-file-name" value="FrameworksUiServicesZenTests.apk" /> + </target_preparer> + + <option name="test-suite-tag" value="apct" /> + <option name="test-suite-tag" value="framework-base-presubmit" /> + <option name="test-tag" value="FrameworksUiServicesZenTests" /> + <test class="com.android.tradefed.testtype.AndroidJUnitTest" > + <option name="package" value="com.android.frameworks.tests.uiservices" /> + <option name="runner" value="android.testing.TestableInstrumentation" /> + <option name="hidden-api-checks" value="false"/> + </test> +</configuration> |