1

We're using Gradle to run our Selenium tests on a Jenkins server. I'm using the code shown here to display tests passing or failing as they run.

But what I'd really like to see is a running total, like what Gradle shows (animated) when I run tests on my local console:

enter image description here

I suppose because it's rewriting the same console lines, this doesn't show up in Jenkins. Is there a way to get this X tests completed, Y skipped, Z failed text to print out permanently in the console every time it changes?

Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211

1 Answers1

0

You can write your own test listener for this:

def testStats = [:]
test {
    afterTest { desc, result ->
        testStats[result.resultType] = (testStats[result.resultType] ?: 0) + 1
        logger.quiet "Executed test ${desc.name}, $testStats"
    }
}
Zbynek
  • 412
  • 4
  • 17