Grails

TestApp.groovy calls exit(0) upon completion

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.0-RC4
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes

Description

The TestApp.groovy script calls exit(0) upon completion. I'm trying to write a script that would leverage the TestApp.groovy script but I need to do some processing AFTER the tests run. I was hopping I could write a simple GANT script that would do something like the following:

includeTargets << new File ( "${grailsHome}/scripts/TestApp.groovy" )
...
doSomePreProcessing()
testApp()
doSomePostProcessing()
...

But since the "processResults" target (which is called by testApp()) calls exit(0) when it's done running tests and creating reports, my "doSomePostProcessing" target never gets executed.

Is the exit(0) really needed? Don't gant scripts already provided return codes (http://gant.codehaus.org/Return+Codes)? If it's not explicitly needed, can it be removed? Patch attached.

Activity

Hide
Graeme Rocher added a comment -

It needs to call exit to participate correctly in continuous integration servers. I don't want to remove it now just in case it breaks something, however when you include TestApp you can quite easily override exit simply by defining your own version that does nothing

Show
Graeme Rocher added a comment - It needs to call exit to participate correctly in continuous integration servers. I don't want to remove it now just in case it breaks something, however when you include TestApp you can quite easily override exit simply by defining your own version that does nothing
Hide
Mike Hugo added a comment -

Thanks! After a little playing around, I was able to do that. I just had to put the name of the target in quotes:

target('exit':"override exit") {
//TODO - ignore '0' exit code, process any other return code (e.g. -1)
}

Show
Mike Hugo added a comment - Thanks! After a little playing around, I was able to do that. I just had to put the name of the target in quotes: target('exit':"override exit") { //TODO - ignore '0' exit code, process any other return code (e.g. -1) }
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: