1

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?

woundy
  • 31
  • 2
  • Why would you want to hide information from test results? If tests run, their results should be reported. If they should not run, delete them. If you want to hide failing or ignored tests from being reported, you just cheat on yourself and any stakeholders reading the reports. – kriegaex Sep 23 '18 at 07:58

1 Answers1

1

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.

rdmueller
  • 10,742
  • 10
  • 69
  • 126