Hi, could someone tell me what version of simplecov works with Rubymine? One of the developers mentioned on a bug that the report format was changed. Rubymine doesn't understand how to properly parse it. I would like to spend sometime resolving this issue. Thus, does anyone have information on simplecov's report format (i.e. current as well as previous)?
Hi Conrad, it seems that Rubymine parses the HTML report, which has seen a lot of changes in the 0.5 branch - see https://github.com/colszowka/simplecov-html/commits/master
I think if you go with a 0.4 version, you should be fine. I think the best thing for Rubymine would be to implement a custom formatter that gets the reported data in some serialized format (xml, json, whatever works best for it) so it can be independent of changes to simplecov html markup modifications. You could check out the bundled simplecov-html or simplecov-rcov, a 3rd-party formatter that puts out RCov-style output to make SimpleCov work with the RCov plugin for Jenkins CI.
Chris, it appears that Rubymine (RM) team has forked mintiest-reporters and added support for RM. Thus, it's very close to complete and I have been playing with it using Minitest and MinitestSpec. Also, I have tried 0.4.x version of simplecov prior to the current RM version and I was experiencing the same issues.
Hi Conrad, do you got something about this? I'm having the same problem that you.
Updated the title. Would be great to hear if you guys figured something out about this.
OK, here's what's currently working with Rubymine (RM) v112.477 in regards to testing and code coverage:
running mintiest and minitest specs using Control-R (generates test results in the right output window and test output in the left. This requires the installation of mintiest-reporters ~> 0.5.0.
SimpleCov support has regressed a bit because I was able to generate a CoverageReport that was a bit off in a prior release but now I'm seeing a parse error within the first beta. Here's the bug reports:
Current Issue - http://youtrack.jetbrains.com/issue/RUBY-10295?projectKey=RUBY&query=simplecov
Previous Issue - http://youtrack.jetbrains.com/issue/RUBY-9927?projectKey=RUBY&query=simplecov
Next, somewhere in between Previous issue and Current Issue things were really really close in regards to code coverage. Furthermore, I'm not seeing the parse error with RSpec but it generates an empty code coverage report.
Last but not least, filters are not working the way one expect. For example, I would simply like to create a whitelist of all the things I would like SimpleCov to perform code coverage. However, the in IDE generates code coverage percentages for almost every file.
Serge of Jetbrains,
Currently filters don't work for simplecov (but works for rcov gem). Simplecov gem supports only "exclude" patterns, so in next 4.0 EAP you can exclude all folders except "lib", e.g.:
@colszowka Is this true?
Just a heads up. simplecov is working absolutely perfectly for me with RubyMine 4.5.2 (build #RM-119.46).
The only gotcha is that I need to "Run all specs in: " the project root. If I "Run all specs in: specs", RM doesn't pick up the coverage, because it ends up in ./spec/coverage instead of ./spec.
I'm happy to consider that a user issue. ;-)
@sheldonh Glad to hear that. The subdir problem probably comes from SimpleCov picking up the current working directory the test suite has been started in. You can set this with SimpleCov.root(Rails.root) when Rails is available, or something else left as an excercise for the reader if not :)
Closing this issue as the guys at Jetbrains seem to have sorted it out.