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

multi-run reports #9

Open
kowal opened this issue Jun 19, 2015 · 7 comments
Open

multi-run reports #9

kowal opened this issue Jun 19, 2015 · 7 comments

Comments

@kowal
Copy link
Contributor

kowal commented Jun 19, 2015

Awesome project!

I have a quick question.

In my case each rspec invocation has to perform some test-specific setup, for other reasons I can't run them all at once.

How could I handle building cumulative reports from multiple rspec runs? No specs are repeated during those runs. It would be nice to display it on single 'overview' page. Is that currently possible? I could possibly copy generated files after each rspec run into some target directory but how to "merge" overview.html at the end?

thx & have a nice weekend!

@kingsleyh
Copy link
Owner

Hi -it's not possible at the moment. The formatter only knows about the file that is being executed and then after it's finished it generates the report. The only way would be to collect the data from each run somewhere and then use that to generate the report.
This would be quite a lot of work to implement because I'd have to pull out the report generation code and make it re-usable

@kowal
Copy link
Contributor Author

kowal commented Jun 22, 2015

Would it be hard to add ability to store report in other directory - the path could be read from ENV variable? Looking at the https://github.com/kingsleyh/rspec_reports_formatter/blob/master/lib/rspec_html_formatter.rb - maybe something like:

class RspecHtmlFormatter < RSpec::Core::Formatters::BaseFormatter
# ...
  REPORT_PATH = ENV['REPORT_PATH'] || './rspec_html_reports'

If that make sense to you I'm happy to provide a PR.

@kowal
Copy link
Contributor Author

kowal commented Jun 24, 2015

We're switched to our fork, here's PR: #10 if you're interested (it needs tests and docs).

thx

@kingsleyh
Copy link
Owner

I think a good solution would be to write out the data to a directory in something like yaml format for each run and then have each run generate an additional cumulative report based on the data

@kowal
Copy link
Contributor Author

kowal commented Jun 24, 2015

There is actualy a rspec JSON formatter which could be used as a step before html generation.

@kowal
Copy link
Contributor Author

kowal commented Jun 24, 2015

@kingsleyh would you be able to help me a bit with implementing such feature. I don't want to change current behaviour - just make it a special case of more general report generation.

I understand that this can take some time but (if everything goes well) I or someone else from our company will be able to spend some time on this in July. If that's OK, please point where should we start?

@kingsleyh
Copy link
Owner

You could use the json formatter and then write your own standalone script that produces a report based on that.
Or you could modify my code to write out the data and then run a report based on all data in the directory - probably yaml is easiest format

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

No branches or pull requests

2 participants