-
Notifications
You must be signed in to change notification settings - Fork 146
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
Code coverage #2294
Code coverage #2294
Conversation
…trol to not collect coverage from all tests if there were more than 1 tests per file
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice idea:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
extension<T> on Completer<T> { | ||
void disposedBy(DisposeScope disposeScope, T disposeValue) { | ||
disposeScope.addDispose(() { | ||
if (!isCompleted) { | ||
complete(disposeValue); | ||
} | ||
}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good addition to package:dispose_scope
by @RobertOdrowaz.
packages/patrol_cli/lib/src/coverage/device_to_host_port_transformer.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, lgtm 👍
@gogolon good job! Please bump versions of patrol and patrol_cli, remember about |
@@ -92,7 +92,7 @@ Future<void> main() async { | |||
); | |||
testExplorationCompleter.complete(dartTestGroup); | |||
print('patrol_test_explorer: obtained Dart-side test hierarchy:'); | |||
printGroupStructure(dartTestGroup); | |||
reportGroupStructure(dartTestGroup); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably force incompatibility with old patrol versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Just two small changes in changelogs and you can merge it
This adds a possibility to collect code coverage from patrol tests using
patrol test --coverage
. Unwanted files can be ignored using glob patterns, i.e:patrol test --coverage --coverage-ignore="**/*.g.dart"
The PR is not finished yet - there is one thing that needs to be addressed. Currently, the coverage is only collected from isolates that are running when particular test finishes - if an isolate exits prior to this, it will be omitted. The--pause-on-exit
flag is already set, but coverage has to be collected from the paused isolate separately, and it has to be resumed (other isolates might be waiting for its result).The code should be now fully functional, but it needs some cleanup