-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
Description
The code coverage report doesn't seem to get generated when using the new forked execution introduced in Grails 2.3.
To reproduce the issue (tried on both windows and linux):
- create a new Grails 2.3.0 application
- create a simple domain class with a unit test
- install the latest code-coverage plugin (v1.2.6)
- run
grails test-app -coverage
- the coverage report is not generated
As a workaround, you can turn off the forked execution and the code-coverage report is created.
The default Grails 2.3.0 settings in conf/BuildConfig.groovy
for forking a new process:
grails.project.fork = [
// configure settings for the test-app JVM, uses the daemon by default
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
...
]
Then the console output includes:
| Instrumenting classes for coverage
| Instrumenting classes for coverage.
| Instrumenting classes for coverage..
| Instrumenting classes for coverage...
| Instrumenting classes for coverage....
| Instrumenting classes for coverage.....
...
Flushing results...
Flushing results done
Cobertura: Loaded information on 54 classes.
Cobertura: Saved information on 54 classes.
Flushing results...
Flushing results done
...
If you change the setting to
grails.project.fork = [
test: false,
...
]
Then the console output is as follows - and the reports are generated:
| Instrumenting classes for coverage
| Instrumenting classes for coverage.
| Instrumenting classes for coverage..
| Instrumenting classes for coverage...
| Instrumenting classes for coverage....
| Instrumenting classes for coverage.....
...
Flushing results...
Flushing results done
Cobertura: Loaded information on 54 classes.
Cobertura: Saved information on 54 classes.
Done with post processing reports in 10ms
| Cobertura Code Coverage Complete (view reports in: E:\work\coverage-example\target\test-reports/cobertura)
Flushing results...
Flushing results done