What is causing my rubymine test results runtime to be in days? - ruby

The project I work on is ruby BE, react FE, with end to end tests written in capybara/cucumber.
Due to some configuration file or something I'm guessing, when I run the tests, the output states several hours per test and I'm not sure where this is coming from, any ideas?

That appears to be a known problem in RubyMine:
https://youtrack.jetbrains.com/issue/RUBY-28351/Timing-seems-off-when-running-Cucumber-test
Please add your vote there specifying also the IDE's version.

Related

Update libraries after manual change

So I started working on my first open-source contribution in ruby. There I have the library I'm working on in the /lib/ folder. Now when I tried changing the code, my program (which uses the library) still uses the old code.
For example: Broke a function on purpose by deleting its end keyword (which should be causing an immediate crash), but it kept working perfectly after I did.
Another example was changing the code in such a way it should still work (mutating the output string) but it still returned the old string.
user~$ bin/ruby-hyphen -V "this is a test sentence"
this is a test sen-tence
Does anyone know if I have to tell the runtime to refresh it or something along those lines?
I found out why that happened. The file has a *.gemspec, which made it act as if it was a gem. To see the changes I needed to enter:
gem build *.gemspec
bundle exec rake install
Or, if you want to develop quicker: change everywhere you require it into a require_relative. That should also fix it. I hope this question helps someone in the future!

Sonar Ruby Plugin - Saikuro returns no results

I'm really stuck on this one. I built the Godaddy Ruby plugin for Sonar and it seems to run fine, I can log out results from Cane and others, but at this line:
https://github.com/GoDaddy-Hosting/ruby-sonar-plugin/blob/master/src/main/java/com/godaddy/sonar/ruby/metricfu/MetricfuComplexityYamlParserImpl.java#L38
I get a null pointer exception because Saikuro doesn't seem to be in that object. I'm wondering if I'm missing a configuration item or something. Has anyone seen this problem?
What's more annoying is that if I comment out the offending code, none of the results of the other analysis tools get saved to Sonar. I get a massive MetricFu results.yml but nothing is reported to Sonar.
A quick glance at the code looks like it might rely on the old metric_fu interface... Your version of metric_fu might be too new for the above code. Please enter an issue on the metric_fu issues tracker and we can help you better, there. https://github.com/metricfu/metric_fu/issues

Measure code coverage lost from removing some tests in Ruby

I'm thinking of removing some tests from my test suite. I don't think it'll lead to code being untested, but I'm not certain. Are there any tools that would enable me to identify code that's tested by the tests I want to remove, but not by anything else?
If you are using Ruby 1.9 how about SimpleCov?

Resharper problem with unit tests

I'm having a little annoying problem with resharper trying to run my unit tests, using mstest. I can select an individual unit test and run/debug it fine but when I select the parent node to run a bunch of tests, the tests don't run; it just displays pending for a few seconds and then the test goes grey. If I set breakpoints in the tests and try again with the debugger, I get the same result and no breakpoints are hit. Has anyone else experienced this before?
For anyone using VS2012 update 2 (Charlie obviously wasn't when he asked the question, but for anyone else...), then make sure you have R# version 7.1.3 or later. At the time of this writing, the official release is 7.1.2 so you'll have to follow this link to go download it:
http://download.jetbrains.com/resharper/ReSharperSetup.7.1.3000.1964.msi
(as referenced from http://youtrack.jetbrains.com/issue/RSRP-339987)
Try to rebuild your test project/entire solution.
I sometimes have similar problems where the resharper shows tests that I have removed, or doesn't execute tests for new methods in the SUT project. After a rebuild it gets back in sync.
Ran into this problem aswell with ReSharper 5.0.1659 and VS2010. Turns out that the problem lies somewhere in the testrun config files that VS creates when running test the regular VS way. Removed them from both disc as well as references in solution file which solved the problem and I was able to run the tests with ReSharper again.

What is the ruby test tool called that 'breaks' your code to see how tight your tests are?

A wee while ago I ended up on a page which hosted several ruby tools, which had 'crazy' names like 'mangler' or 'executor' or something. The tool's job was to modify you production code (at runtime) in order to prove that your tests were precise.
Unfortunately I would now like to find that tool again, but can't remember what it was called. Any ideas?
I think you're thinking about Heckle, which flips your code to make sure your tests are accurate. Here:
http://seattlerb.rubyforge.org/heckle/
Maybe you're thinking of the Flay project and related modules:
http://ruby.sadi.st/Ruby_Sadist.html
Also you can try my mutant. Its AST based and currently runs under MRI and RBX in > 2.0 mode. It only has a killer for rspec3, but others are possible also.

Resources