Skip to content

Add support for --coverage to flutter test #4679

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

Merged
merged 1 commit into from
Jun 22, 2016
Merged

Conversation

abarth
Copy link
Contributor

@abarth abarth commented Jun 22, 2016

We need dart-lang/tools#561 to be fixed before
this will be useful.

Fixes #2342

@abarth
Copy link
Contributor Author

abarth commented Jun 22, 2016

@Hixie @cbracken

@abarth abarth force-pushed the coverage branch 2 times, most recently from e23be59 to c975c1b Compare June 22, 2016 00:43
@cbracken
Copy link
Member

Heads up: dart-lang/tools#561 is now fixed.

printTrace('formating coverage data');
// TODO(abarth): Use PackageMap.globalPackagesPath once
// https://github.com/dart-lang/coverage/issues/100 is fixed.
Resolver resolver = new Resolver(packageRoot: path.absolute('packages'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New param in 0.7.8 is packagesPath (String path to .packages file)

@eseidelGoogle
Copy link
Contributor

It's clearly dangerous putting you two in a room together. :)

So excited to try this out!

@@ -105,8 +112,16 @@ void main() {
}
''');

int observatoryPort;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding was the dart vm would pick an open port if you passed --observatory-port=0, and then we had code to read said port from the logs, etc. Maybe that won't work through our package:test integration? Devon might know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I didn't want to mess with reading the port back from the logs. Seemed easier to push the port number in via a command-line parameter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have code in os.dart - findAvailablePort() - that tries to find an available local port. I'm not sure it's more reliable than the random generator below however -

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@abarth
Copy link
Contributor Author

abarth commented Jun 22, 2016

This is ready for review now.

@Hixie
Copy link
Contributor

Hixie commented Jun 22, 2016

LGTM

@abarth abarth merged commit b094fa6 into flutter:master Jun 22, 2016
@abarth abarth deleted the coverage branch June 22, 2016 19:22
cdotstout pushed a commit to cdotstout/flutter that referenced this pull request Apr 3, 2018
* use TextDecoration enums
* replace GetBlobLength with a function that returns runs based on typeface
* a few other minor style fixes
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Would be nice to produce code coverage from flutter test
5 participants