I’m working on porting a maven build I have, and I’m running into problems in the test phase when running testng tests.
As a background, my TestNG tests all extend spring-test’s AbstractTransactionalTestNGSpringContextTests, which means there are some inherited @Before tags which are responsible for reading my spring application context from bean files and dynamically injecting needed beans into my Test class before executing any of the tests.
Turns out I misconfigured my test resources to point to the wrong directory, so spring couldn’t find my application context files. As a result, an exception was thrown, but rather than marking the tests as failed, they were marked as ‘skipped’. Since they were not marked as ‘failed’, gradle thought everything was good and continued on with the build.
Is there away to configure gradle or testng to fail the build in this case? This is the behavior I have see in maven. Maven still marks the tests as skipped, but the build fails.
Hopefully if I can get this resolved, it will help persuade folks to consider officially supporting gradle in our org.