flutter/dev/integration_tests
Loïc Sharma 37e79eb90c
[iOS/macOS] Add Xcode error if dev dependencies are incorrect (#165916)
Recently, the Flutter tool was updated to remove dev dependencies for
release builds and add dev dependencies for debug/profile builds.

However when building from Xcode directly, dev dependencies are not
enabled/disabled. As a result, it was possible for debug builds to not
have dev dependencies (or vice versa). Example:

1. `flutter build ios --release` - Release build using Flutter tool.
Disables dev dependencies
2. `open ios/Runner.xcworkspace` - Open the iOS project in Xcode
3. In Xcode, **Product** > **Build** - Do a debug build

Previously, step 3 would result in debug artifacts that are missing dev
dependencies. This PR now makes this an error:


![image](https://github.com/user-attachments/assets/621c4a8f-1c19-44b9-8866-93bef6b4a384)

Part of https://github.com/flutter/flutter/issues/163874

## Implementation

The Flutter tool now writes a `FLUTTER_DEV_DEPENDENCIES_ENABLED` in the
generated config file. This tracks whether the currently generated
project has dev dependencies.

In the Xcode build:

1. The Xcode backend script passes the
`FLUTTER_DEV_DEPENDENCIES_ENABLED` config to `flutter assemble` using
the `DevDependenciesEnabled` define
6. The new `CheckDevDependencies` target verifies dev dependencies:
1. It checks if the dev dependencies status is correct for the current
build mode
2. It checks whether the app has dev dependencies by reading the
`.flutter-plugins-dependencies` file. If the app has no dev
dependencies, the error is suppressed.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-11 19:34:38 +00:00
..
android_engine_test [android_engine_test] disable old HC mode tests. (#166293) 2025-04-01 00:41:49 +00:00
android_module_host_with_custom_build_v2_embedding/app/src/main/java/io/flutter/addtoapp
android_semantics_testing Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
android_views Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
channels Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
deferred_components_test Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
display_cutout_rotation Convert AppLinkSettings to kotlin (#164391) 2025-03-11 17:00:17 +00:00
external_textures Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
flavors Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
flutter_gallery Roll pub packages (#166779) 2025-04-09 01:55:08 +00:00
hook_user_defines [native assets] Roll dependencies (#166969) 2025-04-11 10:06:17 +00:00
ios_add2app_life_cycle [iOS/macOS] Add Xcode error if dev dependencies are incorrect (#165916) 2025-04-11 19:34:38 +00:00
ios_app_with_extensions Roll pub packages (#163083) 2025-02-11 23:47:59 +00:00
ios_host_app Revert "Add set semantics enabled API and wire iOS a11y bridge (#1612… (#165901) 2025-03-25 18:24:46 +00:00
ios_host_app_swift [iOS] Migrate @UIApplicationMain attribute to @main (#146707) 2024-04-16 22:13:03 +00:00
ios_platform_view_tests Roll pub packages (#165932) 2025-03-27 04:27:26 +00:00
link_hook [native assets] Roll dependencies (#166969) 2025-04-11 10:06:17 +00:00
module_host_with_custom_build/.gradle
module_host_with_custom_build_v2_embedding Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
new_gallery Roll pub packages (#166503) 2025-04-08 00:41:20 +00:00
platform_interaction Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
pure_android_host_apps Fix build_android_host_app_with_module_source device lab tests (#166077) 2025-03-27 17:42:48 +00:00
release_smoke_test Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
spell_check Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059) 2025-03-27 15:07:22 +00:00
ui [iOS/macOS] Add Xcode error if dev dependencies are incorrect (#165916) 2025-04-11 19:34:38 +00:00
web Remove <meta content="IE=Edge" http-equiv="X-UA-Compatible"> (#166252) 2025-03-31 16:03:56 +00:00
web_compile_tests Bump characters, collection, meta (#161066) 2025-01-03 02:23:10 +00:00
web_e2e_tests Roll pub packages (#165932) 2025-03-27 04:27:26 +00:00
wide_gamut_test Roll pub packages (#163083) 2025-02-11 23:47:59 +00:00
windows_startup_test Roll pub packages (#165932) 2025-03-27 04:27:26 +00:00
README.md Warn that integration tests are not run automatically (#162626) 2025-02-03 22:36:41 +00:00

Automated Flutter integration test suites

Each suite consists of either a complete Flutter app and a flutter_driver specification that drives tests from the UI, or a native app that is meant to integrate with Flutter for testing.

Intended for use with devicelab tests.

If you want to run a driver test locally, to debug a problem with a test, you can use this command from the appropriate subdirectory:

flutter drive -t <test> --driver <driver>

For example:

flutter drive -t lib/keyboard_resize.dart --driver test_driver/keyboard_resize_test.dart

New tests require new CI runner

Adding code to this directory will not automatically cause it to be run by any already existing ci tooling. This directory is intentinally a "choose your own adventure" piece of tooling.