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

[WIP] Support for multiple reporters #202

Merged
merged 1 commit into from
Jan 19, 2017
Merged

[WIP] Support for multiple reporters #202

merged 1 commit into from
Jan 19, 2017

Conversation

ezzatron
Copy link
Contributor

@ezzatron ezzatron commented Jan 6, 2017

This PR adds support for multiple reporters.

Summary/justification of changes:

  • This is a not a BC break, unless you count setting the default value of the reporter command-line option in peridot.php.
  • Multiple reporters can now be specified on the command line with multiple --reporter options.
    • The docs will need a minor update to reflect this.
  • When multiple reporters are specified, they are composed into a 'composite' reporter.
    • The first reporter gets the "real" output interface, and subsequent reporters get a buffered output interface. Once the runner.end event fires, any buffered output is displayed after the primary reporter's output, separated by a single newline. This prevents interlaced output, while retaining streaming output for the primary reporter.
  • Retains support for getReporter() and setReporter().
    • We can deprecate them with the next major release, and remove them in the one after that. I'm not sure how we want to handle deprecations though.
  • I'm not sure what the PERIDOT_REPORTER environment variable is used for, but I also retained support for it, and added a similar PERIDOT_REPORTERS environment variable, which contains all the reporter names, separated by comma.

Closes #186.

@codecov-io
Copy link

codecov-io commented Jan 6, 2017

Current coverage is 97.31% (diff: 100%)

Merging #202 into master will increase coverage by 0.16%

@@             master       #202   diff @@
==========================================
  Files            21         22     +1   
  Lines           736        781    +45   
  Methods         180        192    +12   
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            715        760    +45   
  Misses           21         21          
  Partials          0          0          

Powered by Codecov. Last update 25ec1ce...42e2bb9

@ezzatron ezzatron mentioned this pull request Jan 6, 2017
@ezzatron ezzatron force-pushed the multiple-reporters branch 3 times, most recently from 3f99d15 to edf6b0c Compare January 9, 2017 04:12
Copy link
Member

@brianium brianium left a comment

Choose a reason for hiding this comment

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

@ezzatron looks really good! An improvement for sure. Just had one comment/question.

With regards to the env variables - env variables seem useful for plugins. I think I added most of that functionality to support https://github.com/peridot-php/peridot-concurrency. I would be curious if the new functionality works with that plugin (or if that plugin still works in general) - not a huge deal as I have not used it in some time, and I don't think many people are.

}, $this->reporters);
}

private $reporters;
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind bumping this guy up to the top? I think that is consistent with the rest of the code right? If it's a preferred style thing I am definitely open to talking about it.

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, no worries man. I'll sort that out.

}

throw new \RuntimeException("Reporter class could not be created");
return new CompositeReporter(
array_merge(
Copy link
Member

Choose a reason for hiding this comment

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

👍

@brianium
Copy link
Member

For the record, it looks like a change broke the concurrency plugin. I am cool leaving it be for now. If someone opens an issue I will look into it. I don't think many people are using it anymore, so I'm not expecting a problem

@ezzatron
Copy link
Contributor Author

ezzatron commented Jan 11, 2017

@brianium I tried to find a dependent package for the concurrency stuff so that I could try it out for myself, but there's only one listed in Packagist dependents that isn't peridot-jumpstart, and actually has any specs.

How did you figure out that it broke?

EDIT: Tried running the peridot-concurrency tests myself. I couldn't get master tests to pass, and the last Travis build failed too, so not really sure where to start there. I guess that's probably what you found too?

@brianium
Copy link
Member

Yeah. I did the same thing. I think it has been broken for a while. I haven’t seen any issues coming in, so either people are using pinned versions - or it never quite took off :) You ok with punting on it for a while? Concurrency might be a cool feature to add to the core library at some point.

@ezzatron
Copy link
Contributor Author

@brianium Yeah, I'm happy to let it go for now. At some point I probably need to go through all the repos and do some maintenance anyway. Hopefully I can get it working when I do that.

@ezzatron
Copy link
Contributor Author

ezzatron commented Jan 11, 2017

I also have some docs for this on a branch of the website: peridot-php/peridot-php.github.io@d15ab49

@ezzatron ezzatron merged commit ee10264 into master Jan 19, 2017
@ezzatron ezzatron deleted the multiple-reporters branch January 19, 2017 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants