I'm using TeamCity Pro 6.0.1 on Windows 7 and I originally had the TC services running with the 'local system account'. I have a Maven2 configuration that uses Subversion as the VCS, and I enabled code coverage. Everything was working great. Builds were fine. Tests were running. Code coverage was produced and Maven2 build info was shown.
Because I wanted the TC build agent to use my Maven local repository (~/.m2/repository), I changed the TC services to run as me. The services (re)started fine, and builds were running as before. Except for code coverage. No code coverage. The error was
Failed to generate coverage report, error: java.io.FileNotFoundException: C:\TeamCity\buildAgent\work\c02175388bc3e6ac\coverage.ic file does not exist
After some investigation I felt the issue was that the buildAgent\work directory was owned by the local admin account rather than me. So I changed ownership on all the files and subdirectories of C:\TeamCity. I verified the change on the directory in buildAgent\work.
When I ran a build again, still no code coverage, and the same error.
What I noticed is that the directory c02175388bc3e6ac was changed to be owned by the local admin account. I have TC set 'Clean all files before build' so the c02175388bc3e6ac is recreated by the build agent. But it's getting created with the local admin user as the owner, rather than me, even though the build agent service is running as me.
What's strange is that the build itself works i.e. mvn is creating 'target' directories, compiling files, building artifacts, all without any permission issue. Yet the coverage.ic file isn't getting generated.
The only thing that's changed in the TC configuration is that TC is running as me. To see if that was true, I set the TC services back to run as the local system account. Everything worked and I got the code coverage.
An interesting addtional side effect, that I don't understand, is that the 'Maven Build Info' tab was also missing when the code coverage was missing.
Anyway, I have a workaround, but heads up to JetBrains.