VerboseReporter output appearing when other listeners are used

248 views
Skip to first unread message

Chris Riccio

unread,
May 3, 2012, 4:09:35 PM5/3/12
to testng-users
I am working on upgrading my test system from testng 6.2 to 6.5.1
I had it configured to use the DotTestListener, and verbose to 1, so
that the only output from running tests was the dots (and the
occasional F's)
Now in 6.5.1 i'm getting dots and then VerboseReporter output together

the output i see:
[testng] .[VerboseTestNG] INVOKING CONFIGURATION: "groupname" -
@BeforeClass com.foo.MyTests.setUp()
[testng] .[VerboseTestNG] PASSED: "groupname" -
com.foo.MyTests.testname() finished in 3 ms
etc

Note the [testng] and the dot before the VerboseTestNG tag.

From what i've read, The VerboseReporter won't output anything if i
haven't started ant in verbose mode, and if my testng verbose level is
less than 5
Both of those are true for me (ant is not in verbose mode, testng
verbose level is 1)

if i remove the DotTestListener, then i don't get any output at all

How can i configure this to get back only the dots?

extra info

TestNG 6.5.1
Ant 1.8.2

my ANT_OPTS are: -Xmx1024M -Dfile.encoding=Cp1252

my testng task looks like:
<testng
verbose="1"
useDefaultListeners="false"
listeners="org.testng.reporters.DotTestListener"
>

Cédric Beust ♔

unread,
May 3, 2012, 5:59:11 PM5/3/12
to testng...@googlegroups.com
Can you post a small testng.xml and small class file that shows the problem? The verbose listener should only kick in if verbose > 4.

-- 
Cédric





--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.


Chris Riccio

unread,
May 3, 2012, 6:43:20 PM5/3/12
to testng...@googlegroups.com
Hi Cédric

attached is a simple repro. It only contains a build.xml, testng-6.5.1.jar and SimpleTest.java (the same one from the testng homepage)
when i run ant, this is what i see:

   [testng] [TestNG] Running:
   [testng]   Ant suite
   [testng] 
   [testng] Fast test
   [testng] .
   [testng] Slow test
   [testng] .[VerboseTestNG] PASSED: "Ant test" - SimpleTest.aSlowTest() finished in 0 ms
   [testng] 
   [testng] ===============================================
   [testng] Ant suite
   [testng] Total tests run: 2, Failures: 0, Skips: 0
   [testng] ===============================================
   [testng] 

thanks
Chris
verboseissue.zip

Cédric Beust ♔

unread,
May 3, 2012, 6:49:00 PM5/3/12
to testng...@googlegroups.com
Ok I see the same output you're seeing. Two quick thoughts: 1) it might be unavoidable since DotTest reports on each test as it happens, so it can mix up its output with another listener doing the same thing and 2) this might be due to the fact you're calling TestNG directly from ant (without a testng.xml).

-- 
Cédric




--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/cgc8_m18vyEJ.

Chris Riccio

unread,
May 4, 2012, 2:01:35 PM5/4/12
to testng...@googlegroups.com
So it is likely the first item, which implies that you can't have multiple listeners that provide live output, since they will pollute each other. Is there a way to disable the VerboseReporter then? I would have expected useDefaultListeners="false" to have done that.

It's not the second item, i switched the same to use this testng.xml file and it has the same result

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1" >
    <test name="Regression1"   >
        <packages>
            <package name="com.*" />
        </packages>
    </test>
</suite>

thanks!
Chris

Cédric Beust ♔

unread,
May 4, 2012, 2:31:59 PM5/4/12
to testng...@googlegroups.com
Yes, it should be disabled if you specify useDefaultListeners=false. There might be a bug in the way the ant task passes this flag to TestNG.

-- 
Cédric




--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/8-0WE9i_H6sJ.

Lukas Jungmann

unread,
May 5, 2012, 5:00:27 AM5/5/12
to testng...@googlegroups.com
Hi,

On Fri, May 4, 2012 at 8:31 PM, Cédric Beust ♔ <ced...@beust.com> wrote:
> Yes, it should be disabled if you specify useDefaultListeners=false. There
> might be a bug in the way the ant task passes this flag to TestNG.

actually my intention wrt verboselistener and Ant was that, in this
particular case, listener should be always present. and its output
should be controlled using Ant's default '-verbose' option (in the
other words - messages are always logged but the user is able to see
them only using ant's '-v' option (or TestNG's verbose > 5), logic for
this is directly in TestngAntTask).

With Chris' sample project (thanks Chris!) I managed to reproduce the
issue and already did some debugging and from what I see it is
DotTestListener who is printing out more messages than it should. I'm
still looking for the fix...

Thanks,
--lukas

Chris Riccio

unread,
May 11, 2012, 4:27:37 PM5/11/12
to testng...@googlegroups.com
Hi,

For now i've removed the DotTestListener from my configuration, but the end result is that i don't get any output at all. For a small test project that's not a big deal, but my real project has quite a few tests in it, and not having some sort of progress indicator creates confusion - some folks think the tests are hung. 

How would i get simple progress without using ant in verbose mode, and without bumping up testng's verbose mode?

thanks
 

On Saturday, May 5, 2012 2:00:27 AM UTC-7, Lukas Jungmann wrote:
Hi,

Chris Riccio

unread,
May 23, 2012, 3:45:39 PM5/23/12
to testng...@googlegroups.com
Hi Cedric,

There is a bug in the ant task - VerboseReporter is always added. I filed a bug for this.

thanks
Chris
Reply all
Reply to author
Forward
0 new messages