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

EventProf Minitest support #21

Closed
palkan opened this Issue Sep 21, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@palkan
Owner

palkan commented Sep 21, 2017

Add Minitest integration support to EventProf.

Implementation ideas

Tracking

I propose to use minitest-reporters for tests tracking purposes (at least for now). It works pretty similar to RSpec reporter listeners, so could be easily integrated with EventProf core functionality.

Configuration

We should support both env variables and CLI options (thus, we have to provide a Minitest plugin (see Rails plugin, for example)):

# that should work
EVENT_PROF=sql.active_record rake test

# and that too
ruby my_test.rb --event_prof=sql.active_record
@IDolgirev

This comment has been minimized.

Contributor

IDolgirev commented Sep 27, 2017

Hi!
Well, I believe I'm quite close to finalize this but I've faced with problem to get location of example group for proper report results.

Technically, any Minitest reporter receives such group as a Class object and example name as String in prerecord hook. I can track down location for examples via source_location, but can't find a robust solution to get the same for group definition.

Possible solution is to get location of the first example of the group (probably we can subtract one line and believe that there is no blank line between group definition and example definition ) and use it as a group location.
Another one is to explicitly show in group location something like 'FILE: around line XX', where XX is the location of the first group example as well.

Any thoughts or ideas?
Thanks in advance!

@palkan

This comment has been minimized.

Owner

palkan commented Sep 27, 2017

Hi!

I think, we can just use a file path without the line number for a group location. WDYT?

@IDolgirev

This comment has been minimized.

Contributor

IDolgirev commented Sep 27, 2017

I like such simplicity :)

@palkan

This comment has been minimized.

Owner

palkan commented Oct 2, 2017

Closed by #29

@palkan palkan closed this Oct 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment