mindriven / TeamCity-OpenCoverRunner

14 stars 0 forks source link

Metric doesnt works. #4

Closed Seekeer closed 9 years ago

Seekeer commented 9 years ago

I've selected "percent of line coverage" on TC "Build Failures conditions" page.

And now in build I get this error: @Percent of lines covered (OpenCover) is too small: 0 Build failure condition: Fail build if Percent of lines covered (OpenCover) is less than 10@

But I got some lines covered. From OpenCover build step: Visited Classes 31 of 94 (32.98) Visited Methods 125 of 415 (30.12) Visited Points 936 of 2682 (34.90) Visited Branches 255 of 993 (25.68)

TC version is 8.1.4 (build 30168). How could I fix this issue?

mindriven commented 9 years ago

Hi, sorry for late response and thanks for reporting. Can you please attach sample project on which I could reproduce the mentioned issue. Thanks in advance

Seekeer commented 9 years ago

Screen of plugin build step: https://yadi.sk/i/ufzeQZU5cacPG Project source code: https://yadi.sk/d/TlhMhWIxcacTL

mindriven commented 9 years ago

Hi again Configuration (from screenshot) that you linked has no chance of working with source that you linked, paths are all wrong. I adjusted the setup on my local machine to get it running, in build log I can see that TC runs the plugin correctly, in my case line looks as follows:

C:\TeamCity\buildAgent\work\d9ee3102c97094cc>C:\TeamCity\buildAgent\work\d9ee3102c97094cc\packages\OpenCover.4.5.3207\OpenCover.Console.exe "-targetargs:\"C:\TeamCity\buildAgent\work\d9ee3102c97094cc\bin\Debug\CommandsTests.dll\"" "-filter:+{*}* -filter:-excludebyfile:*\*Designer.cs" "-target:C:\TeamCity\buildAgent\work\d9ee3102c97094cc\packages\NUnit.Runners.2.6.3\tools\nunit-console.exe" "-output:"result.xml"" && C:\TeamCity\buildAgent\work\d9ee3102c97094cc\packages\ReportGenerator.2.0.0.0\ReportGenerator.exe "-reports:"result.xml"" "-targetdir:"CoverageReport""

In your build log there should be something similar. Please copy corresponding line from build log and run it as command from your system console. After that check output report file("-reports:"result.xml"). Most likely you will find that it contains no results and this is why TC gets 0% coverage. If that is the case play around with parameters for involved tools according to respective manuals. If you get this running and producing expected results locally then just move all parameters to plugin configuration in TC and then it should work. Hope that helps.

mindriven commented 9 years ago

What is the status of this issue? Did you manage to get plugin working?

mindriven commented 9 years ago

Because of lack of activity I close this issue. If there is something to add please do not hesitate to reopen it.