- Feb 12, 2024
-
-
Makoto Onuki authored
Add a bivalent test that uses a native library. Also added a utility method to load it in the same way on both sides. Bug: 318393625 Bug: 323931246 Test: run-ravenwood-tests.sh Test: atest RavenwoodBivalentTest_device Change-Id: I270058c15f718ff20640681742035e33e5e015a1
-
Makoto Onuki authored
Also add a bivalent test. Test: atest RavenwoodBivalentTest && atest RavenwoodBivalentTest_device Bug: 292141694 Change-Id: I10f258e62e8a7f6a85fad5b39eda27c397e08f55
-
- Feb 10, 2024
-
-
Makoto Onuki authored
Test: atest RavenwoodMockitoTest && atest RavenwoodMockitoTest_device Bug: 310268946 Change-Id: I969847f757cbc21e553d7cb1157d5127301f9d10
-
- Feb 09, 2024
-
-
Dmitri Plotnikov authored
Bug: 314797745 Test: atest PowerStatsTestsRavenwood PowerStatsTests FrameworksCoreTests Change-Id: I24bfe2e5c587e9547411ce5165d2fdd4c47b0e2b
-
- Feb 08, 2024
-
-
Jeff Sharkey authored
We've uncovered several utilities that temporarily clear any read/write thread policies. Instead of making them all side-step their StictMode interactions on Ravenwood, this change offers just enough of a baseline implementation to support them; it doesn't actually offer to detect anything. Bug: 318833612 Test: atest FrameworksCoreTestsRavenwood Change-Id: I5e406e24fcd5e83d108006ca6c7d08c0534297a9
-
Jeff Sharkey authored
One of the final foundational building blocks, which wraps a Java `FileDescriptor` object. Since many of the existing APIs here offer to work with "raw" int FD values, we need to reach "behind the curtain" to read/write the internal value. Thankfully `SharedSecrets` already offers a way to gain access without requiring us to open up the entire `java.io` area of the `java.base` module. Bring along `android.util.CloseGuard` as a no-op wrapper. Bug: 324417456 Test: atest CtsOsTestCasesRavenwood Change-Id: I8cffacf96d94aea2d40d75055a2411717e0c1bcf
-
Jeff Sharkey authored
These are lightweight holder objects, so they're prime candidates for inclusion on Ravenwood. Also enables `BroadcastRecordTest` on Ravenwood too. Bring CTS to verify we're in sync with devices, and split dynamic integration tests into a separate file to avoid complex dependency build rules. Bug: 324417456 Test: atest CtsAppTestCasesRavenwood Test: atest CtsAppTestCases:ActivityOptionsTest Test: atest CtsAppTestCases:BroadcastOptionsTest Test: atest CtsAppTestCases:BroadcastOptionsIntegrationTest Change-Id: I5b496b4d212a3504d8ce56faf0ffe34998dfbae9
-
Makoto Onuki authored
Test: ./ravenwood/run-ravenwood-tests.sh Test: Treehugger Bug: 324433654 Change-Id: I68048479b15f26b1e9248a90b20de16016f47ef9
-
Dmitri Plotnikov authored
Bug: 314797745 Test: atest PowerStatsTestsRavenwood PowerStatsTests FrameworksCoreTests Change-Id: I32215fa8e6bc0591e5cd2fa10ecdb62d12726d5d
-
- Feb 02, 2024
-
-
Zhi Dou authored
ravenwood should use the SetFlagsRule.DefaultInitValueType.NULL_DEFAULT in the constructor of SetFlagsRule. Since ravenwood tests are executed on the host, SetFlagsRule should initialize the flag value to NULL, instead of reading from the device. Test: N/A Bug: N/A Change-Id: I75828fe92bf1a9ca2ea708a66a348f5f569cea7a
-
Jeff Sharkey authored
It's uncovering existing failures that need to be chased elsewhere. Bug: 323438048 Test: TH Change-Id: Ife5bb2d72b1a575c3a11d2486e73dd210403d77a
-
- Feb 01, 2024
-
-
Makoto Onuki authored
A lot of ravenwood tests (and other tests too) use the deprecated test runner androidx.test.runner.AndroidJUnit4, but it actually has problems. We should switch them to androidx.test.ext.junit.runners.AndroidJUnit4. However, simply updating all tests could be problematic because: - we need to update the build rules and add "androidx.test.ext.junit" as a static dependency, which is probably safe but it could cause class conflicts.(?) - More importantly, the subtle difference between the test runner could make the device side test fail. So I'm going to do it in two steps: - Step 1 -- this CL: Add an optional validator to RavenwoodTest, which can be enabled with RAVENWOOD_OPTIONAL_VALIDATION=1. This makes a test fail if it's using the deprecated one. - Added a test for this - Added a script to replace the test runner. Test: run-ravenwood-tests Test: RAVENWOOD_OPTIONAL_VALIDATION=1 atest RavenwoodCoreTest Bug: 317131861 Change-Id: I5762bd097c3a529ae6e14460d9e326ed5c6086b4
-
Jeff Sharkey authored
Some tests rely on reporting failures from another thread; upstream JUnit quietly eats these exceptions, which can result in misleading "pass" signals when migrating existing tests. To match the behavior of a physical Android device, we now monitor for uncaught exceptions and report them as test failures. Some tests are relying on `ActivityManager` static methods, so offer those on Ravenwood. Leaves "current user" as `USER_SYSTEM` for the moment, but we'll likely think more about how to customize it as part of bringing a real `ActivityManager` online. Some tests rely on `VibrationAttributes` which is a basic holder object, so offer it on Ravenwood. Tests to verify all of above. Bug: 319647875 Test: atest SystemUiRoboTests Test: atest SystemUiRavenTests Change-Id: I1bc5bbc7b4eadf1c6d19c0044012a945ce377a20
-
- Jan 31, 2024
-
-
Makoto Onuki authored
- Remove the "mockito_ravenwood" module, which is based on mockito ver 2, now that we use the robo version of mockito (ver 4). - Remove the use of the deprecated mockito API, which is not supported by mockito ver 4. - Add a test for mocking final class. - Remove the stale MD file about mockito. Bug: 310268946 Test: ./run-ravenwood-tests.sh Change-Id: I236661df47f40e0b05805156908e58ff0d2ae535
-
- Jan 30, 2024
-
-
Jeff Sharkey authored
There are some tests triggering `wtf()` during the normal course of operation, and we haven't been able to reproduce them yet. This change gives us a valid `wtf()` implementation to aid debugging. It's also a bit jarring to have log-style messages interleaved with raw `System.out`, so also add `redirectLogStreams()` to match the logging behavior that developers observe on physical devices. Bug: 322805216 Test: atest FrameworksCoreTestsRavenwood FrameworksUtilTestsRavenwood Change-Id: I8ea2d12638cd998e3962aaa8af09a3335fcd0d51
-
Jeff Sharkey authored
Bug: 319647875 Test: manual Change-Id: I51e707c20f66d83056d0e2e31a9850cd5db87159
-
Jeff Sharkey authored
Emit "TestRunner" log messages around each test method, so that our local debugging logs match what developers experience with tests run on a physical device. Refine `onThrowMethodCalled()` message to be more descriptive about Ravenwood and link to docs. Bug: 322817109, 322526754 Test: atest FrameworksCoreTestsRavenwood Change-Id: Id9f6a936145dd2024295c2eb14666fc43a5c7e34
-
- 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
-
Makoto Onuki authored
A regex in $RAVENWOOD_REALLY_DISABLE is used as an "exclude" filter. If the regex partial-matches the test full name (class name, or class name + "#" + method name), we skip it. Test: RAVENWOOD_RUN_DISABLED_TESTS=1 RAVENWOOD_REALLY_DISABLE='\.CustomTileDefaultsRepositoryTest' atest SystemUiRavenTests and make sure CustomTileDefaultsRepositoryTest is skipped. Bug: 319646274 Change-Id: Id98871aaea6d32e134f84b745f3eae7c9f27931f
-
- Jan 27, 2024
-
-
Makoto Onuki authored
Test: RAVENWOOD_RUN_DISABLED_TESTS=1 atest RavenwoodMockitoTest Without removing @IgnoreUnderRavenwood Bug: 319646274 Change-Id: Ibd80ca5931f500498a1aaa2c18b6209586a82653
-
- Jan 26, 2024
-
-
Jeff Sharkey authored
Some tests interact with yet-unsupported APIs under Ravenwood in their test class constructors, and `RavenwoodRule` arrives too late to effectively apply annotations like `@IgnoreUnderRavenwood`. This change adds `RavenwoodClassRule` which can be marked as an `@ClassRule` so that it runs in a static context before each test class is constructed, giving it a chance to respect annotations. We also adjust our annotation naming to match the naming style in JUnit Jupiter, which has annotations like `DisabledOnJre` and `EnabledOnOs`. Bug: 319647875 Test: atest SystemUiRoboTests Test: atest SystemUiRavenTests Change-Id: I7d834b8e74e961bb3d4befcad6204d99f8fe80e9
-
- Jan 24, 2024
-
-
Jeff Sharkey authored
SysUI code relies on the straightforward Flags and UserInfo classes, and working around them in SysUI would be quite disruptive, so this change supports them under Ravenwood, along with tests to confirm their behavior. Bug: 319647875 Test: atest FrameworksCoreTestsRavenwood Change-Id: I9f8bcf711a39b15a9aff457a8afe2a601e64eafd
-
Jeff Sharkey authored
SysUI code relies on the straightforward Singleton, DisplayInfo, and PinResult classes, and working around them in SysUI would be quite disruptive, so this change supports them under Ravenwood, along with tests to confirm their behavior. Bug: 319647875 Test: atest FrameworksCoreTestsRavenwood Change-Id: Iea091bb09f6df9f8b23593871a805646a215ac0a
-
Jeff Sharkey authored
SysUI code relies on the tracing APIs, which are often used for investigating performance-sensitive operations on physical devices. As this tracing information is less useful under the Ravenwood environment, we offer a baseline no-op implementation to support existing code. (There are no APIs to "read back" tracing information for a test to inspect, which is another reason it's okay to no-op for now.) Bug: 319647875 Test: atest FrameworksCoreTestsRavenwood Change-Id: I52865d7da4c38d350edc7e9dc0239fc1b130048d
-
Jeff Sharkey authored
SysUI code heavily relies on utility classes under the `logging` internal package, which are pretty straightforward. This change enables them under Ravenwood, along with tests to confirm. Some of the foundational interfaces have been moved to modules-utils, which isn't yet configured to support our Ravenwood annotations, so we use hard-coded policies. Bug: 319647875 Test: atest FrameworksCoreTestsRavenwood Change-Id: I7e670d31e89a0be741df1c118ecc19c91a24d8fb
-
Jeff Sharkey authored
One of our final missing pieces of foundational functionality is the SystemProperties key/value store. Over the years, this key/value store has been (ab)used to configure very obscure parts of the OS. As tempting as it might be to simply let code rely on default return values when a key is undefined, we'd like to ensure that code owners carefully confirm any assumed behaviors. To accomplish this, we default to blocking both read/write access to keys until their use has been explicitly audited. Based on our guiding principles, as code owners support their APIs under Ravenwood, they're expected to bring along all relevant tests, which will uncover SystemProperties usage that needs triage, reducing the risk of downstream clients uncovering that usage. Tests can explicitly allow read/write access to specific properties via their RavenwoodRule.Builder definition, which is also how we ensure that all values are consistently reset between tests. Bug: 319647875 Test: atest FrameworksCoreSystemPropertiesTestsRavenwood Test: atest FrameworksCoreTestsRavenwood CtsOsTestCasesRavenwood Change-Id: I6510e06c33ee8b2bf31b58f35faa07127ecd16b7
-
- Jan 17, 2024
-
-
Jeff Sharkey authored
For some large suites that are migrating into Ravenwood, it can be helpful to have annotations that can selectively include/exclude tests at both the method and class level. To support this, we add new `Include` and `Exclude` annotations that are named to be symmetric. We continue supporting the existing `IgnoreUnderRavenwood` annotation as being equal to `ExcludeUnderRavenwood`, as `Ignore` can be more descriptive and self-documenting to typical JUnit users. Bug: 319647875 Test: atest SystemUiRavenTests Change-Id: Idf8f836a0f48e61f24dd32dbd8e8cd822b3b6b25
-
- Jan 09, 2024
-
-
Dmitri Plotnikov authored
Bug: 314797745 Test: atest PowerStatsTestsRavenwood Test: atest PowerStatsTests Change-Id: Ib16b999ea1d21d6f887e6b4aba6ae8dcbc7c0451
-
- Jan 08, 2024
-
-
Makoto Onuki authored
This allows AOSP changes to have `@IgnoreUnderRavenwood` equivalent until the annotations are availabe in AOSP. Bug: 292141694 Test: atest RavenwoodMinimumTest Change-Id: Id1d5a879eb7e31bb99911aae16bdf093c1c93c6e
-
- Dec 21, 2023
-
-
Makoto Onuki authored
Test: atest-dev CtsOsTestCasesRavenwood Bug: 292141694 Change-Id: I9fa7548d55861d043a89539ffe70506bb46dd9b7
-
- Dec 15, 2023
-
-
Dmitri Plotnikov authored
Bug: 314797745 Test: atest FrameworksCoreTestsRavenwood Test: atest FrameworksCoreTests Change-Id: I118b6ba36bdc85d5b712aed0f0e80bb9a9fc3125
-
- Dec 12, 2023
-
-
Jeff Sharkey authored
As test authors onboard their bivalent tests, they'll be using the `@IgnoreUnderRavenwood` annotation to quietly ignore tests that don't currently have enough Ravenwood support to run. However, over time the Ravenwood environment will continue to gain new functionality, and we'd like an easy way to "probe" those previously-ignored tests to see if any of them started passing. This change implements this using a locally-configured flag that unconditionally runs all tests under Ravenwood, and reports failures for any tests marked as `@IgnoreUnderRavenwood` that are now passing. (As these "failures" might be confusing for normal test authors, we leave it disabled by default in the build, and leave it for internal Ravenwood maintainers.) To confirm this works, implement two new methods on Parcel, and detect the relevant tests that started passing. Bug: 292141694 Test: atest CtsUtilTestCasesRavenwood CtsUtilTestCases Change-Id: Ied2a5e3d1781c76a4f3506192d015309f2f424b2
-
- Dec 11, 2023
-
-
Jeff Sharkey authored
* Highlight temporary strategies for JNI. * Clarify current `TEST_MAPPING` status. * Mention `@IgnoreUnderRavenwood` support at class level. * Mention strategy for bivalent tests using resources. * Concrete example of temporary directory. Bug: 292141694 Test: atest CtsUtilTestCasesRavenwood CtsUtilTestCases Change-Id: If0903296697049d248c50ab46b01b273aab26c9f
-
Dmitri Plotnikov authored
Bug: 314797745 Test: atest PowerStatsTestsRavenwood Test: atest PowerStatsTests Change-Id: I4af6e9c532285dc935f6d2156cc9cb3531d9aeaa
-
- Dec 08, 2023
-
-
Jeff Sharkey authored
Tests for these internal utils are local within the frameworks/base/ repo, instead of in CTS. To help future-proof, bring the entire os/* test directory by default into the Ravenwood suites, and give developers the way to easily opt-out with @IgnoreUnderRavenwood at the class level. Bug: 292141694 Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests Change-Id: Ia3c72c22fb3ebc8cfec7a4f9811b7e27a783e885
-
Dmitri Plotnikov authored
Bug: 314797745 Test: atest PowerStatsTestsRavenwood Test: atest PowerStatsTests Change-Id: I28f823608041cc7606bd848f3618c9c0ae5adace
-
- Dec 07, 2023
-
-
Jeff Sharkey authored
Since feature flags are becoming an important part of development work, ensure that Ravenwood tests can use existing tools such as `SetFlagsRule` to populate values for code-under-test to consume. To enable this, we extend `AndroidHeuristicsFilter` to recognize feature flags generated code, and include that in the Ravenwood environment by default. Bug: 311370221 Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests Change-Id: I526af65f816d153cb6e365cf6810a5a304d3e6a6
-
Jeff Sharkey authored
This change demonstrates a moderately complex test of a specific system service, in this case `UriGrantsManagerService`. Bug: 292141694 Test: atest FrameworksServicesTestsRavenwood FrameworksServicesTests Change-Id: Ia16632f2c9a1e24deb9c1320fdbb1c099e3d74c3
-
- Dec 06, 2023
-
-
Jeff Sharkey authored
Tests for these internal utils are local within the frameworks/base/ repo, instead of in CTS. To help future-proof, bring the entire utils/* test directory by default into the Ravenwood suites, and give developers the way to easily opt-out with @IgnoreUnderRavenwood at the class level. Bug: 292141694 Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests Test: atest FrameworksUtilTestsRavenwood FrameworksUtilTests Change-Id: Ibcabec764efa31cc8cb4c56d7815948d4029aaea
-
- Dec 05, 2023
-
-
Jeff Sharkey authored
Tests for these internal utils are local within the frameworks/base/ repo, instead of in CTS. To help future-proof, bring the entire utils/* test directory by default into the Ravenwood suites, and give developers the way to easily opt-out with @IgnoreUnderRavenwood at the class level. Bug: 292141694 Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests Test: atest FrameworksUtilTestsRavenwood FrameworksUtilTests Change-Id: I5251dca752396faa77774659d0923d8cdb719830
-