Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0.2
-
Component/s: None
-
Labels:None
Description
I have a script in a plugin that I would like to run using the "test" environment, e.g.
grails test test-app-cobertura
I would like the ability to somehow automatically set the environment without having to type it on the command line. GrailsScriptRunner.groovy specifies default environments for some tasks:
static DEFAULT_ENVS = ['war': 'prod','test-app':'test','run-webtest':'test']
Perhaps one solution would be apply a convention, e.g. if a script name begins with test-* (or maybe even test-app-*), then use the test environment.
Issue Links
| This issue duplicates: | ||||
| GRAILS-2434 | Allow scripts to define default environment |
|
|
|
| This issue is related to: | ||||
| GPCODECOVERAGE-10 | code coverage use development environment |
|
|
|
scripts can now add a property like
scriptEnv = "development"
To the top of the script above the includeTargets calls such as
includeTargets << new File ( "${grailsHome}/scripts/TestApp.groovy" )
The Init.groovy script calls a target called setupEnvironment automatically that looks for this setting in the binding