I’m looking for a way to say, globally, that if a java-based project has tests, the jar or war task that builds them depends on the test task running.
Our organization does not do much JUnit-type testing but it does a little. We have other methods of testing that we do more of. I just found that a test was failing but the project’s jenkins build was never running the test.
There are various ways I could force this to happen on a buiild-script-by-build-script basis, but I am looking for a way that would avoid changing hundreds of build scripts.
One possibility would be to rely on the jenkins templates I use. I could simply add “test” to the list of tasks that each jenkins job runs. However, a minority of these jobs have no java content whatsoever, and therefore no “test” task. I suppose I could add a default test task in such circumstances that does nothing.
Are there any other ideas out there?