I just started using Travis CI today and there is something I can’t understand. I wanted to disable some of my tests so as usual, I used the @Disabled annotation on my class (or on some of my tests) like this :
import org.junit.jupiter.api.Disabled;
@Disabled
public class TwitterClientTest {
Locally everything is OK, the tests are not launched :
But in TravisCI after having push my branch, the @Disabled annotation is ignored and all the tests are ran and fail:
Your local machine probably has something (local cache, different JUnit version, plugins, etc.) that our VM doesn’t. Try starting with a clean machine (a Docker image or whatever), to confirm.
First, run your tests via mvn verify locally and make sure they pass/skip as expected. Likely, you need to help Surefire here and there to load the JUnit Platform provider.
Then, invoke the same command (mvn verify) on Travis CI.