Re: [Spacewalk-devel] Debugging Unit Tests
This sounds like a great idea..I usually use eclipse and unit tests running there and use the eclipse debugger to test stuff.. But doing it in ant will be very useful in cases where running unit tests in a specfic order causes the test to fail. Our continuous build system runs the tests via ant and in some instances ant picks up the unit tests in a order different from what eclipse picks up the unit tests. Problem there is that we cannot pickup which test is causing this error becasue the tests run fine in eclipse Using Jdob's approach this issue can be debugged much easier... Partha Jason Dobies wrote: I'm not sure how others do it (or if this is commonly known), but I was looking to attach a debugger to ant as it runs my test cases. Putting the following lines into the java/buildconf/build-utils.xml file in the junit task (roughly line 77) sets the tests to suspend until the debugger is attached. jvmarg value=-Xdebug/ jvmarg value=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005/ I'd like to look into a set up where we can do something like: ant -Dtestcase=foo -Dtestdebug test But the junit task doesn't support my first idea for how to do that, so it's gonna take a bit more looking. ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
[Spacewalk-devel] Debugging Unit Tests
I'm not sure how others do it (or if this is commonly known), but I was looking to attach a debugger to ant as it runs my test cases. Putting the following lines into the java/buildconf/build-utils.xml file in the junit task (roughly line 77) sets the tests to suspend until the debugger is attached. jvmarg value=-Xdebug/ jvmarg value=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005/ I'd like to look into a set up where we can do something like: ant -Dtestcase=foo -Dtestdebug test But the junit task doesn't support my first idea for how to do that, so it's gonna take a bit more looking. -- Jason Dobies (jason.dob...@redhat.com) RHN Satellite Spacewalk RHCE# 805008743336126 Freenode: jdob @ #spacewalk, #spacewalk-devel ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Debugging Unit Tests
On Tue, Feb 3, 2009 at 7:01 PM, Jason Dobies jason.dob...@redhat.com wrote: I checked in the lines directly into the file, commented out by default: http://tinyurl.com/aeem8w I hope you didn't mind, but I made it so that you can now pass in -Dtestdebug=true and it will invoke the debugger. http://tinyurl.com/br3xsv So you want to run debugger do this: ant -Dtestdebug=true -Dtestcase=FooTest test Don't want the debugger? easy, leave off testdebug: ant -Dtestcase=FooTest test jesus ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Debugging Unit Tests
Ideally test-debug should be the target name instead of test. way more convenient IMHO :) Jesus Rodriguez wrote: On Tue, Feb 03, 2009 at 05:35:58PM -0500, Jason Dobies wrote: I'm not sure how others do it (or if this is commonly known), but I was looking to attach a debugger to ant as it runs my test cases. Putting the following lines into the java/buildconf/build-utils.xml file in the junit task (roughly line 77) sets the tests to suspend until the debugger is attached. jvmarg value=-Xdebug/ jvmarg value=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005/ I'd like to look into a set up where we can do something like: ant -Dtestcase=foo -Dtestdebug test But the junit task doesn't support my first idea for how to do that, so it's gonna take a bit more looking. I just added it but you have to do -Dtestdebug=true. I couldn't get it to work with just -Dtestdebug :) ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel