Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating test coverage, just like flutter test integration_test does #611

Closed
viniciusmo opened this issue Nov 16, 2022 · 13 comments
Closed
Labels
feature New feature request package: patrol_cli Related to the patrol_cli package

Comments

@viniciusmo
Copy link

viniciusmo commented Nov 16, 2022

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

Does Patrol have this option?

@bartekpacia
Copy link
Contributor

bartekpacia commented Nov 16, 2022

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 bartekpacia added question package: patrol_cli Related to the patrol_cli package labels Nov 16, 2022
@bartekpacia bartekpacia changed the title Coverage Generating test coverage, just like flutter test integration_test does Nov 16, 2022
@bartekpacia bartekpacia added feature New feature request blocked Blocked by external factors labels Nov 16, 2022
@bartekpacia bartekpacia mentioned this issue Dec 2, 2022
4 tasks
@neiljaywarner
Copy link

@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

@bartekpacia
Copy link
Contributor

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.

@KyleFin
Copy link

KyleFin commented Sep 7, 2023

Is this unblocked now with Patrol 2.0? #661

@bartekpacia
Copy link
Contributor

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

@neiljaywarner
Copy link

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.

@RyanParkGH
Copy link

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?

@BSoD38
Copy link

BSoD38 commented Dec 4, 2023

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.

@bartekpacia
Copy link
Contributor

bartekpacia commented Dec 4, 2023

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.

@tyagi-bhoopesh
Copy link

@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 jBorkowska removed the blocked Blocked by external factors label Jan 10, 2024
@bgintzairspace
Copy link

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

Thanks!!

@gogolon
Copy link
Collaborator

gogolon commented Sep 18, 2024

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 gogolon closed this as completed Sep 18, 2024
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature request package: patrol_cli Related to the patrol_cli package
Projects
None yet
Development

No branches or pull requests

10 participants