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

Autoinject code? Coverage/performance/others simplification #192

Open
eldipa opened this issue Jul 3, 2021 · 0 comments
Open

Autoinject code? Coverage/performance/others simplification #192

eldipa opened this issue Jul 3, 2021 · 0 comments
Labels
enhancement something nice to have but it is not neither critical nor urgent request for comments a draft idea that needs more brainstorming, comments are welcome!

Comments

@eldipa
Copy link
Collaborator

eldipa commented Jul 3, 2021

Describe the feature you'd like
byexample allows to run arbitrary code at some points during the execution. These hooks points are described in the Concern interface.

One use case for these concerns/hooks is to enable coverage: the coverage system is initialized at the begin of the execution and at the end it generates a dump with the stats.

An example of this is the coverage.py of byexample.

Other cases could be:

  • enabling measure of performance for the whole execution or per example
  • enabling debug logs

These are the orthogonal things for what Concern was designed for.

But creating a Concern subclass, implement some of its methods in Python it may be to complex, specially for people coming from other languages.

It could be much nicer just say:

byexample -l ruby --enable-ruby-coverage <files>

But that is perhaps too much for byexample.

A tradeoff could be:

byexample -l ruby --inject "ruby:begin:<file>" --inject "ruby:end:<file>"  <files>

More cryptic, sure, but more general too: byexample could inject a ruby file at the begin and at the end of the execution.

byexample doesn't need to know about coverage/performance/debug/etc and the user doesn't need to know about Python and the Concern interface.

@eldipa eldipa added enhancement something nice to have but it is not neither critical nor urgent request for comments a draft idea that needs more brainstorming, comments are welcome! labels Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement something nice to have but it is not neither critical nor urgent request for comments a draft idea that needs more brainstorming, comments are welcome!
Projects
None yet
Development

No branches or pull requests

1 participant