You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Manjula Kutty <ma...@gmail.com> on 2008/03/27 18:35:06 UTC
EMMA Code coverage
I tried running the code coverage using the Wiki page instructions. But for
me the instrumentation failed. I thought all the relevant patches are
committed? Is there any other patch I have to apply before running?
--
Thanks,
Manjula.
Re: EMMA Code coverage
Posted by Vemund Ostgaard <Ve...@Sun.COM>.
Manjula Kutty wrote:
> Yes first time it was empty. I tried running this by taking a new
> windows with new env setting and I got a report file. But still there
> some errors when I redirected the ant emma-all to an output file. It
> is like this
Someone (I think Dan as part of the jmx work) made a fix at some point
to make the error output from spawned network servers visible in the ant
output, and this exposed most of the errors you are seeing. These
problems were not visible when the EMMA work was first committed, though
they have been there all the time. I've been planning to fix it but been
stalled by other things, I'll send a reply to this thread when I've
gotten around to it.
From your output I see that there are other testfailures and errors as
well, and some noise related to EMMA permissions that is not because of
the spawned network servers. Probably new tests have been added that
need to be adapted to EMMA as well, and maybe some test failures are not
related to EMMA at all.
At the very end, the <emma-all> target will force a build failure if one
or more tests failed, but this happens after all reports have been
produced. Your coverage numbers will miss input from the code that did
not have permission to write to EMMAs coverage.ec file, but should
contain all the data from the other tests.
Vemund
>
> checkVMLevel:
>
> START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
> [junit] java.security.AccessControlException: access denied
> (java.io.FilePermission coverage.ec <http://coverage.ec> read)
> [junit] at
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
> [junit] at
> java.security.AccessController.checkPermission(AccessController.java:427)
> [junit] at
> java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> [junit] at
> java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> [junit] at java.io.File.exists(File.java:700)
> [junit] at
> com.vladium.emma.data.DataFactory.persist(DataFactory.java:525)
> [junit] at
> com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
> [junit] at
> com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:595)
> [junit] Exception in thread "EMMA shutdown handler thread"
> java.lang.RuntimeException: EMMA failed to dump coverage data:
> java.security.AccessControlException: access denied
> (java.io.FilePermission coverage.ec <http://coverage.ec> read)
> [junit] at
> com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
> [junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
> [junit] at java.lang.Thread.run(Thread.java:595)
> [junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
>
> This one occured quites few times
>
> and in the last
>
>
> emma-all:
>
> BUILD FAILED
> C:\derbydev\trunk\build.xml:2199: EMMA instrumented tests failed!
>
> Total time: 118 minutes 0 seconds
>
> I'm attaching the full output file.
>
> Thanks
> Manjula
>
> On 3/28/08, *Daniel John Debrunner* <djd@apache.org
> <ma...@apache.org>> wrote:
>
> Manjula Kutty wrote:
> > I tried ant emma-all.
> >
> > The following error was on the screen
> > BUILD FAILED
> > C:\derbydev\trunk\build.xml:2199: EMMA instrumented tests failed!
> > It didn't create any other report file
>
> So the junit_<date> folder was empty?
>
> Dan.
>
>
>
>
> --
> Thanks,
> Manjula.
Re: EMMA Code coverage
Posted by Manjula Kutty <ma...@gmail.com>.
Yes first time it was empty. I tried running this by taking a new windows
with new env setting and I got a report file. But still there some errors
when I redirected the ant emma-all to an output file. It is like this
checkVMLevel:
START-SPAWNED:SpawnedNetworkServer ERROR OUTPUT:
[junit] java.security.AccessControlException: access denied (
java.io.FilePermission coverage.ec read)
[junit] at java.security.AccessControlContext.checkPermission(
AccessControlContext.java:264)
[junit] at java.security.AccessController.checkPermission(
AccessController.java:427)
[junit] at java.lang.SecurityManager.checkPermission(
SecurityManager.java:532)
[junit] at java.lang.SecurityManager.checkRead(SecurityManager.java
:871)
[junit] at java.io.File.exists(File.java:700)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java
:525)
[junit] at com.vladium.emma.data.DataFactory.persist(DataFactory.java
:86)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData
(RTCoverageDataPersister.java:54)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:595)
[junit] Exception in thread "EMMA shutdown handler thread"
java.lang.RuntimeException: EMMA failed to dump coverage data:
java.security.AccessControlException: access denied (java.io.FilePermission
coverage.ec read)
[junit] at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData
(RTCoverageDataPersister.java:71)
[junit] at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
[junit] at java.lang.Thread.run(Thread.java:595)
[junit] END-SPAWNED :SpawnedNetworkServer ERROR OUTPUT:
This one occured quites few times
and in the last
emma-all:
BUILD FAILED
C:\derbydev\trunk\build.xml:2199: EMMA instrumented tests failed!
Total time: 118 minutes 0 seconds
I'm attaching the full output file.
Thanks
Manjula
On 3/28/08, Daniel John Debrunner <dj...@apache.org> wrote:
>
> Manjula Kutty wrote:
> > I tried ant emma-all.
> >
> > The following error was on the screen
> > BUILD FAILED
> > C:\derbydev\trunk\build.xml:2199: EMMA instrumented tests failed!
> > It didn't create any other report file
>
> So the junit_<date> folder was empty?
>
> Dan.
>
>
--
Thanks,
Manjula.
Re: EMMA Code coverage
Posted by Daniel John Debrunner <dj...@apache.org>.
Manjula Kutty wrote:
> I tried ant emma-all.
>
> The following error was on the screen
> BUILD FAILED
> C:\derbydev\trunk\build.xml:2199: EMMA instrumented tests failed!
> It didn't create any other report file
So the junit_<date> folder was empty?
Dan.
Re: EMMA Code coverage
Posted by Vemund Ostgaard <Ve...@Sun.COM>.
Thomas Nielsen wrote:
> Vemund Ostgaard wrote:
>> * You need to download emma.jar and emma_ant.jar and put them in your
>> tools/java/ directory.
>
> Could we have the emma target check for presence of emma.jar and post
> a friendly errormessage if it can't find it?
I guess we could do that. I did a quick check to see what is actually
printed if both of these jars are missing and saw the following:
BUILD FAILED
/usr/local/cluwin/vo136787/derby/source/trunk/build.xml:2185: Problem:
failed to create task or type emma
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
So, I guess this is not what happened to Manjula, and it could be more
informative than this.
I'm looking at a different EMMA issue, to get the right permissions set
for some tests that spawn a network server with a default policy. I'll
see if I can improve the output if emma*.jar is missing as well.
Come to think of it, would it be possible to just have emma.jar and
emma_ant.jar checked into the derby codeline under tools/java/ to avoid
developers having to download it themselves, figuring out what version
to use, etc.?
As far as I can see EMMA has a CPL v1.0 license;
http://emma.sourceforge.net/license.html
Anyone know if that would be a problem?
Vemund
Re: EMMA Code coverage
Posted by Thomas Nielsen <Th...@Sun.COM>.
Vemund Ostgaard wrote:
> * You need to download emma.jar and emma_ant.jar and put them in your
> tools/java/ directory.
Could we have the emma target check for presence of emma.jar and post a
friendly errormessage if it can't find it?
Thomas
--
Thomas Nielsen
Re: EMMA Code coverage
Posted by Vemund Ostgaard <Ve...@Sun.COM>.
Manjula Kutty wrote:
> I tried ant emma-all.
>
> The following error was on the screen
> BUILD FAILED
> C:\derbydev\trunk\build.xml:2199: EMMA instrumented tests failed!
> It didn't create any other report file
Hi Manjula, I don't know of many reasons for this to fail, the
possibilities I can think of are:
* You need to download emma.jar and emma_ant.jar and put them in your
tools/java/ directory.
* If you run with ant 1.7 it should be sufficient that junit.jar is in
your tools/java/ directory. If you run with ant 1.6.* you probably need
to make sure that both junit.jar and ant-junit.jar is in ants classpath
using -lib option for instance.
* The build will fail if one of the tests fail, but that should still
have produced reports, etc.
Is there no more output than what you have pasted above, from the
targets that are executed before <emma-all> which it depends on?
Vemund
Re: EMMA Code coverage
Posted by Manjula Kutty <ma...@gmail.com>.
I tried ant emma-all.
The following error was on the screen
BUILD FAILED
C:\derbydev\trunk\build.xml:2199: EMMA instrumented tests failed!
It didn't create any other report file
On 3/27/08, Daniel John Debrunner <dj...@apache.org> wrote:
>
> Manjula Kutty wrote:
> > I tried running the code coverage using the Wiki page instructions. But
> > for me the instrumentation failed. I thought all the relevant patches
> > are committed? Is there any other patch I have to apply before running?
>
> What was the failure, what commands did you execut
>
--
Thanks,
Manjula.
Re: EMMA Code coverage
Posted by Daniel John Debrunner <dj...@apache.org>.
Manjula Kutty wrote:
> I tried running the code coverage using the Wiki page instructions. But
> for me the instrumentation failed. I thought all the relevant patches
> are committed? Is there any other patch I have to apply before running?
What was the failure, what commands did you execute?
Dan.