Setting max Threshold for test case execution in gradle builds


(arv) #1

Hi,

I am trying to set max threshold on test cases execution in Gradle build files, i.e. lets say I have set a max threshold of 10 seconds for test cases, then build should fail the test case, if the test case takes more than 10 seconds.

Is there any configuration or plugin in Gradle to do that ?


(Mark Vieira) #2

This is something that can be done within most test frameworks I suspect.


(arv) #3

Yeah, we can do in Test frameworks. I am looking for a option to set in gradle build file.
Is there any such configuration that can be set on test case execution.


(Stefan Oehme) #4

You could build something like that based on the beforeTest and afterTest API.


(Mark Vieira) #5

I don’t believe you can fail an individual test using the test listener API. You would have to fail the whole test task.


(Stefan Oehme) #6

You’re right, I misunderstood the question. You’d fail the whole build, yes.