Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.2
-
Fix Version/s: 1.1-beta1
-
Component/s: Configuration
-
Labels:None
-
Patch Submitted:Yes
Description
I want to reopen the improvement idea of having TestApp.groovy look after cleaning its test/reports directory.
This is in issue GRAILS-1212 and a few others.
I know that the Clean.groovy has this sort of task, but I want it removed from the Clean.groovy.
My justification for this move is that Clean command is to grand and contains logic that really belongs to TestApp command. The proof that the logic is in the wrong place is that the task contains a hardcoded path:
Ant.delete(dir:"$
{basedir}/test/reports", failonerror:false)The TestApp.groovy has a variable defined as
testDir = "${basedir}
/test/reports"
And thus I would like the following in the TestApp.groovy
Ant.delete(includeEmptyDirs:false, failonerror:false) {
fileset(dir:"$
", includes:"*/*")
}
Further thoughts and comments on this issue.
This issue came to light when we added our grails project to our cruisecontrol server for continuous build.
Our main build loop is:
grails clean
cvs update working_dir
grails customScriptStuff
grails test-app
grails -Dgrails.env=DEV war
grails -Dgrails.env=QA war
grails -Dgrails.env=PROD war
cvs tag working_dir
Then when the build loop completes cruisecontrol collects the war artifacts and the test results. But the way Clean.groovy is today, the grails war command depends on compile, which depends on clean.
The test results were gone until I changed Clean.groovy and TestApp.groovy as mentioned above.
However, a new issue was discovered. Since the clean of the test results does not happen till the test-app part of the build loop, we had test results when the build actually failed running some of our customScript commands.
I would like to see Clean.groovy to have two new things:
1. Not have any specific clean tasks in it, but rather delegate a command to each of the other scripts like TestApp.groovy, Package.groovy, etc
2. an option like -all to execute the clean in the other scripts.
I would then have the build loop as:
grails clean -all (This would delegate to other scripts and clean up temp resources)
cvs update working_dir
grails customScriptStuff
grails test-app (clean is not required as the "Big" clean is complete)
grails -Dgrails.env=DEV war
grails -Dgrails.env=QA war
grails -Dgrails.env=PROD war
cvs tag working_dir
Then the TestApp.groovy should call it's own clean when the command test-app is called on its own.