Skip to content

[camera] Integration tests require user interaction #130987

@stuartmorgan-g

Description

@stuartmorgan-g

I'm currently having to exclude the camera and camera_android tests from the new emulator CI tests I'm bringing up, because when they run a system dialog pops up asking for camera permissions. When running locally, if I tap it in the emulator everything runs fine.

It looks like this is probably a regression from flutter/packages#4348, because we have code in test_driver/integration_test.dart in the camera packages that is clearly supposed to handle this, by running adb commands once the process starts. Some options I can think of, although there may well be others:

  • Teach the repo tooling to use flutter drive for specific packages that opt out of flutter test. This will regress us in a way though, since flutter drive logs warnings that we should be using flutter test, and it's not clear to me if drive will even continue to be supported for non-web.
  • Find an alternate solution to grant permissions. E.g., can we grant them before the app is even installed, perhaps as part of emulator creation, or a new pre-test-run-script option in the repo tooling? I don't know what adb allows in that regard.
  • Add functionality to flutter test to allow for this in some way if possible (e.g., by allowing a custom driver even though one isn't normally used).

I'll be disabling this test in the emulator CI bringup for now to avoid blocking the rest of that work, via a new script/configs/exclude_integration_android_emulator.yaml file. When this is fixed, the exclusion should be remove from that file.

/cc @bparrishMines since he's been looking at the way integration tests run, the drive vs test differences, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsc: contributor-productivityTeam-specific productivity, code health, technical debt.c: new featureNothing broken; request for a new capabilityp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions