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.
When debugging a rake task (and possibly other tasks), if the class has precursor operations like "fixture :all" or "before_xxxx :something", that are breakpointed by the developer, the debugger must stop at the class scoped operations instead of at the first method.
Could you provide more detailed scenario, where you put the breakpoint on which the debugger did not stopped. E.g. following scenario works for me: class Hi def hey puts 'hey' end module_function :hey # breakpoint here end Thanks.
Or simple Rakefile or the snipped would be helpful. Debugger does not recognize whether it runs Rails, Rake or simple script. All is treated the same way.
This is my tarantula test generated for the tarantula plugin from thinkrelevance.com require "#{File.dirname(__FILE__)}/../test_helper" require "relevance/tarantula" class TarantulaTest < ActionController::IntegrationTest fixtures :all def test_tarantula_admin club = Club.find_by_subdomain('myclub') p club.name post '/signin', :username => 'testadmin', :password => 'nimdatset' # assert_response :redirect # assert_redirected_to '/' follow_redirect! t=tarantula_crawl(self) # t.handlers << Relevance::Tarantula::TidyHandler.new t.crawl '/' end def test_tarantula_user club = Club.find_by_subdomain('myclub') p club.name post '/signin', :username => 'testuser', :password => 'resutset' assert_response :redirect assert_redirected_to '/' follow_redirect! t=tarantula_crawl(self) t.handlers << Relevance::Tarantula::TidyHandler.new t.crawl '/' end end In this specific case, "fixtures :all" launches a process to load the fixtures into the test database; however, I am unable to break on this line, or anywhere within the processes this line invokes. The first line I am able to debug/break on is "club = Club.find_by_subdomain('myclub')" within test_tarantula_admin
I see. First what comes to my mind is that the Test Runner 'steals' the interpretation from the debugger and debugger does not get it into the game until the tests are loaded. Just a guess (CCing Erno).
Debugging Rake::TestTask does not work since the task forks execution with Kernel#system call (see Rake::TestTask#define method in Rake source). Will try to find how can be workarounded in NetBeans or whether the patch to Rake is needed. Strange is that you said that you can hit breakpoint inside your test methods. How do you actually trigger the test case, you wrote: > When debugging a rake task (and possibly other tasks), if the class has > precursor operations like "fixture :all" The TarantulaTest had to be loaded by some task. Are you using standard: require 'rake/testtask' If yes, you should not be able to stop on any breakpoint when running through Rake Runner -> test task. Or do you have your own?
I used the Debug Rake Task menu option and selected to debug the Tarantula test task. Since Tarantula is designed to run the TarantulaTest I included above, I put breakpoints in the class methods and launched the task for debug. The key is I needed to start with the fixtures :all and step into the underlying calls for that task to debug a fixture loading issue. Unfortunately, the breakpoint on fixtures :all was skipped. The system did, however, stop on the breakpoint I placed on the first line of the first test method.
*** Bug 182344 has been marked as a duplicate of this bug. ***
This will have to wait still, likely needs changes in the test task itself to be able to hook the debugger when the execution is forked.