GithubHelp home page GithubHelp logo

Comments (14)

branflake2267 avatar branflake2267 commented on August 15, 2024 3

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.
screen shot 2017-05-21 at 12 50 49 pm

And if I could right click on the unit test, it would be nice to run the single test.
screen shot 2017-05-21 at 12 58 42 pm

from flutter-intellij.

devoncarew avatar devoncarew commented on August 15, 2024 2

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.

devoncarew avatar devoncarew commented on August 15, 2024 2

So we don't lose track: PR out to allow for debugging flutter test tests: flutter/flutter#10520

from flutter-intellij.

skybrian avatar skybrian commented on August 15, 2024 1

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.

devoncarew avatar devoncarew commented on August 15, 2024

FYI in case you weren't already aware, there's a flutter test command (that builds on top of package:test).

from flutter-intellij.

stevemessick avatar stevemessick commented on August 15, 2024

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.

devoncarew avatar devoncarew commented on August 15, 2024

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.

eseidelGoogle avatar eseidelGoogle commented on August 15, 2024

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.

eseidelGoogle avatar eseidelGoogle commented on August 15, 2024

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.

devoncarew avatar devoncarew commented on August 15, 2024

Initial version done! We'll track any additional work in more specific issues.

from flutter-intellij.

xster avatar xster commented on August 15, 2024

I may have missed it but is there some documentation for how to use it?

I'm on v15.0.
screen shot 2017-07-05 at 3 53 33 pm

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.

skybrian avatar skybrian commented on August 15, 2024

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.

devoncarew avatar devoncarew commented on August 15, 2024

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.

devoncarew avatar devoncarew commented on August 15, 2024

You could try working around the issue by manually creating a launch configuration (from Run > Edit Configurations...).

from flutter-intellij.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.