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

Support Dart tests in et including ets own tests #147071

Open
cbracken opened this issue Apr 19, 2024 · 0 comments · May be fixed by flutter/engine#52250
Open

Support Dart tests in et including ets own tests #147071

cbracken opened this issue Apr 19, 2024 · 0 comments · May be fixed by flutter/engine#52250
Assignees
Labels
e: engine-tool Engine-specific tooling (i.e. `tools/engine_tool`).

Comments

@cbracken
Copy link
Member

With the addition of a dart_executable gn rule (#147013), we're able to build Dart code, whether standalone .dart files or whole Dart packages, into executable outputs. Add support to et to return these targets in queries and to be able to run them using et test.

@cbracken cbracken added the e: engine-tool Engine-specific tooling (i.e. `tools/engine_tool`). label Apr 19, 2024
@cbracken cbracken self-assigned this Apr 19, 2024
auto-submit bot pushed a commit to flutter/engine that referenced this issue Apr 20, 2024
We cannot modify the list of build targets as we're iterating over it. Instead of removing non-test/non-executable elements, instead we add executable test targets to a separate testTargets list and use that.

Noticed while working on: flutter/flutter#147071

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Also breaks out functions for:
* `_gnDesc`: returns the JSON output of `gn desc buildDir target`
* `_gnOutputs`:  returns the output files listed by `gn outputs buildDir target`

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Also breaks out functions for:
* `_gnDesc`: returns the JSON output of `gn desc buildDir target`
* `_gnOutputs`:  returns the output files listed by `gn outputs buildDir target`

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Also breaks out functions for:
* `_gnDesc`: returns the JSON output of `gn desc buildDir target`
* `_gnOutputs`:  returns the output files listed by `gn outputs buildDir target`

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Also breaks out functions for:
* `_gnDesc`: returns the JSON output of `gn desc buildDir target`
* `_gnOutputs`:  returns the output files listed by `gn outputs buildDir target`

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Also breaks out functions for:
* `_gnDesc`: returns the JSON output of `gn desc buildDir target`
* `_gnOutputs`:  returns the output files listed by `gn outputs buildDir target`

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 20, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Also breaks out functions for:
* `_gnDesc`: returns the JSON output of `gn desc buildDir target`
* `_gnOutputs`:  returns the output files listed by `gn outputs buildDir target`

Noticed while working on: flutter/flutter#147071
cbracken added a commit to cbracken/flutter_engine that referenced this issue Apr 21, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Also breaks out functions for:
* `_gnDesc`: returns the JSON output of `gn desc buildDir target`
* `_gnOutputs`:  returns the output files listed by `gn outputs buildDir target`

Noticed while working on: flutter/flutter#147071
cbracken added a commit to flutter/engine that referenced this issue Apr 22, 2024
Sets BuildTarget.executable to the `root_out_dir`-relative path of the
executable (e.g. `displaylist_unittests`) instead of its label (e.g.
`//out/host_debug/displaylist_unittests`). This is required since, in
the lines following the output lookup, we assume it to be a path
relative to the build output directory.

Also breaks out functions for:
* `_runGnDesc`: returns the JSON output of `gn desc buildDir target`
* `_runGnOutputs`: returns the output files listed by `gn outputs
buildDir target`

Noticed while working on:
flutter/flutter#147071

## 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] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [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/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e: engine-tool Engine-specific tooling (i.e. `tools/engine_tool`).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant