Closed quinton-hoole closed 5 years ago
@quinton-hoole : I checked this issue and please find my analysis below. 1) 'runapp' task no relation with 'runenvapp' task. runenvapp task will be SUCCESSFUL always even 'runapp' task fails/success. 2) I fixed this by using the "runenvapp.finalizedBy runapp". In this case, if 'runenvapp' task status will be decided by 'runapp' task.
task runenvapp(type: ExecWait, dependsOn: ksTask) {
command './gradlew ' + project + ':runapp'
//If any failures in 'runapp' task then 'runenvapp' task also should fail.
finalizedBy runapp
}
3) Here cleaning (closing oms port, ks ports) in failure case is not happening because the Gradle is not continuing further tasks.
If the user wants to execute all tasks including success/fail case then ./gradlew --continue examples:hankstodo:run should give.
Old way: /gradlew examples:hankstodo:run After this fix: /gradlew --continue examples:hankstodo:run
Please confirm whether this is ok or any suggestions on the same. Thank you!
Before fix:
After fix:
Thanks @maheshrajus. I think we need to figure out a way to clean up automatically, even on failure. Can you perhaps use the finalizedBy trick to do that? e.g. add something like "finalizedBy cleanup" at the end of runEnvApp?
I don't think it's reasonable to expect everyone to remember to add the --continue option in runs after tests fail.
Fixed by #806
See details below, in particular note the following:
Task :examples:hanksTodo:runapp FAILED
FAILURE: Build failed with an exception.
... but then, magic happens! ...
BUILD SUCCESSFUL in 54s 5 actionable tasks: 5 executed
It seems that the gradle script in examples/build.gradle is buggy.