flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

Flutter Test run for normal Dart Tests #2574

Open brianegan opened 6 years ago

brianegan commented 6 years ago

Hello! I've been running into this bug more and more as I work on projects that contain some Flutter directories along-side plain-old-Dart projects or Angular Dart projects.

Use-case: I have a project with 3 directories:

When I try to run tests in app_base, I get the following error:

Running "flutter packages get" in app_base...compiler message: Error: Could not resolve the package 'flutter_test' in 'package:flutter_test/flutter_test.dart'.

Which makes sense -- app_base shouldn't depend on Flutter! However, it seems like once you set the Flutter SDK for a project, it tries to run all tests as if they were Flutter tests. It would be great if the Flutter plugin either:

  1. Allowed me to select which directories in my Project are Flutter directories (similar to the Dart plugin)
  2. Understood the current directory is a Dart project, not a Flutter project, and ran good ol' Dart tests in that case

Workaround

Create a Run config for Pure dart tests. This quickly becomes cumbersome, however -- if I want to run/debug a single test in a single file, I always need to create a new run config rather than allowing the IDE to run an erroneous flutter test

Thanks!

zoechi commented 6 years ago

Related #2551, https://youtrack.jetbrains.com/issue/WEB-28911

brianegan commented 6 years ago

Thanks @zoechi :) Yah, that issue also mentions another bug I've run into: The Flutter plugin requires the root of the project to be a Flutter project. Not sure if that's still the case, but it'd be great if that wasn't a constraint.

stevemessick commented 6 years ago

@pq may have some thoughts on this.