Skip to content
Snippets Groups Projects
  1. 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
  2. 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
  3. Feb 16, 2024
  4. 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
  5. 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
  6. 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
  7. Feb 08, 2024
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. Nov 10, 2023
  16. 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
  17. 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
  18. Oct 16, 2023
  19. 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