spring-data-mongodb
spring-data-mongodb copied to clipboard
Fail the build when Mongo not running and tests are active
Mongo is required to be running for Spring Data Mongo DB tests to pass. It would be beneficial to fail the build when skip tests is NOT turned on. In other words if someone is skipping the tests then we don't care if Mongo is running or not.
Additional note: Mongo must be running without a custom username and password, otherwise the tests will fail due to connection being unauthorized
Current findings and trials
- We created a JUnit extension that would fail when there's no Mongo. The problem with that was that the automatically registered extension would be registered AFTER the Spring one which means that the context would fail to start after 30-40 seconds and only after that would the extension be called what of course beats the purpose of failing fast
- There was reluctance from the team to add solutions that would be called during the build (wget to access Mongo, Groovy script, static void main in Java) because they wouldn't fail when running tests in the IDE
We've decided to close the PR for now and come back to this in the future