Flutter code coverage reports in VS Code on Windows? - flutter

Does anyone know a good way to see generated code coverage reports for a Flutter project in Windows, preferably using VS Code? I know I can generate coverage reports using flutter test --coverage which generates a coverage file (coverage\lcov.info).
But how can I use this in VS Code? I found an extension called Coverage Gutters that I can use to visualize covered lines with a green color. It's not perfect for dart/flutter code but it works OK. An example is that it does not mark green lines for line separated arguments to a method or constructor even if those arguments are included in tests.
But the main problem is that I can't get any visual report of the coverage. There are tools (primarily genhtml) that are used to generate HTML reports from the lcov.info but this does not seem to be available on Windows. Do I need to install the Linux subsystem for Windows 10 and install genhtml that way?
Please let me know if you have tips on how to use code coverage for Flutter in Windows (reports and/or line visualization in VS Code). Thanks!

A way--I wouldn't call it a good way, but at least it's easy and it works--is to install Atom text editor and the Dart and lcov-info packages. Then open your Flutter project and click Ctrl+Alt+c and the coverage report in graphical format will be displayed.

Related

how to show vue testing-library tests in vs code?

I've installed #testing-library/vue for a Vue project. I use VS Code as my IDE. Seems like I remember test runner integration in VS Code which will auto-display an aggregated list of all tests which exist in the app (files ending in test.js) but I don't see a way to display that test runner view in my default VS Code installation/configuration.
Looks like there's a "Test Explorer UI" Extension that I can install in VS Code which has 1.9M downloads so I'm guessing that's the most popular test runner for VS Code integration. I installed that extension and selected View > Testing from the toolbar. That displayed a "TESTING" panel on the left side of the IDE although no tests are displayed in that panel.
So is there anything special that I need to do in order for tests to display in this panel? Not sure if I need to install another dependency, configure an additional file, run some type of npm script, etc.

Visual Studio Code does not see changes in F# Solution

Currently I am trying to use Visual Studio Code with Ionide to build a F# Solution. To describe my problem, i first describe what i have done, and what works.
I created a solution with two Projects. One Project is a Queue that contains a F# library. Another project is Queue.Test that is a console application that uses the Queue library, and should contain the Tests for the Queue library.
I'm using .Net6 and created the solution and Project with the dotnet cli tool.
In general, i can build the project with dotnet and i also can use everything in Visual Studio Code. I load the Folder that contains both projects, and Visual Studio Code loads the library.
I am able to edit the Library and my Console application. In my Console application i also can access the Queue and so on. Autocompletion works, and so on.
But, there is one problem. When i add a new function to my library, let's say Queue.help then in my Console application, i cannot see that function. It doesn't show in autocomplete, and when I write code that uses that function i get a compiler error telling me that function doesn't exists.
I can Build/Rebuild from VS Code or from CLI but the problem goes not away.
The only way Ionide starts to see the new function is by building the library AND restarting VS Code. As long i don't restart, it seems to not update the generated dll (i guess).
This is sure annoying, as i don't want to reload/restart VSCode everytime I add a new function to my library.
So my question: How i can I fix this?
What i want is to be able to change my library, and at the same time write tests in the other project and get full Code autocompletion.
Does somebody else have the same problem, or should I change my workflow?
What can i do, to debug this problem on my own?
Some tips?
This issue is fixed by the recent version of Ionide 5.10.1

Flutter driver Test Explorer

is there a way to get some kind of Flutter Test Explorer into the IntelliJ IDE?
I am thinking of something like JUnit has in Visual Studio. Let's say that it should be something like this. My tests are stored in Feature Files.
If yes please send me a link to an addon or tool.
Thanks.
EDIT 1:
I am talking about the tool which "sees" all feature files and scenarios in it before the run. User than can select which scenario will be executed from the list of scenarios.
If you run tests in IntelliJ you should see something very similar to what you have screen shotted above for VS. You may find if you're using a build tool (Gradle/Maven) that running tests defaults to using the build tool to do so but you can switch this back to IntelliJ alone. What are you currently seeing/not seeing in IntelliJ?
See https://www.jetbrains.com/help/idea/performing-tests.html for more info + screen shot very similar to VS.

Does Code Coverage support DART 2 for Flutter projects?

On the Official Flutter Packages website, it is written that the plugin for Code Coverage, dart_codecov_generator (https://pub.dev/packages/dart_codecov_generator), is DART 2 INCOMPATIBLE. So, is there a way we can use Code Coverage for Flutter projects?
Yes it possible to get the code coverage for a flutter project.
if you run flutter test --coverage, it will output a file (lcov.info) in the coverage folder and then multiple solution are possible:
you can use genhtml program on this file to get the coverage (you will have to do some parsing)
use online tool like codecov to upload you code coverage into the service.

gcovr - cobertura

With gcovr I am able to generate code coverge report(coverage.xml) for my IOS application.How will I use cobertura plugin to convert the coverage.xml to cobertura html report?
Any help appreciated!
I use the lcov tool suite to generate HTML reports like these. . . The build-script to do this is here.
Nice feature: After every build from the build server, the results are uploaded to the Github page.
I was thinking of making a tool to auto-install the script in Xcode. There's an app you can use to view coverage results, but I was after something that:
Can be run from cmd-line. This makes it compatible with CI build-servers as well as easy to verify results locally.
lcov can easily be installed via MacPorts or home-brew.