sormuras / junit-platform-maven-plugin

Maven Plugin launching the JUnit Platform
Apache License 2.0
61 stars 15 forks source link

No tests found when all disabled #111

Closed delanym closed 1 year ago

delanym commented 1 year ago

When all tests are @Disabled the build should continue without raising a "No tests found" error.

sormuras commented 1 year ago

You may tweak that via https://github.com/sormuras/junit-platform-maven-plugin#error-no-tests-found

Find more low-level tweaks here: https://github.com/sormuras/junit-platform-maven-plugin#plugin-configuration-tweaks

delanym commented 1 year ago

@sormuras but I do want it to fail if there are no tests, just not when there ARE tests and they're all disabled

sormuras commented 1 year ago

Well, then this logic should be either a feature of a custom test plan listener or perhaps the JUnit Platform - I want this plugin to be a "dumb as possible", i.e. delegate to existing features of the Platform.

What the use-case of running an all-disabled test run, anyway?

delanym commented 1 year ago

It would be the same as for a no test run. The reason to make it fail is to get developers to write tests, right?

The reality is that tests get disabled (for whatever reason) and that should not cause the build to fail. Having the build pass with some tests disabled and fail with all tests disabled is surprising behaviour. I would vote for your ticket on Junit platform.

sormuras commented 1 year ago

I would vote for your ticket on Junit platform.

Be our guest! 🤓 https://github.com/junit-team/junit5/issues/new/choose