13

I try to run dotCover with my NUnit tests, in the TeamCity 8 as a build step. But no metter what I try I always get the same error in the log file:

Step 4/4: Coverage (NUnit) (1s)
[Step 4/4] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[Step 4/4] in directory: C:\TeamCity\buildAgent\work\6aee0f0d2626793d
[Step 4/4] ##teamcity[importData type='dotNetCoverage' tool='dotcover' file='C:\TeamCity\buildAgent\temp\buildTmp\coverage_dotcover3226256377023598081.data']
[Step 4/4] Importing data from 'C:\TeamCity\buildAgent\temp\buildTmp\coverage_dotcover3226256377023598081.data' with 'dotNetCoverage' processor
[Step 4/4] Rejected coverage report file: C:\TeamCity\buildAgent\temp\buildTmp\coverage_dotcover3226256377023598081.data size: 0. File is empty or does not exist
[Step 4/4] Process exited with code -2146232576
[Step 4/4] Step Coverage (NUnit) failed

I have tried to use both the included in TeamCity dotCover and the separately installed one, but both are failing with the same error.

My configuration:

NUnit tests + coverage configuration

If I choose no coverage tool, the tests work fine on its own. But with dotCover selected I always get the same error.

Any help here would be much appreciated.

Carsten
  • 10,430
  • 7
  • 37
  • 58
domderen
  • 623
  • 9
  • 22
  • Just to clarify, my TeamCity version is TeamCity Enterprise 8.0 EAP (build 27147), and yes I have seen this page: http://youtrack.jetbrains.com/issue/TW-25856 but it says the status is fixed. – domderen May 01 '13 at 14:47
  • 1
    Could you please send us dotCover’s log file (to daria.dovzhikova@jetbrains.com or http://youtrack.jetbrains.com/issues/DCVR) ? In order to do it please complete the following steps: - add configuration parameter "teamcity.agent.dotCover.log" with value "%system.teamcity.build.tempDir%/dotCoverLogs" - run build - go to build artifacts, choose "show hidden artifacts" and find .teamcity/.NETCoverage/dotCoverLogs.zip – Daria Dovzhikova May 06 '13 at 13:42
  • Are you sure your tests are getting executed? – Martin May 08 '13 at 09:48
  • I normally leave the path to dotCover Home blank ? – Mark Broadhurst Jun 21 '13 at 11:29
  • Im having a slightly related issue where when ever I try using the Path to DotCover home propety, I can't run the build AT ALL! – IbrarMumtaz Jul 22 '14 at 14:41

4 Answers4

6

Check out: http://confluence.jetbrains.com/pages/viewpage.action?pageId=49448495

In the case of internal TeamCity DotCover, you have to add the "ALL APPLICATION PACKAGES" read access rights to the TeamCity installation folder. If using an external DotCover, add the rights there.

This corrected the issue for me, for now.

slavikko
  • 346
  • 4
  • 4
  • Note that this applies to the TeamCity binary install folder, in case you are not using `Program Files (x86)` – Byron Ross Jul 19 '13 at 05:36
  • 1
    @ByronRoss How do we know which folder is the one with TeamCity? I only have one called like that but it's in the root (i.e. *c:\teamcity*). And I've let the user *SYSTEM* do all kinds of things (didn't find anything called *ALL APPLICATION PACKAGES*, namely - reading, writing and the rest of stuff. To no avail. What more can be done? – Konrad Viltersten Jun 17 '14 at 13:51
2

It's probably because you are running this on build agent without .NET 3.5 (but with 4.0). It's easy to check because you will get exception just after running dotCover.exe on this agent. Install .NET 3.5 (using Server Manager in case of newest Windows).

The next thing is that there is another bug with dotCover in TeamCity 8. You need to use trial dotCover installation until they fix it (and put the path to installed dotCover into the build step configuration).

It solved the problem in my case.

frizik
  • 1,086
  • 9
  • 16
1

Interestingly, for me at least, it worked for me once I disabled code coverage (i.e. un-selected an item in the .NET Coverage tool drop-down) and ran the build. When I re-enabled code coverage it worked (with no other changes to anything in TeamCity or on the build server). Weird!

I'm currently running TeamCity version 8.0.4 (build 27616).

Kenny Evitt
  • 8,023
  • 5
  • 59
  • 84
0

This is similar to my issue, where the NUnit fails to run when dotCover is enabled.

I resolved this by setting .NET Runtime: Platform: as x86 in the configuration dropdown and I think the error is due to team city fails to figure out which is the correct platform.

Ted Xu
  • 1,051
  • 1
  • 10
  • 20