Skip to content
Snippets Groups Projects
  1. May 23, 2024
    • Makoto Onuki's avatar
      [Ravenwood] Internal clean up, more PFD APIs, OsConstants, etc · df9cd260
      Makoto Onuki authored
      - Support a few more ParcelFileDescriptor APIs.
      - Support OsConstants and a couple of Os APIs.
      
      - Also clean up f/b/ravenwood. Now we have "runtime-common" library
        that can be used from different components of Ravenwood infra,
        with native code support.
      
      Bug: 292141694
      Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
      Test: CtsOsTestCases (on tree hugger)
      Flag: EXEMPT hostside test change only
      Change-Id: I259a04201e05e615e17da0529cb500a102887ec9
      df9cd260
  2. May 14, 2024
  3. May 10, 2024
    • Makoto Onuki's avatar
      [Ravenwood] Rename all-updatable-modules-system-stubs · d8231fe0
      Makoto Onuki authored
      all-updatable-modules-system-stubs is a stub, so it should be included
      at the end, to avoid overriding real implementation.
      
      Bug: 292141694
      Test: ./ravenwood/scripts/run-ravenwood-tests.sh
      Test: run `m` and make sure out/host/linux-x86/testcases/ravenwood-runtime
        doesn't have the un-renamed jar file.
      Change-Id: I474f46b7e0844e5a887914226e5388bdf9486eb7
      d8231fe0
  4. May 07, 2024
    • Makoto Onuki's avatar
      [Ravenwood] Tweak build files · dfade847
      Makoto Onuki authored
      ... to allow other modules to refer to the text
      files.
      
      Bug: 292141694
      Test: ./scripts/run-all-tests.sh
      
      Change-Id: I46f0c0e238a6d7f8dc1a30cf111296a529c83664
      dfade847
  5. May 01, 2024
    • Makoto Onuki's avatar
      [Ravenwood] Support NativeAllocationRegistry · aedf30b7
      Makoto Onuki authored
      We don't track native allocation size, but we still need to
      release native allocations.
      
      Bug: 337110712
      Test: atest RavenwoodBivalentTest
      Test: atest RavenwoodBivalentTest_device
      Test: ./ravenwood/scripts/run-ravenwood-tests.sh
      Change-Id: Ia50c963731a26fc951a8040cbf353a5c56505b6a
      aedf30b7
  6. Apr 25, 2024
  7. Apr 02, 2024
  8. Mar 28, 2024
  9. Mar 27, 2024
  10. Feb 29, 2024
    • Jeff Sharkey's avatar
      Offer baseline `RavenwoodFlagsValueProvider`. · 7037e357
      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
      7037e357
    • Jeff Sharkey's avatar
      Support service dependencies on Ravenwood. · 8a922eca
      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
      8a922eca
  11. Feb 27, 2024
    • Jeff Sharkey's avatar
      First pass of "fake" services on Ravenwood. · 16f7cdf2
      Jeff Sharkey authored
      One of our eventual goals with Ravenwood is to support usage of
      system services from test code.  A recent change added support for
      "real" services on Ravenwood, and this change expands that to add
      support for "fake" services.
      
      Some services are so tangled with dependencies it would take a
      long time until we'd be able to run their "real" code.  Also, some
      services with deep hardware dependencies that it can be difficult
      to add new abstraction layers to support Ravenwood.  Finally, we
      want to support service owners that only have resources to meet
      the "Pareto principle", where enabling 20% of their functionality
      on Ravenwood is enough to unblock 80% of test use-cases.
      
      Thus, we're supporting teams bringing either "real" or "fake"
      implementations of their services.  Since all test interactions
      still go through published FooManager and FooManagerInternal-style
      interfaces, teams can start with a "fake" and slowly transition
      to using more of their "real" code over time, without having to
      update test clients.
      
      And as a final reminder, because Ravenwood requires test suites
      like CTS, we're already verifying that "fake" services behave
      similarly to the "real" services on physical devices.
      
      Bug: 325506297
      Test: atest CtsContentTestCasesRavenwood
      Change-Id: I8ed5bd030e03143c15cb9fa945bbdcb0b412611e
      16f7cdf2
  12. Feb 20, 2024
    • Jeff Sharkey's avatar
      First pass of "real" services on Ravenwood. · 3e91c2b2
      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
      3e91c2b2
  13. Feb 16, 2024
  14. Feb 13, 2024
    • Makoto Onuki's avatar
      Move "runtime helpers" to f/b/ravenwood · 053eac85
      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
      053eac85
  15. Feb 12, 2024
    • Jeff Sharkey's avatar
      Human-readable XML on Ravenwood. · 1e92835f
      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
      1e92835f
  16. Feb 09, 2024
    • Jeff Sharkey's avatar
      hoststubgen: Emit stats for dashboarding. · d2cc1917
      Jeff Sharkey authored
      As we expand our audience, developers will be interested in knowing
      what APIs are supported through a top-down dashboard view that we
      can continually update over time.
      
      This change emits a statistics CSV that can be easily bulk-imported
      to generate a dashboard.
      
      Bug: 322895594
      Test: TH
      Change-Id: Idea55b64cdb79e9a49f63340f83a1b395f8e5ec7
      d2cc1917
  17. Feb 08, 2024
  18. Jan 17, 2024
    • Jeff Sharkey's avatar
      Offer `core-libart-for-host` under Ravenwood. · 5cb49a3a
      Jeff Sharkey authored
      Ravenwood is a deviceless testing environment that runs in a host
      JVM, similar to Robolectric.
      
      As we're working on onboard existing SystemUI tests that expect
      parity with Robolectric, we're needing to offer the same baseline
      Robolectric functionality, so we expand the visibility of
      `core-libart-for-host` to only the top-level of "//frameworks/base"
      which is where Ravenwood.bp is defined.  (We're not exposing the
      library to any subpackages.)
      
      Bug: 319647875
      Test: atest SystemUiRavenTests
      Change-Id: I02185deb302aa764a6970de848d82788f7d07e19
      5cb49a3a
  19. Jan 11, 2024
    • Jeff Sharkey's avatar
      Offer Mockito under Ravenwood. · ed81c781
      Jeff Sharkey authored
      Thankfully the source tree already has a prebuilt variant of Mockito
      that is well-supported for mocking on the host side, so this change
      transparently offers that under the Ravenwood environment.
      
      Bug: 319647875
      Test: atest SystemUiRavenTests
      Change-Id: Id87c25ec18cee454defe0dfbd609eb4cbeca5a95
      ed81c781
    • Jeff Sharkey's avatar
      Offer Mainline stubs under Ravenwood. · 7c49507e
      Jeff Sharkey authored
      Mainline hidden APIs can change at any time, so we don't want to
      bring them across as-is, so `all-updatable-modules-system-stubs`
      is used instead to ensure we only bring across published stub APIs
      that module authors intend to be stable.
      
      Bug: 319647875
      Test: atest SystemUiRavenTests
      Change-Id: Ib0837ee65ce125f27e0e7f3da6effe814065c35b
      7c49507e
  20. Dec 18, 2023
    • Makoto Onuki's avatar
      Clean up HostStubGen directory · 8bcc6281
      Makoto Onuki authored
      Remove obsolete directories
      
      Test: ./scripts/run-all-tests.sh
      Bug: 292141694
      Change-Id: I2124831ed61f50effca80c64005eb0933fd87016
      8bcc6281
  21. Nov 29, 2023
    • Makoto Onuki's avatar
      HostStubGen: Write verbose/debug log to a file · 623cffb0
      Makoto Onuki authored
      See below for the log filename.
      
      Also disable an unimplemented flag.
      
      Bug: 311174191
      Test: ./scripts/run-all-tests.sh
      Test: m framework-minus-apex.ravenwood
          and examine console output and
          out/soong/.intermediates/frameworks/base/framework-minus-apex.ravenwood-base/android_common/gen/hoststubgen_framework-minus-apex.log
      Change-Id: I9997370c93e2fe90276d5f3e657d45d440ca0a59
      623cffb0
    • Jeff Sharkey's avatar
      Verify `android.test.mock` under Ravenwood. · de344710
      Jeff Sharkey authored
      Even though developers are encouraged to use Mockito, existing tests
      may still be using this old library for their mocking.
      
      We'll circle back later to consider support for components such as
      ContentProvider, Service, etc.
      
      Clean up OWNERS.
      
      Bug: 310268946
      Test: atest android.test.mock.ravenwood.tests
      Change-Id: Ie3f4ccea9cf6719d61cff277a627825868edc992
      de344710
  22. Nov 21, 2023
    • Makoto Onuki's avatar
      HostStubGen: Stub generation is now optional, etc · c8a04dca
      Makoto Onuki authored
      - Now both --out-stub-jar and --out-impl-jar are optional
      - Disable --enable-non-stub-method-check by default
        (it's not fully implemented anyway)
      - Delete the script `run-ravenwood-test` since now atest
        just works.
      
      Test: run-all-tests.sh
      Bug: 292141694
      Change-Id: I3b7d63600139425e5fffc12930ee860edf2acd7f
      c8a04dca
  23. Nov 16, 2023
    • Jeff Sharkey's avatar
      Build `ravenwood-junit` against `test_current`. · 41cfbb3f
      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
      41cfbb3f
  24. Nov 15, 2023
    • Jeff Sharkey's avatar
      [1/?] Support android.content for Ravenwood. · 73067713
      Jeff Sharkey authored
      Initial pass at foundational classes under android.content, along
      with CTS to verify consistency.
      
      Methods that interface to broader parts of OS remain marked as
      "throw" for the moment, such as cross-process work and StrictMode.
      
      Bug: 292141694
      Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases
      Test: atest-dev CtsContentTestCasesRavenwood CtsContentTestCases
      Change-Id: Ic3deafb1f4058fcc104882a3508728994669f7d2
      73067713
  25. Nov 10, 2023
  26. Nov 08, 2023
    • Jeff Sharkey's avatar
      Support Parcel, Bundle under Ravenwood, with CTS. · 91f414e4
      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
      91f414e4
  27. Nov 03, 2023
    • Makoto Onuki's avatar
      Add `android_ravenwood_test` build rule · c69a84e4
      Makoto Onuki authored
      Since we're unable to compile libcore classes for the device,
      we temporarily pivot usages to our own copy of EmptyArray.
      
      Bug: 292141694
      Test: m nothing --no-skip-soong-tests
      Test: m hoststubgen ravenwood-runtime tradefed atest && atest-dev HostStubGenTest-framework-test
      Change-Id: I9d4ff559924e47725eb3e897aaf2cc93e9b1a193
      c69a84e4
  28. Oct 16, 2023
  29. Oct 09, 2023
    • Makoto Onuki's avatar
      Start adding build rules for ravenwood · 3aefe338
      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
      3aefe338
Loading