Comments (14)
It would be nice to see launching the the flutter tests, flutter test
execution if a right click and debug unit tests on, unite_test.dart.
And if I could right click on the unit test, it would be nice to run the single test.
from flutter-intellij.
Yup. Another resolution would be to have a different test launch configuration for flutter tests (Flutter Test
instead of Dart Test
). It would be good in general to avoid a parallel everything for flutter however, and just try and adapt and use existing Dart functionality where possible.
from flutter-intellij.
So we don't lose track: PR out to allow for debugging flutter test
tests: flutter/flutter#10520
from flutter-intellij.
Debugging tests was implemented in #1106.
Still to do: implement the test UI (instead of showing progress on the console) and add the ability to run a single test (rather than all tests in a file).
from flutter-intellij.
FYI in case you weren't already aware, there's a flutter test
command (that builds on top of package:test).
from flutter-intellij.
I'm wondering if defining a new type of run configuration is the best way of invoking it. Given we're going to be running flutter in daemon mode a run configuration may not (or may) be the best way. It probably is, but I want to think about it a bit before deciding.
from flutter-intellij.
Cool. The flutter daemon mode is good for getting device notifications, and for launching apps. For testing, we may want to just shell out to flutter test, or add additional flags to flutter test as required.
from flutter-intellij.
Most of what flutter test
does is inject a custom "platform" into package:test
to it knows how to talk in/out of the sky_shell
(flutter shell) binary instead the dart
CLI. It's possible to put that behind a different interface, but as devon suggests you probably want to start with just calling the flutter
cli for now.
The custom platform: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/test/flutter_platform.dart
from flutter-intellij.
It's not clear how IntelliJ will know to run tests in sky_shell
(flutter's test harness) or the dart
command line (pure package:test). The differences are that sky_shell
exposes dart:ui
but dart
exposes dart:mirrors
(as well as dart native library extension loading). All non-mirrors dart code works in just the same in sky_shell
so one could always use sky_shell
. IntelliJ could also tell which test needed which based on it being a flutter project vs. a dart project, or if we put one typ of test in a different directory. It's also possible from analyzing the code to know if it depends on dart:ui or not.
flutter test
is just a wrapper around package:test
's standard runner, that knows how to sub in sky_shell
instead of dart
. :)
from flutter-intellij.
Initial version done! We'll track any additional work in more specific issues.
from flutter-intellij.
I may have missed it but is there some documentation for how to use it?
Choosing run/debug on a test file shows 2 template configurations. One does dart run test and the other tries to run it as a full flutter app.
Maybe I did something wrong.
from flutter-intellij.
This sounds like a bug where the Flutter run config is triggering for tests. It didn't do this for a simple "hello world" test file, but perhaps it triggers for more complicated tests?
Relevant code:
https://github.com/flutter/flutter-intellij/blob/master/src/io/flutter/run/FlutterRunConfigurationProducer.java#L49
By calling getFlutterEntryFile(), it checks for a flutter import, but it should also check that the file is not a test. (Maybe check that there is no package:test import?)
from flutter-intellij.
From a brief look at the code, I think this issue is specific to trying to run tests from the flutter repo, in //packages/flutter/
- i.e., just to the defining package for package:flutter
. I'll open an issue -
from flutter-intellij.
You could try working around the issue by manually creating a launch configuration (from Run > Edit Configurations...
).
from flutter-intellij.
Related Issues (20)
- Analysis stops working every hour or so HOT 1
- Kotlin/Java files syntax error - Flutter HOT 1
- Dev Channel is not updated. Documentation states that it is.
- The "pub get" command in intellij does not update the dependencies of subpackages, as vs code does.
- Android Studio Crash with Flutter Plugin
- Unable to see the play button in-front of individual tests
- app crashed and will not build
- app will no longer build
- Running web app from Android Studio is not preserving the last build session HOT 1
- ui guide not working in android studio
- No run button on individual testWidget on Android Studio HOT 2
- Bloc
- Not compatible with the version of your running IDE Build #IU-242.20224.300, built on August 7, 2024 HOT 33
- flutter plugin 80.0.2 can not viewer debug info HOT 1
- DevTools window makes AS freeze completely HOT 4
- Plugin 'Flutter' (version '81.0.2') is not compatible with the current version of the IDE, because it requires build 241.* or older but the current build is IU-242.20224.300 HOT 1
- "Open Android module in Android Studio" & "Open iOS module in Xcode" missing after upgrading 80.x
- custom_lint: IDE Quick actions and errors are not shown in GUI
- In Android Studio, "new package" is shown where it should be "new folder"
- Flutter 3.24 Breaks Extension Autocomplete
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-intellij.