I am working on a multi module grails project which uses gradle or build.
Consider my project as below:
MainApp —>Project1 ---->Project2
Consider two projects are under the main project and there are some test files inside project 1 and 2. And, consider the test case fails in project 1.
When i execute the below command, it starts exectuing project 1 and the test case fails in project 1 and it stopped execution, it is not executing project 2. Can you let me know why.
Obviously, it should fail if there is a compilation issue. But, I would like gradle to run all the junits irrespective of any pass/faulre results. This is because, it will have a test-result file, which shows in which test it failed.
Can you please let me know, if we can do that in gradle. How to contiue the build even if the junit test case fails.
“When executed with --continue, Gradle will execute every task to be executed where all of the dependencies for that task completed without failure”… “For example, tests will not run if there is a compilation failure in the code under test”
If you want everything else to fail normally, but to continue along with failing tests, then you can simply use
test.ignoreFailures true
, which can also be expressed this way:
test {
ignoreFailures true
}
That would go into the individual build.gradle files you want it to take effect for, or you could configure it for allprojects, subprojects, or selectively based upon plugins.