Spock - exclude test class from being in test report

373 Views Asked by At

I have some tests I'd like to exclude from the spock-report. Is it possible to exclude specific classes or tests from generating it?

1

There are 1 best solutions below

0
On

I don't know of such a feature out of the box but you could write your own report template. just copy the default templates and add your filter code directly to the template.

another way I could imagine is that you run your tests twice and exclude the tests to hide with an @IgnoreIf annotation (http://mrhaki.blogspot.com/2014/06/spocklight-ignore-specifications-based.html?m=1). This could make the decision based on an environment variable.

However, tests are important and it is even more important what has NOT been tested. So you should report that certain tests where excluded in order to have a valid test report.