patrol icon indicating copy to clipboard operation
patrol copied to clipboard

Generating test coverage, just like `flutter test integration_test` does

Open viniciusmo opened this issue 3 years ago • 11 comments

Using the integration_test package is possible to run flutter test integration_test with --coverage flag.

Does Patrol have this option?

viniciusmo avatar Nov 16 '22 18:11 viniciusmo

No, it's currently not possible because Patrol is starting tests with flutter drive, not flutter test integration_test, and flutter drive doesn't have the test reporting capabilities that flutter test has.

I understand that coverage is important for you – our internal customers and clients are also saying this. We really do want to migrate from flutter driver to flutter test integration_test (this is tracked as #421), but we're blocked by a couple of issues (everything is in that issue).

We've made a POC of generating JUnit tests on Flutter's beta channel and it worked out well.

bartekpacia avatar Nov 16 '22 18:11 bartekpacia

@bartekpacia what's the status on this? and will we or are we able to even get this from firebase test lab witih evenironment variable coverageFile or coverageFilePath https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run

neiljaywarner avatar Dec 21 '22 17:12 neiljaywarner

The status is: we're not working on this, but we'd like to have this in the future :)

and will we or are we able to even get this from firebase test lab witih evenironment variable coverageFile or coverageFilePath https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run

I don't know, but it seems to me that these arguments don't work with Flutter.

bartekpacia avatar Dec 22 '22 11:12 bartekpacia

Is this unblocked now with Patrol 2.0? https://github.com/leancodepl/patrol/issues/661

KyleFin avatar Sep 07 '23 16:09 KyleFin

Hi @KyleFin, we haven't investigated it too much yet.

bartekpacia avatar Sep 07 '23 17:09 bartekpacia

i noticed that with patrol_finders you dont even have t use patrolTest() anymore, that's pretty neat.

It would be great to get to a "guide" or best practice solution or example project that involved as much shared code as possible between widget tests with coverage and integration tests, so the only places we couldnt get coverage were those native features.

neiljaywarner avatar Oct 17 '23 15:10 neiljaywarner

Love Patrol, would be essentially perfect with code coverage!

I won't hold my breath, but needed to reiterate that coverage would be very useful to many.

@bartekpacia could you please briefly describe LeanCode's approach to overseeing test coverage without this metric?

RyanParkGH avatar Oct 30 '23 22:10 RyanParkGH

I'll also pitch in saying that having code coverage would be great. We transitioned from integration_test to Patrol, and losing code coverage results was a bummer.

BSoD38 avatar Dec 04 '23 09:12 BSoD38

Thanks you very much for these comments 🙏🏻 I'll bring this to attention of our team. No promises but we're indeed seeing increasing interest in this feature.

Quick question:

  • Where were you running integration_test (and collecting code coverage results)? Was it some cloud device farm e.g. Firebase Test Lab? In general, the more info you give us, the merrier.

bartekpacia avatar Dec 04 '23 09:12 bartekpacia

@bartekpacia when would we like to see the test coverage report with the patrol plugin like patrol test --coverage or may be different plugin for it?

tyagi-bhoopesh avatar Dec 13 '23 10:12 tyagi-bhoopesh

@jBorkowska I see you removed the blocked label, does that mean this is possible now? Is it on the roadmap?

Thanks!!

bgintzairspace avatar May 21 '24 14:05 bgintzairspace

This feature was added in #2294. Starting with patrol 3.11.0 and patrol_cli 3.2.0, you can use the --coverage flag to enable coverage collection.

gogolon avatar Sep 18 '24 15:09 gogolon

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

github-actions[bot] avatar Sep 25 '24 17:09 github-actions[bot]