Publishing artifact coverage.ic failed using Maven2 runner

Hi,

TeamCity 5.1.1, Maven2 runner. We are unable to get IDEA code coverage runner from our tests.

teamcity-agent.log:

[2010-05-12 10:48:57,055]   INFO -    jetbrains.buildServer.AGENT - Publishing artifacts 'coverage.ic' to root artifacts directory
[2010-05-12 10:48:57,056]  DEBUG -    jetbrains.buildServer.AGENT - Files to publish before preprocessing: {}
[2010-05-12 10:48:57,056]  DEBUG -    jetbrains.buildServer.AGENT - Files to publish after  preprocessing: {}
[2010-05-12 10:48:57,056]   INFO -    jetbrains.buildServer.AGENT - Artifacts path  not found
[2010-05-12 10:48:57,056]  DEBUG - r.agent.impl.AgentLogProxyImpl - Later executor invocation
[2010-05-12 10:48:57,073]   WARN -    jetbrains.buildServer.AGENT - Failed to generate coverage report
java.io.FileNotFoundException: coverage.ic file does not exist
        at jetbrains.buildServer.coverage.idea.IDEACoverageArtifactsProvider.createCoverageData(IDEACoverageArtifactsProvider.java:119)
        at jetbrains.buildServer.coverage.idea.IDEACoverageArtifactsProvider.beforeBuildFinish(IDEACoverageArtifactsProvider.java:77)
        at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:112)
        at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:64)
        at $Proxy8.beforeBuildFinish(Unknown Source)
        at jetbrains.buildServer.agent.impl.FinishBuildProcessor.finishBuild(FinishBuildProcessor.java:36)
        at jetbrains.buildServer.agent.impl.BuildRunAction$1.run(BuildRunAction.java:58)
        at java.lang.Thread.run(Thread.java:619)


here is pom.xml snippet

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <id>surefire-it</id>
                        <phase>integration-test</phase>
                        <goals>
                            <!--suppress MavenModelInspection -->
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify</id>
                        <goals>
                            <!--suppress MavenModelInspection -->
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


Additionaly, we have Maven command line parameters ( TeamCity configuration page of Maven2 runner ):
-Dmaven.junit.fork=true -Dmaven.junit.forkmode=once


Yet, still we see no coverage at all. Any ideas?

3 comments

TeamCity Maven coverage supports Surefire only. Feel free to watch/vote for this request: http://youtrack.jetbrains.net/issue/TW-12094

As for possible workaround, I think you can try to add the following command line argument to JVM process started by failsafe plugin:
-javaagent:${agent.home.dir}/plugins/coveragePlugin/lib/coverage-agent.jar=coverage.ic  true true true true <include pattern regexp>  -exclude <exclude pattern regexp>

agent.home.dir property should be defined by TeamCity

0

Pavel / All

Does the lack of maven failsafe integration also apply to tests?

TeamCity is executing our integration tests via failsafe, but not detecting failures, thus passing the build and not parsing the failsafe report.

I find it surprising if this is just not supported as failsafe + teamcity must be a widely deployed combination no?

Thanks

Ben

0

As I can see failsafe plugin can generate Surefire reports. If this is true, you can enable XML report processing on the Maven runner settings, and specify there paths to reports produced by this plugin.

0

Please sign in to leave a comment.