Skip to content

Add debugging text to integration_test README #9316

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

Merged
merged 2 commits into from
Jul 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions packages/devtools_app/integration_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ xattr -d com.apple.quarantine ~/path/to/chromedriver
* `--update-goldens`: behaves like the `--update-goldens` flag for Flutter unit
tests, updating the golden images to the results produced by the test run.

The following flags are available, but should not be used manually. To run a
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text seems to be just dead? There are no "following flags"?

test with offline data or with experiments enabled, place the test in the proper
directory, and the `run_tests.dart` script will propagate the proper flag values
automatically (see [instructions below](#where-to-add-an-integration-test)).

# Where to add an integration test

Where you should place your integration test will depend on the answers to the
Expand All @@ -86,8 +81,9 @@ following questions:

## "live connection" integration tests

Tests under `integration_test/test/live_connection` will run DevTools and
connect it to a live Dart or Flutter application.
Tests under `integration_test/test/live_connection` will:
* run a "test app" (a Dart application or a Flutter app), and
* run DevTools, connecting it to that test app.

## "offline" integration tests

Expand All @@ -114,3 +110,21 @@ For a list of such arguments, see
[_in_file_args.dart](test_infra/run/_in_file_args.dart). For an example of
usage, see
[eval_and_browse_test.dart](test/live_connection/eval_and_browse_test.dart).

# Debugging

There is not an easy setup for debugging a DevTools integration test from an
IDE. But print debugging can be applied as follows:

* To log the steps of the test script execution, you can set
[`debugTestScript`][] to `true`.
* In the test code, (the "target" of the integration test command), `print` or
[`logStatus`][] will print to the terminal.
* In the "test app," there is no acccess to any `print`ed output. If the app
has access to `dart:io`, you can still log to a file, as easy as
`io.File('some-file.txt').writeAsStringSync('...');`.



[`debugTestScript`]: https://github.com/flutter/devtools/blob/master/packages/devtools_app/integration_test/test_infra/run/_utils.dart/#L7
[`logStatus`]: https://github.com/flutter/devtools/blob/master/packages/devtools_test/lib/src/helpers/utils.dart#L243
Loading