Generating test coverage, just like `flutter test integration_test` does
Using the integration_test package is possible to run flutter test integration_test with --coverage flag.
Does Patrol have this option?
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 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
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.
Is this unblocked now with Patrol 2.0? https://github.com/leancodepl/patrol/issues/661
Hi @KyleFin, we haven't investigated it too much yet.
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.
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?
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.
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 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?
@jBorkowska I see you removed the blocked label, does that mean this is possible now? Is it on the roadmap?
Thanks!!
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.
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.