Repository navigation
[camera] Integration tests require user interaction #130987
Description
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 drivefor specific packages that opt out offlutter test. This will regress us in a way though, sinceflutter drivelogs warnings that we should be usingflutter test, and it's not clear to me ifdrivewill 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
adballows in that regard. - Add functionality to
flutter testto 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.
Activity
reidbaker commentedon Aug 24, 2023
Infra-team I think this is a limitation after migrating to LUCI. The request would be to build a supported way to grant runtime permissions on android.
stuartmorgan-g commentedon Aug 24, 2023
This was actually due to the
flutter drive->flutter testmigration, rather than the LUCI migration. (It's related to LUCI only in that the LUCI migration allowed us to even run emulator tests at all.)reidbaker commentedon Aug 25, 2023
Ah thank you for the more accurate description.
5 remaining items
gmackall commentedon Oct 19, 2023
Related to #86295
gmackall commentedon Dec 20, 2023
Lowering the priority for now as these tests are run in our device testing (just not on emulator).
MarkOSullivan94 commentedon Jan 26, 2024
Granting all permissions would be a sufficient workaround to prevent tests from failing due to the native permission dialog getting in the way 🤞
Something like this exposed in the
integration_testAPI would be an improvement on what's available for developers to use 🙌flutter-triage-bot commentedon Apr 24, 2024
This issue is assigned to @gmackall but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
flutter-triage-bot commentedon Jul 10, 2024
This issue was assigned to @gmackall but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.