I’m using Gradle to build and run tests that use TestNG. When I run the tests, Gradle was presenting the log output from the tests in two ways I don’t like.
First, it printed out every time it starts a new test, like this:
Gradle suite > Gradle test > com.foo.Test.test STARTED
I didn’t want that, so I did this:
events “STANDARD_ERROR”
(instead of events “started”, “passed”, “skipped”, “failed”, “standardOut”, “standardError”)
So now Gradle only echoes my stderr, but it also announces what it’s going, with a line like this:
Gradle suite > Gradle test STANDARD_ERROR
Can I get it to just pass the output through to the console without telling me that it’s doing so?
Also, either Gradle or TestNG is printing out lines like this:
Running test: test method […blah blah blah…]
And I don’t really want those, either. Do those come from Gradle, and can I get rid of them?
Well, I tried it, but it’s not doing what I hoped. My listener is getting called. But it’s not called on whatever causes these sort of events to be logged:
My Tests > My Tests STANDARD_OUT
And the standard out is still being printed to the screen even before my listener is called. I imagine this is because I’m just adding the listener, not replacing whatever listener is already in place, as the name of the method (addTestOutputListener) would imply.
Any ideas how to override either or both of those?