- Feb 29, 2024
-
-
Jeff Sharkey authored
Many test authors are starting to use `CheckFlagsRule` across suites like CTS, so instead of recommending that they use `null` when on Ravenwood, offer them a clear behavior that is either "all-on" or "all-off". Eventually we'll explore providing default flag values on Ravenwood, but let's get something cleaner available now. Bug: 318841620 Test: ./frameworks/base/ravenwood/run-ravenwood-tests.sh Change-Id: Id234a375426fad38f64d3a999339bb720eae84bf
-
Jeff Sharkey authored
Ravenwood test authors should only need to call setServicesRequired() for the services they directly interact with, but often those services will have indirect dependencies on other OS internals, and those dependencies will evolve over time. To handle this, we add the concept of dependencies to SystemService, where a service declares the other services required to run. (They can choose to omit services from their dependencies where they gracefully handle a missing service at runtime.) Bug: 325506297 Test: atest RavenwoodServicesTest Change-Id: I42187b3494fef499d619ad882891e832b0fd6bca
-
- Feb 20, 2024
-
-
Jeff Sharkey authored
One of our eventual goals with Ravenwood is to support usage of system services from test code. Robolectric takes the approach of publishing "shadows" which are effectively fakes of the Manager objects visible to app processes, and it unfortunately doesn't offer a mechanism to run "real" services code. In contrast, Ravenwood aims to support API owners progressively offering their system services either via a "fake" approach, or by using various levels of the "real" code that would run on a device. This change wires up the foundational support and uses the simple `SerialManager` example to demonstrate using the same "real" code on both Ravenwood and devices. It also demonstrates the `Internal` pattern being used to customize behavior for tests. To offer as hermetic as a test environment as possible, we start new instances of each requested service for each test. Requiring developers to be explicit about the services they need will help keep overhead low, especially for tests that don't need services. Bug: 325506297 Test: atest RavenwoodServicesTest Change-Id: Ie22436b38f2176f91dfce746b899ebab7752bbb8
-
- Feb 16, 2024
-
-
Makoto Onuki authored
Enable android.util.Log's native code Test: ./ravenwood/run-ravenwood-tests.sh Bug: 318393625 Change-Id: I0ec607586d71b1cc34b71db67249e110edc304df
-
- Feb 13, 2024
-
-
Makoto Onuki authored
- Also make sure framework-minus-apex is prioritized - Also some build rule cleanup Bug: 315031371 Test: ./ravenwood/run-ravenwood-tests.sh Change-Id: I2d0eb822517abfc17f351810a53176ad9904f908
-
- Feb 12, 2024
-
-
Jeff Sharkey authored
We had temporarily been using the binary XML implementation in all situations, but this change brings in the existing `kxml2-android` library to offer reading/writing of human-readable XML. We also use the upstream SAX parser to offer an event-based parser. In all cases we carefully keep the existing XML libraries in place untouched on physical devices to avoid regressions. Bug: 324417456 Test: atest CtsUtilTestCasesRavenwood Test: atest FrameworksCoreTestsRavenwood Test: atest FrameworksUtilTestsRavenwood Change-Id: I2effc7fca5c586968658073f9652d13cf50a2c66
-
- Jan 29, 2024
-
-
Jeff Sharkey authored
Common test utilities like `TestableLooper` rely on being able to drive `Looper` interactions via `TestLooperManager` which can only be obtained via `Instrumentation`. This change integrates with the common `InstrumentationRegistry` library which is how most tests obtain their `Instrumentation` instance. We play an odd dance with `java_host_for_device` and `java_device_for_host` to get a version of `androidx.test.monitor` that we can link against our runtime. (The build system otherwise gets excited that we're trying to compile an Android-linked library into what appears to be a Java-linked library, but we know that we're offering the Android runtime.) Fix subtle bug in `MessageQueue_host` where a requested wake might race with the `for (;;)` loop in `MessageQueue.next()`; if a wake is pending, it's a valid reason to return from `nativePollOnce()`. Add timeout logic to `RavenwoodRuleImpl` which can be enabled to dump all our stack traces just before Tradefed times out, to aid in debugging deadlocks; disabled by default. Bug: 319647875 Test: atest SystemUiRoboTests Test: atest SystemUiRavenTests Test: atest FrameworksCoreTestsRavenwood:TestLooperManagerTest Change-Id: I13605d32df0c3e6758f541d5e75a6bdaf44368db
-
- Nov 22, 2023
-
-
Makoto Onuki authored
Bug: 292141694 Test: atest CtsUtilTestCasesRavenwood Change-Id: I4068c227b4d42b34d2a7e1e5da2032a870b3cfc2
-
- Nov 16, 2023
-
-
Jeff Sharkey authored
Some CTS tests desire to link against `test_current` to prove to themselves that they're not touching hidden APIs. This means if they also want to use our `ravenwood-junit` rules, that dependency also needs to link against `test_current`. Since we're reaching down into plenty of hidden details when we're actually running on a Ravenwood runtime, we split into a `stub` and an `impl` library, so that we give a cleanly compiling library to to clients, which is then replaced under the Ravenwood runtime. Bug: 292141694 Test: atest-dev CtsTextTestCasesRavenwood CtsTextTestCases Change-Id: I96dbc9643324a7853a992e97b51a88f70eb721f3
-
- Nov 15, 2023
-
-
Jeff Sharkey authored
We have the XML interfaces from libcore, but the implementations there are tied closely to things like StringPool. We thankfully have our own human-readable XML serializer that we could use, but there's unfortunately not a good pull parser. To get us unstuck for the moment, pivot the internals to unconditionally use the binary XML format, which at least we know is thoroughly tested, and any data written through this path can then also be parsed. This is enough to support PersistableBundle, and we'll circle back to get ourselves a human-readable XML implementation in the future. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases Change-Id: I875a3a2b0e95e52861afe187e2a5e9f1e740d8d5
-
- Nov 13, 2023
-
-
Jeff Sharkey authored
The Ravenwood environment doesn't support IPC, but much of the code that developers intend to test (such as AIDL stubs) still relies on baseline same-process behavior to be intact. This change adds UID and PID support to Process and Binder, but we carefully communicate that it's only available when the test author has configured it via a RavenwoodRule. This ensures that tests don't accidentally rely on unexpected defaults, as some tests will want AID_SYSTEM, and others want a normal app UID. Also bring along SystemClock, PatternMatcher, and ParcelUuid along with relevant tests. Finally, now that we have an IgnoreUnderRavenwood annotation, we can pivot back our default failure to be a RuntimeException instead of an AssumptionViolatedException. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases Change-Id: I5f54c3179b2d305b9ab9144c43fd063c6b756e44
-
- Nov 10, 2023
-
-
Makoto Onuki authored
Also add some presubmit tests as a smoke test. Bug: 292141694 Test: run-all-tests.sh Test: atest --no-bazel-mode CtsUtilTestCasesRavenwood Change-Id: I30569313b764dfa30db9c2c5627050da4a6a1d67
-
- Nov 08, 2023
-
-
Jeff Sharkey authored
We have baseline implementations of the Parcel and Bundle, so we're ready to support them under the Ravenwood environment. Brings along the relevant CTS to prove that it works consistently on both devices and Ravenwood. Make a few test-driven bug fixes to Parcel code. Currently does not support FDs or Binders. Add new `@IgnoreUnderRavenwood` annotation that is respected by a new `RavenwoodRule`, letting the same test code be shared to run under both devices and Ravenwood. Currently packaged under our own area of the tree, but named to match layout of `platform_testing` for future migration. Add "ThrowClass" policy. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases:ParcelTest CtsOsTestCases:BundleTest Change-Id: I88d19afff47fbea6557e922a10e8555ee0f70ba3
-
- Oct 31, 2023
-
-
Anton Hansson authored
Soong uses the directory structure to guess the java package, and "annotations-src" is not a package considered for APIs. Remove the prefix such that soong sees the correct package android.*. Hide the Ravenwood classes for now. Test: m checkapi Change-Id: I430009deb7df2beac1736c4a68ff6fa1a3be572a
-
- Oct 09, 2023
-
-
Makoto Onuki authored
- Add "framework-minus-apex.ravenwood". - Update the behavior of: --default-throw: - Now this will "keep" the subject classes and fields. - When a 'throw' directive is specified on a static initializer, it's now handled as 'keep', because otherwise the class wouldn't be usable. Test: ./scripts/run-all-tests.sh Test: m framework-minus-apex.ravenwood Bug: 292141694 Change-Id: If4d650dc175a5a78cf8844dfed2217c19f2d5790
-