When disabling tests with a @Disabled
* / @Enabled
* annotation, those tests will be skipped as expected, but the surefire test runner also shows a [WARNING]
in front of the result line for the affected class. My understanding is a dev team should only see warnings for things requiring further attention, hence i agree having a warning for certain tests (i.e. that were temporarily disabled due to an unresolved bug) can be a good thing.
Now: The test suite i'm writing covers code that is specific to different operating system environments – some of the tests only make sense to be executed when run in a windows environment, for example. Hence there is no point in issuing a warning for such tests (which are annotated with @EnabledOnOs(OS.WINDOWS)
) as they are absolutely fine and skipping is expected (mandatory actually) – so there is simply no ToDo or issue here.
How can we control which skipped tests will result in a warning (i.e. via the @SuppressWarnings
annotation or by some surefire configuration option)?
-Dgroups=!windows
negation trick, did not know about this. Combined with tags that may provide a feasible way to reduce the unwanted warnings. However, i'm still looking for a fine-grained control over warning vs. info, b/c a warning will also be shown if an assumption is not met (i.e. headless vs. non-headless tests), which may be expected behaviour and shouldn't be graced with a warning. Apart from that do you know if one can also supply a default value forgroups
inpom.xml
? – Blenny