Skip to content

Give the project its first androidTest source set #110

Closed

Description

@lumenpearson

Part of #109.

There is no androidTest directory anywhere in this project — not in :app, :core:model, :core:designsystem, :core:data or :widget — and no espresso, uiautomator or androidx.test entry in gradle/libs.versions.toml. Everything is JVM tests under Robolectric.

That is a deliberate consequence rather than an oversight: with no device in the loop, an instrumented test is one nobody can run. With a device it becomes the cheapest way to close several things at once.

What it should cover first, because each is written down as unverifiable today:

  • the long press flowing into the drag as one gesture. FloatingToolbar.kt says at length why it is two: one gesture means a tap detector and a long-press-drag detector on the same node, and which of them sees an event turns on which consumes the initial press — «behaviour that cannot be settled by reading and that no test in this project can exercise, because it needs a real pointer and this module has no instrumentation». An androidTest settles it;
  • the drag threshold under a real pointer at a real density, rather than dropIndex in pixels;
  • performScrollTo and the marquee traps, which on a device do not need the clock held at all.

Watch out for the version catalog rule: «Versions are copied from a project that builds, never guessed.» The first CI run of this project failed on four invented versions that exist in no repository. The header of libs.versions.toml names where each version came from — keep doing that.

And do not put connectedAndroidTest in ci.yml. CI has no device, and a gate that cannot run is worse than no gate. It belongs in a workflow of its own, on demand, or nowhere.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions