[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated integration_flutter_test/embedder (scenic integration test) from fuchsia.git #26880

Merged
merged 12 commits into from
Oct 1, 2021

Conversation

richkadel
Copy link
Contributor
@richkadel richkadel commented Jun 22, 2021

The tests use upgraded flutter/repo build rules, implemented in previously merged PRs, starting with #27996, to compile C++ and Dart tests as Fuchsia components, with dependencies on both C++ and Dart FIDL bindings, and on additional Dart APIs included in the Fuchsia SDK.

The tests are rewritten, from using Flutter APIs in fuchsia.git, to using only dart_ui (since flutter/engine tests cannot depend on the downstream flutter/flutter APIs), but the basic test program shells have been compiled and successfully run after publishing the test component to a running Fuchsia instance. (See //flutter/shell/platform/fuchsia/flutter/integration_flutter_tests/embedder/README.md.)

Now that the rewritten tests are complete and operational, future integration issues between Flutter and Fuchsia (e.g., Scenic) can be caught directly from flutter/engine builds, instead of being caught only from Fuchsia builds, which typically uses a version of Flutter that is at least 2 days old.

Note this PR also migrates dart_library dependencies from flutter/buildroot (secondary/third_party/... packages) to a central flutter fuchsia BUILD.gn file, so the secondary BUILD.gn files that originally defined those dart_library targets can now be removed.

List which issues are fixed by this PR. You must list at least one issue.

Fixes: flutter/flutter#90286

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

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

@google-cla google-cla bot added the cla: yes label Jun 22, 2021
@richkadel richkadel marked this pull request as draft June 22, 2021 17:02
richkadel added a commit to richkadel/buildroot that referenced this pull request Jun 22, 2021
New integration tests depend on third_party Dart libraries that don't
include a BUILD.gn in their upstream repositories. Add `build/secondary`
BUILD.gn files (which require `flutter/tools/fuchsia/dart/dart_library.gni`
defined in flutter/engine#26880) so these dart libraries can be included
in Dart-based fuchsia components.
@richkadel richkadel force-pushed the fuchsia-orig branch 2 times, most recently from d6f16cd to 26c5657 Compare June 22, 2021 22:41
@richkadel richkadel force-pushed the fuchsia-orig branch 2 times, most recently from fecf98e to d76802f Compare June 25, 2021 00:12
richkadel added a commit to richkadel/buildroot that referenced this pull request Jun 25, 2021
New integration tests depend on third_party Dart libraries that don't
include a BUILD.gn in their upstream repositories. Add `build/secondary`
BUILD.gn files (which require `flutter/tools/fuchsia/dart/dart_library.gni`
defined in flutter/engine#26880) so these dart libraries can be included
in Dart-based fuchsia components.
richkadel added a commit to richkadel/buildroot that referenced this pull request Jun 25, 2021
New integration tests depend on third_party Dart libraries that don't
include a BUILD.gn in their upstream repositories. Add `build/secondary`
BUILD.gn files (which require `flutter/tools/fuchsia/dart/dart_library.gni`
defined in flutter/engine#26880) so these dart libraries can be included
in Dart-based fuchsia components.
richkadel added a commit to richkadel/buildroot that referenced this pull request Jun 25, 2021
New integration tests depend on third_party Dart libraries that don't
include a BUILD.gn in their upstream repositories. Add `build/secondary`
BUILD.gn files (which require `flutter/tools/fuchsia/dart/dart_library.gni`
defined in flutter/engine#26880) so these dart libraries can be included
in Dart-based fuchsia components.
richkadel added a commit to richkadel/buildroot that referenced this pull request Jun 26, 2021
New integration tests depend on third_party Dart libraries that don't
include a BUILD.gn in their upstream repositories. Add `build/secondary`
BUILD.gn files (which require `flutter/tools/fuchsia/dart/dart_library.gni`
defined in flutter/engine#26880) so these dart libraries can be included
in Dart-based fuchsia components.
richkadel added a commit to richkadel/buildroot that referenced this pull request Jun 26, 2021
New integration tests depend on third_party Dart libraries that don't
include a BUILD.gn in their upstream repositories. Add `build/secondary`
BUILD.gn files (which require `flutter/tools/fuchsia/dart/dart_library.gni`
defined in flutter/engine#26880) so these dart libraries can be included
in Dart-based fuchsia components.
richkadel added a commit to richkadel/buildroot that referenced this pull request Jul 7, 2021
New integration tests depend on third_party Dart libraries that don't
include a BUILD.gn in their upstream repositories. Add `build/secondary`
BUILD.gn files (which require `flutter/tools/fuchsia/dart/dart_library.gni`
defined in flutter/engine#26880) so these dart libraries can be included
in Dart-based fuchsia components.
richkadel added a commit to richkadel/engine that referenced this pull request Jul 7, 2021
Ninja runs `action` scripts using the default python interpretter, and
most flutter build scripts that use python currently require python2. In
order to support python3 scripts as well, the `python3_action` invokes a
wrapper python2-based script via GN `action` target, and the wrapper
invokes the python3 interpretter with the given script.

This new target is required to support flutter#26880, but is
broken out to a separate PR (by request) to support other more immediate
use cases.
richkadel added a commit to richkadel/engine that referenced this pull request Jul 7, 2021
Ninja runs `action` scripts using the default python interpretter, and
most flutter build scripts that use python currently require python2. In
order to support python3 scripts as well, the `python3_action` invokes a
wrapper python2-based script via GN `action` target, and the wrapper
invokes the python3 interpretter with the given script.

This new target is required to support flutter#26880, but is
broken out to a separate PR (by request) to support other more immediate
use cases.
@richkadel richkadel mentioned this pull request Jul 7, 2021
8 tasks
@richkadel richkadel force-pushed the fuchsia-orig branch 2 times, most recently from 498bd52 to 7fe5d47 Compare July 7, 2021 19:47
arbreng pushed a commit to flutter/buildroot that referenced this pull request Jul 7, 2021
New integration tests depend on third_party Dart libraries that don't
include a BUILD.gn in their upstream repositories. Add `build/secondary`
BUILD.gn files (which require `flutter/tools/fuchsia/dart/dart_library.gni`
defined in flutter/engine#26880) so these dart libraries can be included
in Dart-based fuchsia components.
richkadel added a commit to richkadel/engine that referenced this pull request Jul 8, 2021
Ninja runs `action` scripts using the default python interpretter, and
most flutter build scripts that use python currently require python2. In
order to support python3 scripts as well, the `python3_action` invokes a
wrapper python2-based script via GN `action` target, and the wrapper
invokes the python3 interpretter with the given script.

This new target is required to support flutter#26880, but is
broken out to a separate PR (by request) to support other more immediate
use cases..
richkadel added a commit to richkadel/engine that referenced this pull request Jul 8, 2021
Ninja runs `action` scripts using the default python interpretter, and
most flutter build scripts that use python currently require python2. In
order to support python3 scripts as well, the `python3_action` invokes a
wrapper python2-based script via GN `action` target, and the wrapper
invokes the python3 interpretter with the given script.

This new target is required to support flutter#26880, but is
broken out to a separate PR (by request) to support other more immediate
use cases.
@abarth
Copy link
Contributor
abarth commented Jul 8, 2021

Please do not land this pull request. It contains files from the Fuchsia repository that are not support for use outside the Fuchsia repository.

@richkadel
Copy link
Contributor Author

Agreed. Thanks Adam. This Draft is not intended to be landed as-is.

richkadel added a commit to richkadel/engine that referenced this pull request Jul 15, 2021
Ninja runs `action` scripts using the default python interpretter, and
most flutter build scripts that use python currently require python2. In
order to support python3 scripts as well, the `python3_action` invokes a
wrapper python2-based script via GN `action` target, and the wrapper
invokes the python3 interpretter with the given script.

This new target is required to support flutter#26880, but is
broken out to a separate PR (by request) to support other more immediate
use cases.
richkadel added a commit to richkadel/engine that referenced this pull request Jul 16, 2021
Ninja runs `action` scripts using the default python interpretter, and
most flutter build scripts that use python currently require python2. In
order to support python3 scripts as well, the `python3_action` invokes a
wrapper python2-based script via GN `action` target, and the wrapper
invokes the python3 interpretter with the given script.

This new target is required to support flutter#26880, but is
broken out to a separate PR (by request) to support other more immediate
use cases.
jason-simmons pushed a commit that referenced this pull request Jul 16, 2021
Ninja runs `action` scripts using the default python interpretter, and
most flutter build scripts that use python currently require python2. In
order to support python3 scripts as well, the `python3_action` invokes a
wrapper python2-based script via GN `action` target, and the wrapper
invokes the python3 interpretter with the given script.

This new target is required to support #26880, but is
broken out to a separate PR (by request) to support other more immediate
use cases.
@richkadel richkadel force-pushed the fuchsia-orig branch 2 times, most recently from eb479dc to 101b978 Compare September 28, 2021 19:09
This is a work in progress, with changes that successfully
compile the embedder test.

This commit leverages new build rules, added in PR flutter#27996,
that enable building flutter tests as Fuchsia components, and
dependencies on Dart libraries from the Fuchsia SDK (Fuchsia Dart APIs
and Dart FIDL bindings).

Notable:

* Adds dart third_party library "quiver" version 2.1.5 to support a
  dependency from a Fuchsia Dart library required by the integration
  test.
* Leverages the recent addition of TestWithEnvironment to the Fuchsia
  SDK, and blends this class with Googletest's (gtest) `testing::Test`,
  from Flutter's pre-existing gtest (third_party dependency).
WORK IN PROGRESS:

Fuchsia does not yet find parent_view.cmx. I realized I need to package
them, and flutter does not have build rules to build dart packages
(AFAICT). The Fuchsia GN SDK (which we can't use because it lacks the
Dart Fuchsia APIs) has a few other `build/` scripts that may be useful.
I pulled some in, slightly tweaked them (still too many assumptions we
are only building C++ packages!), and tried to rebuild.

Build "appeared" successful, but re-running did not resolve the issue
yet. Still working on this.
After dealing with lots of hidden issues and details, Dart packages
finally appear to load.
So the test has the ability to run using a runner built from the same
flutter/engine repo/state.
This also adds the fallback `fuchsia.com -> devhost` rule to `serve.sh`,
which appears to be required in order to avoid running the default
fuchsia package server as well.
with shell/platform/fuchsia/dart:<targets>

This simplifies fuchsia SDK Dart library dependencies by assuming those
targets match the versions required by Fuchsia. Since the GN target is a
"fuchsia"-specific target, this is a reasonable constraint.
Replicates all five test cases, which pass.
This change requires first landing:

  https://flutter-review.googlesource.com/c/recipes/+/18540

which adds support for publishing more than one package per test.

The CI test framework does not, currently, support running
`serve.sh` as a secondary package server, so all package domains have
been changed to assume `fuchsia.com`.
and trying to kill scenic.cmx before running the test
In case testing with a version of fuchsia built with the original
fuchsia.git version of the tests, the flutter version will have the
suffix "2", so there is no conflict or confusion.
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@arbreng arbreng added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Sep 30, 2021
@arbreng arbreng merged commit 779740e into flutter:master Oct 1, 2021
akbiggs pushed a commit to akbiggs/engine that referenced this pull request Oct 1, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 1, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 1, 2021
dnfield pushed a commit to dnfield/engine that referenced this pull request Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes needs tests platform-fuchsia waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
5 participants