diff options
author | Ronald Braunstein <rbraunstein@google.com> | 2024-03-20 15:47:18 -0700 |
---|---|---|
committer | Ronald Braunstein <rbraunstein@google.com> | 2024-03-26 03:51:33 +0000 |
commit | f74ed57e846fdc117e55c14231c6f31f6cedd6f8 (patch) | |
tree | 62ca408a3436d803c8c7876753c72745050b3e71 | |
parent | 9fe168541cebc6bb7f55e7f4e9116c6bad841bde (diff) | |
download | base-f74ed57e846fdc117e55c14231c6f31f6cedd6f8.tar.gz |
Migrate options in TEST_MAPPING -> Android.bp
This is the first of several cls to start the migration of options in
TEST_MAPPING files to being specified in Android.bp files.
The overall goal is to get local (atest) runs closer to CI runs of the
tests.
These all have FrameworksServicesTests as the base test and all
TEST_MAPPING files to refer to these new test modules reside under this
(servictests) directory.
Step 1) Introduce new modules and list them in TEST_MAPPING postsubmit
Step 2) Wait a week for SLO checker to accept the new modules.
Step 3) Replace current presubmit TEST_MAPPING entries with the module
names.
This second CL will be part of the same topic, which will also run in
presubmit ...
Later steps will ensure that if new options are added to these
TEST_MAPPING files, they will get converted too, but nothing is
preventing that yet.
This was hand-crafted cl, not using the migration script yet.
I am starting with one directory that has several TEST_MAPPING files
below and converting them all, thus 10 new modules instead of 1 or 2.
Migration Plan Doc: https://docs.google.com/document/d/1x3w-BvKO3E-GbY8YOSBuzJC6-pkLkuhfjSyZ1hJQBYM/edit?tab=t.0#heading=h.17wg41voij6q
For these tests, the out dir increases by 1.7 Gig (total for all them).
From: ~/aosp-main-with-phones/frameworks/base/services/tests/servicestests
Ran atest and verified the test that ran matched the new filters.
Test: atest --test-mapping src/com/android/server/contentcapture:postsubmit
Test: atest --test-mapping src/com/android/server/contentprotection:postsubmit
Test: atest --test-mapping src/com/android/server/location/contexthub:postsubmit
Test: atest --test-mapping src/com/android/server/om:postsubmit
Test: atest --test-mapping src/com/android/server/os:postsubmit
Test: atest --test-mapping src/com/android/server/pm:postsubmit
# 4 postsubmit tests fail, but there were already failing
Test: atest --test-mapping src/com/android/server/recoverysystem:postsubmit
Change-Id: I6e793d8c8fb1efb3b990466ea409a3cf1bf53434
8 files changed, 129 insertions, 15 deletions
diff --git a/services/tests/servicestests/Android.bp b/services/tests/servicestests/Android.bp index fad8115be7e3..c333eb7eed46 100644 --- a/services/tests/servicestests/Android.bp +++ b/services/tests/servicestests/Android.bp @@ -255,3 +255,89 @@ java_genrule { "done && " + "$(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res", } + +FLAKY_AND_IGNORED = [ + "androidx.test.filters.FlakyTest", + "org.junit.Ignore", +] +// Used by content protection TEST_MAPPING +test_module_config { + name: "FrameworksServicesTests_contentprotection", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_filters: ["com.android.server.contentprotection"], + exclude_annotations: FLAKY_AND_IGNORED, +} + +test_module_config { + name: "FrameworksServicesTests_om", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_filters: ["com.android.server.om."], + exclude_annotations: FLAKY_AND_IGNORED, +} + +// Used by contexthub TEST_MAPPING +test_module_config { + name: "FrameworksServicesTests_contexthub_presubmit", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_filters: ["com.android.server.location.contexthub."], + // TODO(ron): are these right, does it run anything? + include_annotations: ["android.platform.test.annotations.Presubmit"], + exclude_annotations: FLAKY_AND_IGNORED, +} + +test_module_config { + name: "FrameworksServicesTests_contexthub_postsubmit", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_filters: ["com.android.server.location.contexthub."], + // TODO(ron): are these right, does it run anything? + include_annotations: ["android.platform.test.annotations.Postsubmit"], + exclude_annotations: FLAKY_AND_IGNORED, +} + +// Used by contentcapture +test_module_config { + name: "FrameworksServicesTests_contentcapture", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_filters: ["com.android.server.contentcapture"], + exclude_annotations: FLAKY_AND_IGNORED, +} + +test_module_config { + name: "FrameworksServicesTests_recoverysystem", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_filters: ["com.android.server.recoverysystem."], + exclude_annotations: ["androidx.test.filters.FlakyTest"], +} + +// server pm TEST_MAPPING +test_module_config { + name: "FrameworksServicesTests_pm_presubmit", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_annotations: ["android.platform.test.annotations.Presubmit"], + include_filters: ["com.android.server.pm."], + exclude_annotations: FLAKY_AND_IGNORED, +} + +test_module_config { + name: "FrameworksServicesTests_pm_postsubmit", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_annotations: ["android.platform.test.annotations.Postsubmit"], + include_filters: ["com.android.server.pm."], + exclude_annotations: FLAKY_AND_IGNORED, +} + +// server os TEST_MAPPING +test_module_config { + name: "FrameworksServicesTests_os", + base: "FrameworksServicesTests", + test_suites: ["general-tests"], + include_filters: ["com.android.server.os."], +} diff --git a/services/tests/servicestests/src/com/android/server/contentcapture/TEST_MAPPING b/services/tests/servicestests/src/com/android/server/contentcapture/TEST_MAPPING index 0ffa891ce3e1..dae8f932cb91 100644 --- a/services/tests/servicestests/src/com/android/server/contentcapture/TEST_MAPPING +++ b/services/tests/servicestests/src/com/android/server/contentcapture/TEST_MAPPING @@ -14,5 +14,11 @@ } ] } + ], + "postsubmit": [ + { + // b/331020193, Move to presubmit early april 2024 + "name": "FrameworksServicesTests_contentcapture" + } ] } diff --git a/services/tests/servicestests/src/com/android/server/contentprotection/TEST_MAPPING b/services/tests/servicestests/src/com/android/server/contentprotection/TEST_MAPPING index 419508ca5e17..32729a899a96 100644 --- a/services/tests/servicestests/src/com/android/server/contentprotection/TEST_MAPPING +++ b/services/tests/servicestests/src/com/android/server/contentprotection/TEST_MAPPING @@ -14,5 +14,11 @@ } ] } + ], + "postsubmit": [ + { + // b/331020193, Move to presubmit early april 2024 + "name": "FrameworksServicesTests_contentprotection" + } ] } diff --git a/services/tests/servicestests/src/com/android/server/location/contexthub/TEST_MAPPING b/services/tests/servicestests/src/com/android/server/location/contexthub/TEST_MAPPING index 6035250500ec..dc8f934ff9e5 100644 --- a/services/tests/servicestests/src/com/android/server/location/contexthub/TEST_MAPPING +++ b/services/tests/servicestests/src/com/android/server/location/contexthub/TEST_MAPPING @@ -20,12 +20,18 @@ ], "postsubmit": [ { + // b/331020193, Move to presubmit early april 2024 + "name": "FrameworksServicesTests_contexthub_presubmit" + }, + { "name": "FrameworksServicesTests", "options": [ { "include-filter": "com.android.server.location.contexthub." }, { + // I believe this include annotation is preventing tests from being run + // as there are no matching tests with the Postsubmit annotation. "include-annotation": "android.platform.test.annotations.Postsubmit" }, { diff --git a/services/tests/servicestests/src/com/android/server/om/TEST_MAPPING b/services/tests/servicestests/src/com/android/server/om/TEST_MAPPING index 558e2591161c..41c4383a0bec 100644 --- a/services/tests/servicestests/src/com/android/server/om/TEST_MAPPING +++ b/services/tests/servicestests/src/com/android/server/om/TEST_MAPPING @@ -16,5 +16,11 @@ } ] } + ], + "postsubmit": [ + { + // b/331020193, Move to presubmit early april 2024 + "name": "FrameworksServicesTests_om" + } ] } diff --git a/services/tests/servicestests/src/com/android/server/os/TEST_MAPPING b/services/tests/servicestests/src/com/android/server/os/TEST_MAPPING index 5a46f8c4beea..06e7002924a7 100644 --- a/services/tests/servicestests/src/com/android/server/os/TEST_MAPPING +++ b/services/tests/servicestests/src/com/android/server/os/TEST_MAPPING @@ -8,5 +8,11 @@ } ] } + ], + "postsubmit": [ + { + // b/331020193, Move to presubmit early april 2024 + "name": "FrameworksServicesTests_os" + } ] } diff --git a/services/tests/servicestests/src/com/android/server/pm/TEST_MAPPING b/services/tests/servicestests/src/com/android/server/pm/TEST_MAPPING index 85a73bb22009..f4e724f493c5 100644 --- a/services/tests/servicestests/src/com/android/server/pm/TEST_MAPPING +++ b/services/tests/servicestests/src/com/android/server/pm/TEST_MAPPING @@ -20,21 +20,13 @@ ], "postsubmit": [ { - "name": "FrameworksServicesTests", - "options": [ - { - "include-filter": "com.android.server.pm." - }, - { - "include-annotation": "android.platform.test.annotations.Postsubmit" - }, - { - "exclude-annotation": "androidx.test.filters.FlakyTest" - }, - { - "exclude-annotation": "org.junit.Ignore" - } - ] + // Presubmit is intentional here while testing with SLO checker. + // b/331020193, Move to presubmit early april 2024 + "name": "FrameworksServicesTests_pm_presubmit" + }, + { + // Leave postsubmit here when migrating + "name": "FrameworksServicesTests_pm_postsubmit" } ] } diff --git a/services/tests/servicestests/src/com/android/server/recoverysystem/TEST_MAPPING b/services/tests/servicestests/src/com/android/server/recoverysystem/TEST_MAPPING index e9d8b2e709e7..7e7393c3a822 100644 --- a/services/tests/servicestests/src/com/android/server/recoverysystem/TEST_MAPPING +++ b/services/tests/servicestests/src/com/android/server/recoverysystem/TEST_MAPPING @@ -11,5 +11,11 @@ } ] } + ], + "postsubmit": [ + { + // b/331020193, Move to presubmit early april 2024 + "name": "FrameworksServicesTests_recoverysystem" + } ] }
\ No newline at end of file |