On 23/02/2011, at 9:50 AM, Neil Chaudhuri wrote: > Thanks for the tips. I have studied things pretty closely, and I confirmed > everything is in the classpath as it needs to be. Moreover, I have configured > my logging appropriately, which is why all the logging in my code appears > when I run my tests with Maven. > > The funny thing is that even if I just add System.out.println() and > System.err.println() statements to my code, those don't show up either when I > run my tests with Gradle. > > It seems like the output from Gradle and the output from my code go to > different output streams. Is there a way to combine them?
Not at the moment. The assumption is that when you're using TestNG, that you're using the TestNG Reporter, the output of which ends up in the TestNG report. So, anything that is written to stdout/stderr by the tests or code under test is discarded. This was probably not a great assumption to make. So, we will offer some way to capture the stdout/stderr output of the tests: http://jira.codehaus.org/browse/GRADLE-1009. One workaround is to use the TestNG ant task. > > Thanks. > > > > -----Original Message----- > From: Merlyn Albery-Speyer [mailto:[email protected]] > Sent: Saturday, February 19, 2011 2:02 PM > To: [email protected] > Subject: Re: [gradle-user] Application Logs During Testing > > Hey Neil, > > I don't know any more than you do by this point. If TestNG tests are > executed under the hood using Ant tasks then this section of the manual > may be helpful: "16.3. Logging from external tools and libraries". > > From skimming the Gradle plugins subproject is appears that stdout and > stderr are expicitly rediected to the testoutput > (CaptureTestOutputTestResultProcessor). I don't use TestNG so I don't > know if there's anything quirky about log configuration. Most likely > this is noise and the real issue you're having is how to best configure > your logger, as you point out. > > You may have some luck configuring your logging using the JVM argument > passing parameters of the Test API: > http://www.gradle.org/0.9.2/docs/dsl/org.gradle.api.tasks.testing.Test.html > > I hope something in there helped. > > Cheers, > Merlyn > > On Sat, 2011-02-19 at 12:33 -0600, Neil Chaudhuri wrote: >> All I see in the console is that the build is successful. The TestNG >> report generated simply contains the test result--the name of the >> test, the time it took to run, the result, etc. >> >> >> There is a lot of logging going on, and I don't see any errors related >> to the logging configuration file not being found. Therefore, it would >> seem that file is in the classpath of the test. And since it all runs, >> the logger itself must be in the classpath as well. >> >> >> Let me know if I can provide further information. >> >> >> Thanks. >> >> >> >> On Feb 18, 2011, at 10:22 PM, Merlyn Albery-Speyer wrote: >> >>> Does the output show up in the test report? >>> >>> On Feb 18, 2011, at 4:19 PM, Neil Chaudhuri wrote: >>> >>>> I have an application with a lot of logging (using SLF4J and >>>> Logback), and I am running a test that is failing to see what the >>>> debug logs tell me. Unfortunately, when I run my test as follows >>>> >>>> clean test –S -Dtest.single=MyTest >>>> >>>> I don’t see any of the application log messages. I do see them >>>> when I run my tests via Maven’s Surefire plugin. >>>> >>>> Note that I am not interested in seeing Gradle’s logging for now >>>> but simply the log messages from my own code. >>>> >>>> I am sure that there is something silly in my configuration, but >>>> any insight is appreciated. >>>> >>>> Thanks. >>> >>> >> >> > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > -- Adam Murdoch Gradle Developer http://www.gradle.org CTO, Gradle Inc. - Gradle Training, Support, Consulting http://www.gradle.biz
