Are tests in rubygems broken intentionally? - ruby

I've cloned rubygems repo (master branch), launched rake to run tests, and realized that there are a lot of failing specs (22 failures, 41 errors). More than that, sometimes tests running process hangs and doesn't continue until I hit ctrl+c. Am I doing something wrong, or is it intentional behavior?
UPD.
Also, I realized that amount of failures and errors differs from run to run. Tested on ruby 1.9.3 and 2.2.4.

Related

Rake aborted with zero failed test cases

For my product I use rake for the test-case-execution based on Watir and Selenium. The execution is handled by Jenkins.
In the last two runs my test-suite has ran successful (0 errors/failures) anyway in the end of the log I can see, that rake throws and error anyway which leads to a negative run on jenkins because rake has not ended with RC0. Even if the rake message is "Rake aborted" the test-results are written and found by jenkins successfully.
Output:
96 tests, 3992 assertions, 0 failures, 0 errors, 0 skips
Writing XML reports to /home/test/admin/jenkins/system/workspace/projectname/Tests/results
rake aborted!
Version
> gem list rake
rake (12.0.0)
Updating rake to a new version is not possible at the moment because it is a company-wide used machine and for some reason this problem only occures for us.
Nothing more is printed out by rake.
Any ideas what could cause the problem or where to find more informations?

Warning on Heroku with JRuby and Puma: "The signal USR1 is in use by the JVM and will not work correctly on this platform"

Basically, as the title says, logs show the following warning on every restart:
2015-03-30T13:59:14.504047+00:00 app[web.2]: The signal USR1 is in use by the JVM and will not work correctly on this platform
When I tried to google this up only results I got was different deployment errors and people wrongly assuming the warning is the result, but no mention of the warning itself.
Does anybody know what this means and what are the implications? Is there a way to resolve it and should it even be resolved?
We are using JRuby 1.7.16 in 1.9.3 mode & Rails 4.1.1 but the warning has been happening to people using other versions of Rails too
I think this is just a warning that you can ignore. I was getting the same message with guard-jruby-rspec on my local machine. I'm pretty sure it turned out to be something about how Bundler launches a secondary process and then tries to signal it. There is a Puma issue to corroborate this.
Are you running the puma command with bundle exec? I think you can safely remove this on Heroku because there will only be one puma gem installed the slug.

require self made gem in jruby fails after update to jruby-1.7.13

I used jruby-1.7.0 and testing frame work Test::Unit::TestCase. Now I have updated some gems which caused me to use MiniTest::Test for testing, so I also upgraded to jruby-1.7.13. I have a rake task too which builds my gems with java *.class files instead of ruby *.rb files. Now many things dont work any more like 'rake test', or require "my_gem_xyz" from irb, getting errors like load error and ArrayIndexOutOfBoudsException. I have rvm installed to switch between rubies.
How can I use *.class files in my self made gems like it worked before under jruby-1.7.0? (If I include the *.rb files in the gem it seems to work ok)
Some time ago I tried with jruby-1.7.4 but that also failed with similar reasons (at that time I still used Test::Unit::TestCase, so the test frame work is not the problem)
Any ideas?
Frank
I found a surprising solution to the problem. I had compiled the *.rb classes with my jruby version 1.7.0's jrubyc. This caused the tests to fail with the load error. I had to compile all ruby classes with the jrubyc version 1.7.13 where I also build the gems.
update:
'rake test' still does not work comming up with errors like Mocha::ExpectationError: unexpected invocation: ...
what works is to use test options specifiying test file and test name (also with reg.exp.) like
rake test TEST=test/test_bla_bla.rb TESTOPTS="--name=/test_should_read/ -v"
I have the feeling the randomization with the seed parameter causes the problem. How can I influence the seed parameter?
update:
It looks like if there are too many tests in the test suite, MiniTest cannot handle this. In some cases I could run about 10 tests in some up to 35, using the TESTOPTS switch. I always fail if I run all tests in my test library with 'rake test'. This looks like a bug to me. Is there anybody who can help?

Guard running outside of Bundler warning

When I run the guard command it gives the following warning:
Guard here! It looks like your project has a Gemfile, yet you are
running guard outside of Bundler. If this is your intent, feel free
to ignore this message. Otherwise, consider using bundle exec guard
to ensure your dependencies are loaded correctly.
Is this hinting to me that Rails is not configured to work with Bundler correctly, or is it normal? It's not the expected behavior in the tutorial I'm following.
You should run bundle exec guard instead. Or, alternatively, run bundle install --binstubs, then you may run guard with bin/guard (it creates a script at this location). This is the recommended way of running all commands coming from gems installed with bundle install.
(If I understand it correctly) It ensures that you run the specific version of the gem specified in the bundle as well as that this gem will not be able to run gems which are installed on you computer but not included in the Gemfile (which could fool you into believing that you project is fine until you try to run it on a different computer, or a production server, where the other gem would be missing). It also does a lot of of stuff which, frankly, I have no idea about.
More info in the docs.

Ruby rspec command not working could it be because Ubuntu 12 is 64 bit?

I've had lots of headaches on this issue. I'm currently working on an assignment that requires me to use rspec on ruby. Whenever I run the rspec command I keep getting errors like
home/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/core/configuration.rb:780:in 'load': cannot load such file
fro, home/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in 'map'....
They're just endless and confusing. I figure I wasn't doing something right in my .rb files no matter how I tweak according to the test rules same issue. I figured I'd start from scratch with a basic rspec tutorial example, still getting the same errors. I felt it might be my ruby installation so I uninstalled and this time I installed using RVM - still the same errors I get. No matter what I try - simple test codes (assuming maybe my assignment one is buggy), I've tried rspec, rspec spec, rake spec, still the same results.
I'm really confused. I'm new to ruby and my assignment is due in a few days. I have an idea how to write the code I need to get the required results but I have been restricted to use rspec which is really annoying. Then I remembered once when I tried to install LAMPP with my 64 bit Ubunutu and I was told I need to get 32 bit libraries or something, which I did and LAMPP now works (I can't use myphp admin though). So I'm thinking, could it be that I need to get a 32 bit version of Ubuntu 12 instead? Does it have anything to do with my rspec problem or I'm just doing something else wrong?
Oh and yes, I have ruby gems installed. Your answers would be really appreciated guys.
1.) delete your Gemfile.lock file
2.) run bundle install if you want to exclude anything use the --without flag ex: bundle install --without production
3.) run bundle exec rspec spec/
This should make it work now. Let me know.

Resources