Skip to content

Custom reporter #741

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

Closed
wants to merge 1 commit into from
Closed

Custom reporter #741

wants to merge 1 commit into from

Conversation

dkrutskikh
Copy link

Added ability to define user custom reporter

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@googlebot
Copy link

CLAs look good, thanks!

@kevmoo kevmoo requested a review from nex3 December 28, 2017 20:03
.gitignore Outdated
@@ -13,3 +13,5 @@ packages
# Include when developing application packages.
pubspec.lock
.packages

.idea
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this file change. .idea files should be ignored in your global .gitignore file

Copy link
Author

Choose a reason for hiding this comment

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

@kevmoo done

Copy link
Member

@natebosch natebosch left a comment

Choose a reason for hiding this comment

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

I'll let @nex3 comment on the change overall

lib/test.dart Outdated
@@ -41,6 +42,12 @@ export 'src/frontend/utils.dart';
/// This is used if a test file is run directly, rather than through the runner.
Declarer _globalDeclarer;

typedef Reporter UserDefinedReporterCreateCallback(Engine engine);
UserDefinedReporterCreateCallback _userDefinedReporterCallback;
void setUserDefinedReporter(UserDefinedReporterCreateCallback callback) {
Copy link
Member

Choose a reason for hiding this comment

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

Avoid methods named setSomething. You can have a set method at the top level, but since this isn't doing any extra work we can also make the variable public instead of private.

Copy link
Author

Choose a reason for hiding this comment

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

@natebosch done

@nex3
Copy link
Member

nex3 commented Jan 3, 2018

This approach won't work, for a couple reasons:

  • It only works when running tests via dart path/to/test.dart. This is a semi-unofficial way of invoking the test runner, so it doesn't make sense to add features that only work there.

  • It exposes the private internal Engine and Reporter APIs. Even when Provide a programmatic API #48 is done, I don't want to make these packages part of the API for the test package itself because additional API surface makes it harder to make large changes without breaking the world.

@nex3 nex3 closed this Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants