flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.58k stars 324 forks source link

Custom devtool extensions not available while debugging integration tests #7841

Closed Andrei7506238 closed 3 months ago

Andrei7506238 commented 4 months ago

Steps to reproduce

  1. In default flutter counter app add integration_test and a package providing a devtool custom extension (ex: provider)

    dev_dependencies:
    flutter_test:
    sdk: flutter
    integration_test:
    sdk: flutter
    provider: ^6.1.2
  2. Add folder integration_test to the project root and create an integration test: image

import 'package:area_chart_redesign/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  testWidgets('Counter increments smoke test', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(const MyApp());

    // Verify that our counter starts at 0.
    expect(find.text('0'), findsOneWidget);
    expect(find.text('1'), findsNothing);

    // Tap the '+' icon and trigger a frame.
    await tester.tap(find.byIcon(Icons.add));
    await tester.pump();

    // Verify that our counter has incremented.
    expect(find.text('0'), findsNothing);
    expect(find.text('1'), findsOneWidget);
  });
}
  1. Debug widget_test. Put breakpoint on await tester.pumpWidget(const MyApp());. When it hits the breakpoint open DevTools in WebBrowser

Expected results

The devtools provided by the packages should show up in separate tabs (like in the first image provided below. The first screenshot is made when I started debug for lib/main.dart).

Actual results

The tabs related to the custom devtools extensions are not shown. Also the extensions can't be found in the "DevTools Extensions tab". See 2nd image below.

Code sample

No relevant piece of code. I used the default starter flutter project (counter app). See "Steps to reproduce"

Screenshots or Video

Screenshots / Video demonstration ![chrome_8KSCo6T4QV](https://github.com/flutter/flutter/assets/52383534/50255a72-4a9e-4009-96f0-411d2036e890) ![chrome_9hZR3wS0b3](https://github.com/flutter/flutter/assets/52383534/06904de8-1669-4617-9db6-237dcb13664a)

Logs

I don't have any relevant logs. Tested on Android.

Flutter Doctor output

Doctor output ```console [√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.19045.3086], locale en-US) • Flutter version 3.22.0 on channel stable at D:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5dcb86f68f (13 days ago), 2024-05-09 07:39:20 -0500 • Engine revision f6344b75dc • Dart version 3.4.0 • DevTools version 2.34.3 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\apopa\AppData\Local\Android\sdk • Platform android-34, build-tools 34.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop Windows apps (Visual Studio Professional 2019 16.11.27) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional • Visual Studio Professional 2019 version 16.11.33801.447 • Windows 10 SDK version 10.0.19041.0 [√] Android Studio (version 2022.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694) [√] Connected device (4 available) • 21081111RG (mobile) • lby9dq4donga59lf • android-arm64 • Android 14 (API 34) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.3086] • Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.208 • Edge (web) • edge • web-javascript • Microsoft Edge 125.0.2535.51 [√] Network resources • All expected network resources are available.```
darshankawar commented 4 months ago

Thanks for the detailed report. I see the same reported behavior as mentioned.

stable, master flutter doctor -v ``` [!] Flutter (Channel stable, 3.22.0, on macOS 12.2.1 21D62 darwin-x64, locale en-GB) • Flutter version 3.22.0 on channel stable at /Users/dhs/documents/fluttersdk/flutter ! Warning: `flutter` on your path resolves to /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter. Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter. Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5dcb86f68f (5 days ago), 2024-05-09 07:39:20 -0500 • Engine revision f6344b75dc • Dart version 3.4.0 • DevTools version 2.34.3 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [!] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Applications/Xcode.app/Contents/Developer ! Flutter recommends a minimum Xcode version of 13. Download the latest version or update via the Mac App Store. • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (5 available) • SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 11 (API 30) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 18D61 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. [!] Flutter (Channel master, 3.22.0-45.0.pre.3, on macOS 12.2.1 21D62 darwin-x64, locale en-GB) • Flutter version 3.22.0-45.0.pre.3 on channel master at /Users/dhs/documents/fluttersdk/flutter ! Warning: `flutter` on your path resolves to /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter. Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter. Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision fe0932f2c0 (4 hours ago), 2024-05-22 22:19:25 -0400 • Engine revision b8b82454e3 • Dart version 3.5.0 (build 3.5.0-178.0.dev) • DevTools version 2.36.0-dev.10 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/dhs/Library/Android/sdk ✗ cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 13C100 • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 65.1.4 • Dart plugin version 213.7228 [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.29.0 [✓] Connected device (3 available) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 15.3.1 19D52 • macOS (desktop) • macos • darwin-x64 • macOS 12.2.1 21D62 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 1 category. [!] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Applications/Xcode.app/Contents/Developer ! Flutter recommends a minimum Xcode version of 13. Download the latest version or update via the Mac App Store. • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (5 available) • SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 11 (API 30) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 18D61 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. ```
kenzieschmoll commented 4 months ago

I cannot reproduce on Flutter master (which contains a more recent version of DevTools). @Andrei7506238 Can you reproduce on the flutter master channel? If so, how are you running your test?

Andrei7506238 commented 4 months ago

Seems to be working as expected on the master channel. Thank you! Any idea when will the fix be available on stable channel?


[√] Flutter (Channel master, 3.23.0-13.0.pre.24, on Microsoft Windows [Version 10.0.19045.3086], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Professional 2019 16.11.27)
[√] Android Studio (version 2022.2)
[√] Connected device (4 available)
[√] Network resources```

Tested on a Windows host with the app running on Android.
kenzieschmoll commented 3 months ago

The last Flutter stable release went out in May, and we aim to release quarterly, so this fix should hit stable in a couple of months. In the meantime, you can use the beta channel to get extensions support for integration tests. Closing this issue as fixed. Thanks!