Be default, Gradle build is abort if any unit tests is failed. Oftentimes, we still need to build the project even the unit test is failed.
To skip the entire unit tests in Gradle build, uses this option-x test
gradle build -x test
Copy
Review a sample output :
1. Default Gradle build :
$ gradle build
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
---------------------------> Unit test task
:compileTestJava
:processTestResources UP-TO-DATE
:testClasses
---------------------------> Unit test task
:test
:check
:build
Copy
2. Gradle build with unit test skipped :
$ gradle build -x test
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
---------------------------> Unit test task
---------------------------> Unit test task
:check
:build
No comments:
Post a Comment