This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 136650 - Running test in DEBUGGER within NB fails, yet works fine otherwise
Summary: Running test in DEBUGGER within NB fails, yet works fine otherwise
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Testing (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-06 14:40 UTC by stu2
Modified: 2008-06-18 09:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stu2 2008-06-06 14:40:48 UTC
When I run a rails 2.1 test from nb using apple-f6 I get the following consistently:

System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to 
load -- test_helper (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /Users/stu/projects/origin/iter1-stu/test/unit/lead_definition_test.rb:1
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /Users/stu/Downloads/netbeans/ruby2/nb_test_mediator.rb:97:in `add_to_suites'

I can run the tests fine from rake.

Even a simple test like this fails: (I have the shoulda plugin installed)

require 'test_helper'

class LeadDefinitionTest < ActiveSupport::TestCase
  should_have_many :questions

end
Comment 1 Erno Mononen 2008-06-06 14:56:20 UTC
This should be fixed by the fix for issue 136238, please try with the latest build (available at http://
deadlock.netbeans.org/hudson/job/trunk/lastSuccessfulBuild/artifact/nbbuild/dist/zip/) and reopen if this still does 
not work for you - thanks!
Comment 2 stu2 2008-06-06 15:38:56 UTC
I just downloaded the latest nightly from hudson, at http://deadlock.netbeans.org/hudson/job/trunk/lastSuccessfulBuild/artifact/nbbuild/dist/zip/netbeans-hudson-trunk-2183-ruby.zip

Created a new rails 2.1 project, and generated a single model.  Here's the test:

require 'test_helper'

class SimpleTest < ActiveSupport::TestCase
  # Replace this with your real tests.
  def test_truth
    assert true
  end
end

It fails with the same message I reported earlier.  

Looks to me like rails isn't initializing itself when running the test - so test-helper isn't in the load path.  And it works from rake, so it seems the project is 
fine.

Thanks!
Comment 3 Erno Mononen 2008-06-06 15:52:03 UTC
Right, the fix for issue 136238 was to add lib:test to the load path. The same scenario works for me on my Linux, 
perhaps this is system specific - could you please paste the info from the Help -> About dialog? Could you also please 
specify whether you use MRI or JRuby (and the version you use)? 
Comment 4 Erno Mononen 2008-06-06 15:56:24 UTC
Nevermind the MRI/JRuby question, I see that you use MRI. But the info from Help -> About would still be useful. 
Comment 5 stu2 2008-06-06 15:57:09 UTC
Hmm, it looks like I was running a build from yesterday, which wouldn't have included your fix.  Odd - not sure where the one I just downloaded went.

K, download it again and I'll see if I still have the issue (bet not!).  If not I'll update this report and close it.

Thanks for the quick response!
Comment 6 stu2 2008-06-06 16:13:03 UTC
It works!  Sorry, I thought I was running from today's build.  The same test I reported on before now passes.

And here's my version info:

Product Version: NetBeans IDE Dev (Build 20080606123120)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-119
System: Mac OS X version 10.5.3 running on i386; MacRoman; en_US (nb)
Userdir: /Users/stu/.netbeans/dev
Comment 7 Erno Mononen 2008-06-06 16:20:17 UTC
Thanks for confirming! And for reporting too, of course.
Comment 8 stu2 2008-06-06 17:08:53 UTC
I'm reopening this because upon further testing, the issue remains when debugging the test file.  

The details posted before are the same, except while the test successfully runs with apple-f6 (non-debug mode), the same test fails with:

 no such file to load -- test_helper (LoadError)

error when invoking it in debug mode.
Comment 9 Erno Mononen 2008-06-06 22:01:17 UTC
Reproduced, thanks for catching this. In fact running 'debug test' (i.e .ctrl-shift-f6 instead of ctrl-shift-f5) does 
not cause this error, but debugging still does not work. 
Comment 10 Erno Mononen 2008-06-18 09:11:46 UTC
Fixed a while ago, just noticed that IZ swallowed my previous attempt to mark this issue as fixed. Changeset 
#bed154b4e4b5, please reopen if this still does not work for you.