Duplicated tests with enabled code coverage

I have a build configured with ant runner to execute junut task. When i enable code coverage(EMMA) my tests executions are duplicated, and when i turn it off everything becomes ok. I can't figure out what should i do to avoid duplications and provide coverage. Help

4 comments
Comment actions Permalink

Could you please provide build logs when coverage is enabled and without coverage?

0
Comment actions Permalink

Hi Pavel! This is excerpt from my build log. I suppose you generally interested in instrumentation process, so:

[10:50:37]: compile (5s)
[10:50:37]: [compile] echo
[10:50:37]: [echo] project binaries...
[10:50:37]: [compile] Adding debug=true parameter to javac task
[10:50:37]: [compile] javac (4s)
[10:50:37]: [javac] Compiling 237 source files to /home/aashitkin-vm/buildAgent/work/92d4b01b96e53d83/ant-build/build/classes
[10:50:42]: [javac] Note: Some input files use unchecked or unsafe operations.
[10:50:42]: [javac] Note: Recompile with -Xlint:unchecked for details.
[10:50:42]: [compile] EMMA: Instrumenting classes
[10:50:42]: [EMMA: Instrumenting classes] EMMA commandline: [-ix, -*Test*, -cp, /home/aashitkin-vm/buildAgent/work/92d4b01b96e53d83/ant-build/build/classes, -m, overwrite]
[10:50:42]: [EMMA: Instrumenting classes] EMMA: processing instrumentation path ...
[10:50:42]: [EMMA: Instrumenting classes] EMMA: instrumentation path processed in 598 ms
[10:50:42]: [EMMA: Instrumenting classes] EMMA: [214 class(es) instrumented, 0 resource(s) copied]
[10:50:43]: [EMMA: Instrumenting classes] EMMA: metadata merged into [/home/aashitkin-vm/buildAgent/work/92d4b01b96e53d83/coverage.em] {in 96 ms}
[10:50:43]: [compile] echo
[10:50:43]: [echo] copying properties...
[10:50:43]: [compile] copy
[10:50:43]: [copy] Copying 12 files to /home/aashitkin-vm/buildAgent/work/92d4b01b96e53d83/ant-build/build/classes
[10:50:43]: compile.test (1s)
[10:50:43]: [compile.test] echo
[10:50:43]: [echo] building test binaries...
[10:50:43]: [compile.test] Adding debug=true parameter to javac task
[10:50:43]: [compile.test] javac (1s)
[10:50:43]: [javac] Compiling 30 source files to /home/aashitkin-vm/buildAgent/work/92d4b01b96e53d83/ant-build/build/classes-test
[10:50:44]: [javac] Note: Some input files use unchecked or unsafe operations.
[10:50:44]: [javac] Note: Recompile with -Xlint:unchecked for details.
[10:50:44]: [compile.test] EMMA: Instrumenting classes
[10:50:44]: [EMMA: Instrumenting classes] EMMA commandline: [-ix, -*Test*, -cp, /home/aashitkin-vm/buildAgent/work/92d4b01b96e53d83/ant-build/build/classes-test, -m, overwrite]
[10:50:44]: [EMMA: Instrumenting classes] EMMA: processing instrumentation path ...
[10:50:44]: [EMMA: Instrumenting classes] EMMA: instrumentation path processed in 4 ms
[10:50:44]: [EMMA: Instrumenting classes] EMMA: [2 class(es) instrumented, 0 resource(s) copied]
[10:50:44]: [EMMA: Instrumenting classes] EMMA: metadata merged into [/home/aashitkin-vm/buildAgent/work/92d4b01b96e53d83/coverage.em] {in 6 ms}
[10:50:44]: [compile.test] echo
[10:50:44]: [echo] copying test properties...
[10:50:44]: [compile.test] copy
[10:50:44]: [copy] Copying 9 files to /home/aashitkin-vm/buildAgent/work/92d4b01b96e53d83/ant-build/build/classes-test
[10:50:44]: test (47s)
[10:50:44]: [test] echo
[10:50:44]: [echo] running tests...
[10:50:44]: [test] Adding emma to classpath of JUnitTask.
[10:50:44]: [test] junit (47s)
0
Comment actions Permalink

Actually instrumentation part is not very insteresting. It would be great to see the full build log. You can also send log to teamcity-feedback[at]jetbrains.com

0
Comment actions Permalink

Pavel, i've found out the problem is explicitly chosen option import data from xml - if chosen, then results are duplicated. so if you wish this thread could be closed

0

Please sign in to leave a comment.