No code coverage on JUnit test tasks and not all the tests are executed

Hi,

I've now a problem with my TeamCity configurations. My JUnit test tasks are executed but no code coverage report are generated. But the code coverage metadata (.em) are collected.

And i've an other problem. I modified the test class after and commited my changes, but the test method i added is not executed, like team city use a cache for the test classes...

The TeamCity configuration is :

General settings


Name: JTheque Stats Module
Description: none
Build number format: {0}, next build number: #21
Artifact paths: none specifed
Fail build if:
process exit code is not zero: ON
at least one test failed: ON
an error message is logged by build runner: ON
it runs longer than:           no limit
out of memory or crash is detected: ON

Build options:
hanging builds detection: ON
status widget: OFF
maximum number of simultaneously running builds: unlimited

Version control settings

VCS checkout mode: Automatically on server


Checkout directory:         M:\Server\Build\src\modules\JTheque Stats Module
Clean all files before build: OFF
VCS labeling:                    disabled
Attached VCS roots:
Name Checkout rules Set label
JTheque Stats Module Repository not specified NO

Runner: Ant

Type of runner: Ant (Runner for Ant build.xml files)
build.xml file:               build.xml
Working directory:   same as checkout directory
Targets: server-build
JDK home path: C:\Program Files (x86)\Java\jdk1.6.0_06
JVM command line parameters: not specified
Reduce test failure feedback time: OFF
Code coverage:               enabled
Coverage instrumentation parameters: -ix -*Test*
Include source files in coverage data:               ON
XML report processing:               disabled

Build triggering

Build configuration is active (triggering enabled).
Trigger build by vcs check-in: ON
Quiet period:                               default, 60 seconds
Start new build if last build is failed: OFF
Triggering by time: not configured
This configuration depends on: not configured

This configuration depends on: not configured
          


Here is my ant build.xml file :


<?xml version="1.0" encoding="UTF-8"?>
<project name="JTheque Stats Module" basedir="." default="server-build">
    <property name="project.name" value="JTheque Stats Module"/>
    <property name="project.jar" value="JTheque-Stats-Module.jar" />
    <property name="project.type" value="modules"/>
    <property name="project.subdir" value="modules"/>
    <property name="project.dir" value="N:\Programmation\WorkDirectory\JTheque\current" />
    <property name="test" value="/org/jtheque/films/stats/tests"/>



    <property name="jtheque.workspace" value="N:/Programmation/Workspaces/Intellij Idea Workspace/JTheque"/>
    <property name="jtheque.out" value="${jtheque.workspace}/out/production"/>
    <property name="project.bin.dir" value="${jtheque.out}/${project.name}"/>
    <property name="output.jar.dir" value="${project.dir}/${project.subdir}"/>
    <property name="junit.jar" value="${jtheque.workspace}\JTheque Tests\lib\junit-4.5.jar"/>



    <property name="server" value="M:\Server\Build"/>
    <property name="server.output.src.dir" value="${server}/src/${project.type}/${project.name}/src/"/>
    <property name="server.output.bin.dir" value="${server}/bin/${project.type}/${project.name}/"/>
    <property name="server.output.build.dir" value="${server}/builds/${project.type}/${project.name}/"/>



    <path id="master-classpath">
        <pathelement path="${java.class.path}" />
        <path id="libs" location="${project.dir}">
            <fileset dir="${project.dir}/lib/">
                <include name="**/*.jar"/>
                <include name="*.jar"/>
            </fileset>
        </path>
        <path id="modules" location="${project.dir}">
            <fileset dir="${project.dir}/modules/">
                <include name="*.jar"/>
            </fileset>
        </path>
        <path refid="libs"/>
        <path refid="modules"/>
        <pathelement path="C:\Program Files (x86)\Java\jdk1.6.0_06\jre\lib\rt.jar"/>
        <pathelement location="${project.dir}\JTheque-Core.jar"/>
        <pathelement location="${junit.jar}"/>
    </path>



    <!-- Clean build directory -->
    <target name="clean">
        <delete dir="${server.output.bin.dir}" includeEmptyDirs="true"/>
    </target>



    <!-- Compile java files -->
    <target name="compile" depends="clean">
        <mkdir dir="${server.output.bin.dir}"/>
        <javac srcdir="${server.output.src.dir}" destdir="${server.output.bin.dir}"
               fork="true" source="1.6" target="1.6">
            <classpath refid="master-classpath"/>
        </javac>
    </target>



    <!-- Copy ressources !-->
    <target name="copyRessources" depends="compile">
        <copydir src="${server.output.src.dir}" dest="${server.output.bin.dir}">
            <exclude name="**/*.java"/>
            <exclude name="**/package.html"/>
        </copydir>
    </target>



    <!-- Generate Javadoc -->
    <target name="generateDoc" depends="copyRessources">
        <javadoc sourcepath="${server.output.src.dir}" destdir="${server.output.build.dir}/doc" access="private" bootclasspathref="master-classpath" classpathref="master-classpath" />
        <zip destfile="${server.output.build.dir}/${project.name}_doc.zip" basedir="${server.output.build.dir}/doc" />
        <delete  dir="${server.output.build.dir}/doc" />
    </target>



    <!-- Generate src archive -->
    <target name="generateSrc" depends="generateDoc">
        <zip destfile="${server.output.build.dir}/${project.name}_src.zip" basedir="${server.output.src.dir}" />
    </target>



    <!-- Build JAR files-->
    <target name="server-build1" depends="generateSrc">
        <delete file="${server.output.build.dir}/${project.jar}"/>
        <jar destfile="${server.output.build.dir}/${project.jar}"
             basedir="${server.output.bin.dir}" manifest="MANIFEST.MF"/>
    </target>



    <!-- Tests JAR files-->
    <target name="server-build" depends="server-build1">
        <junit printsummary="yes" showoutput="true" fork="true" forkmode="once">
            <classpath refid="master-classpath"/>
            <formatter type="xml" usefile="no"/>
            <batchtest>
                <fileset dir="${server.output.src.dir}">
                    <include name="${test}/*Test.java"/>
                </fileset>
            </batchtest>
        </junit>
    </target>



</project>


And here is the log of the build on teamcity :

[21:11:51]: Changes are already collected
[21:11:51]: Clearing temporary directory: C:\TeamCity\BuildAgent\temp\buildTmp
[21:11:52]: Checkout directory: M:\Server\Build\src\modules\JTheque Stats Module
[21:11:52]: Updating sources (2s)
[21:11:52]: [Updating sources] Building incremental patch for VCS root: JTheque Stats Module Repository
[21:11:54]: [Updating sources] Repository sources transferred
[21:11:54]: [Updating sources] Updating M:\Server\Build\src\modules\JTheque Stats Module
[21:11:55]: Starting build process in M:\Server\Build\src\modules\JTheque Stats Module
[21:11:57]: clean
[21:11:57]: [clean] delete
[21:11:57]: [delete] Deleting directory M:\Server\Build\bin\modules\JTheque Stats Module
[21:11:57]: compile (12s)
[21:11:57]: [compile] mkdir
[21:11:57]: [mkdir] Created dir: M:\Server\Build\bin\modules\JTheque Stats Module
[21:11:57]: [compile] Adding debug=true parameter to javac task
[21:11:57]: [compile] javac (12s)
[21:11:57]: [javac] Compiling 20 source files to M:\Server\Build\bin\modules\JTheque Stats Module
[21:12:10]: [compile] EMMA: Instrumenting classes
[21:12:10]: [EMMA: Instrumenting classes] EMMA commandline: [-ix, -*Test*, -cp, M:\Server\Build\bin\modules\JTheque Stats Module, -m, overwrite]
[21:12:10]: [EMMA: Instrumenting classes] EMMA: processing instrumentation path ...
[21:12:10]: [EMMA: Instrumenting classes] EMMA: instrumentation path processed in 78 ms
[21:12:10]: [EMMA: Instrumenting classes] EMMA: [14 class(es) instrumented, 0 resource(s) copied]
[21:12:10]: [EMMA: Instrumenting classes] EMMA: metadata merged into [M:\Server\Build\src\modules\JTheque Stats Module\coverage.em] {in 35 ms}
[21:12:10]: copyRessources
[21:12:10]: [copyRessources] copydir
[21:12:10]: [copydir] DEPRECATED - The copydir task is deprecated.  Use copy instead.
[21:12:10]: [copydir] Copying 4 files to M:\Server\Build\bin\modules\JTheque Stats Module
[21:12:10]: generateDoc (9s)
[21:12:10]: [generateDoc] javadoc (9s)
[21:12:10]: [javadoc] Generating Javadoc
[21:12:10]: [javadoc] Javadoc execution
[21:12:10]: [javadoc] Creating destination directory: "M:\Server\Build\builds\modules\JTheque Stats Module\doc\"
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.controller.able...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.controller.impl...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.services.able...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.services.impl...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.services.impl.utils...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.tests...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.view.able...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.view.impl...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.view.impl.actions...
[21:12:11]: [javadoc] Loading source files for package org.jtheque.films.stats.view.impl.panels...
[21:12:11]: [javadoc] Constructing Javadoc information...
[21:12:11]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats"
[21:12:11]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.controller.able"
[21:12:11]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.controller.impl"
[21:12:11]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.services.able"
[21:12:12]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.services.impl"
[21:12:12]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.services.impl.utils"
[21:12:12]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.tests"
[21:12:12]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.view.able"
[21:12:12]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.view.impl"
[21:12:12]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.view.impl.actions"
[21:12:12]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.view.impl.panels"
[21:12:13]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.controller"
[21:12:14]: [javadoc] javadoc: warning - Multiple sources of package comments found for package "org.jtheque.films.stats.services"
[21:12:17]: [javadoc] Standard Doclet version 1.6.0_06
[21:12:17]: [javadoc] Building tree for all the packages and classes...
[21:12:19]: [javadoc] Building index for all the packages and classes...
[21:12:19]: [javadoc] Building index for all classes...
[21:12:19]: [javadoc] Generating M:\Server\Build\builds\modules\JTheque Stats Module\doc\stylesheet.css...
[21:12:19]: [javadoc] 13 warnings
[21:12:19]: [generateDoc] zip
[21:12:20]: [zip] Building zip: M:\Server\Build\builds\modules\JTheque Stats Module\JTheque Stats Module_doc.zip
[21:12:20]: [generateDoc] delete
[21:12:20]: [delete] Deleting directory M:\Server\Build\builds\modules\JTheque Stats Module\doc
[21:12:20]: generateSrc
[21:12:20]: [generateSrc] zip
[21:12:20]: [zip] Building zip: M:\Server\Build\builds\modules\JTheque Stats Module\JTheque Stats Module_src.zip
[21:12:20]: server-build1
[21:12:20]: [server-build1] delete
[21:12:20]: [delete] Deleting: M:\Server\Build\builds\modules\JTheque Stats Module\JTheque-Stats-Module.jar
[21:12:20]: [server-build1] jar
[21:12:20]: [jar] Building jar: M:\Server\Build\builds\modules\JTheque Stats Module\JTheque-Stats-Module.jar
[21:12:20]: server-build (2s)
[21:12:20]: [server-build] Adding emma to classpath of JUnitTask.
[21:12:20]: [server-build] junit (2s)
[21:12:21]: [junit] Running org.jtheque.films.stats.tests.CounterUtilsTest
[21:12:22]: [junit] org.jtheque.films.stats.tests.CounterUtilsTest
[21:12:22]: [org.jtheque.films.stats.tests.CounterUtilsTest] testClearButGenerals
[21:12:22]: [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.249 sec
[21:12:22]: [junit] <?xml version="1.0" encoding="UTF-8" ?>
[21:12:22]: [junit] <testsuite errors="0" failures="0" hostname="Main-PC" name="org.jtheque.films.stats.tests.CounterUtilsTest" tests="1" time="0.249" timestamp="2009-05-27T19:12:22">
[21:12:22]: EMMA: Create Report (4s)
[21:12:26]: [EMMA: Create Report] Unable to find M:\Server\Build\src\modules\JTheque Stats Module\coverage.ec, cannot create EMMA report
[21:12:26]: Process exit code: 0
[21:12:26]: Publishing artifacts
[21:12:26]: [Publishing artifacts] Paths to publish: [coverage.txt, coverage, coverage.ec, coverage.em]
[21:12:26]: [Publishing artifacts] Publishing artifacts 'coverage.txt' to root artifacts directory
[21:12:26]: [Publishing artifacts] Artifacts path coverage.txt not found
[21:12:26]: [Publishing artifacts] Publishing artifacts 'coverage' to root artifacts directory
[21:12:26]: [Publishing artifacts] Artifacts path coverage not found
[21:12:26]: [Publishing artifacts] Publishing artifacts 'coverage.ec' to root artifacts directory
[21:12:26]: [Publishing artifacts] Artifacts path coverage.ec not found
[21:12:26]: [Publishing artifacts] Publishing artifacts 'coverage.em' to root artifacts directory
[21:12:26]: Build finished


I just removed the xml report of junit.


Does somebody have an idea on why i don't have a code coverage report or why all the tests aren't executed ?


Thank you very much

Please sign in to leave a comment.