Problem with generating report with console runner
Hi guys,
Can you help me a little? I am stucked with generating a report while using console runner. So:
I start the dotCover with
dotcover.exe a <path to my config.xml> /LogFile=DotCover.txt
(without<>)
config.xml looks like:
<?xml version="1.0" encoding="utf-8" ?>
<AnalyseParams>
<TargetExecutable>ClothAuthoringTool.exe</TargetExecutable>
<TargetArguments>/TestMode:Unit</TargetArguments>
<Output>CoverResults.xml</Output>
<ReportType>XML</ReportType>
<Filters>
<IncludeFilters>
<FilterEntry>
<ModuleMask>ClothAuthoringTool</ModuleMask>
</FilterEntry>
</IncludeFilters>
</Filters>
<AttributeFilters>
<AttributeFilterEntry>ExcludeFromCodeCoverage</AttributeFilterEntry>
</AttributeFilters>
</AnalyseParams>
All I need is to see the coverage results only for included assembly (there are 2 of them, I need only the ClothAuthoringTool), and I want to not to see all results for classes marked with ExcludeFromCodeCoverage attribute.
But they are still present in report!
Please sign in to leave a comment.
Hello Sergii,
Please try to use the full attribute's name in the filter: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute.
Best regards.
Is there any difference in report generation via console runner in v2.2 and v2.0? Because it seems that the older version does not support this kind of attribute.
Hello Sergii,
In dotCover 2.0 there was a problem with attribute-filters: you couldn't use them on properties and events (see http://youtrack.jetbrains.com/issue/DCVR-4151). The problem was fixed in dotCover 2.1.
If it isn't your case, could you please provide a bit more details about your situation? Thanks in advance.
Regards.
Hello Ekaterina,
Something happened and question was posted two times)
Message was edited by: Sergii Pryshchepa
Hello Ekaterina,
Your answers were very helpful. But I still have the problem with the coverage generated on server side and on the local machine. Arguments and parameters are the same, as I see. But in the end I get on server: overall coverage of project - CoveragePercent="1", and on local machine - CoveragePercent="85". I am attaching the reports from server side and from local machine, also the logs from dotCover, and the logs from NUnit. Can you give me some advise on what is wrong?
Attachment(s):
TestResults.rar.zip
Hello Sergii,
Sorry for the delay!
Could you please clarify a bit what your application does when it's running with /TestMode:Unit key? Are you sure that it behaves in the same way on the server as on the local machine?
Hi Ekaterina,
When we run our application with /TestMode:Unit, the unittests are launched.
We have two different parts of app (one in C#, one in C++).
First of all, we run C# unittests via next line of code:
var unitTestFailed = (NUnit.ConsoleRunner.Runner.Main(argsConsole) != 0);
where
argsConsole = { <applicationName>, "/nologo" };
And after that C++ part of tests are runned. They aren't covered.
About your second question - yes, they should behave the same way.
Best wishes, Sergii Pryshchepa.
Collaboration Coordinator/Tools Programmer, Ubisoft Kiev
Hi Sergii,
Thank you very much for the information. We will investigate the issue.
Best regards.
Hello Ekaterina,
Are there some updates on this issue?
Best wishes, Sergii Pryshchepa.
Collaboration Coordinator/Tools Programmer, Ubisoft KievHello Sergii,
I'm terribly sorry for the delay!
Please try to use "/noshadow" key in the NUnit.ConsoleRunner.Runner.Main(...). I guess that the cause of the problem is that on your server machine NUnit makes a shadow copy of your application when running tests, but doesn't copy pdb-file with it.
Please let me know whether it helps. Best regards.
Hi Ekaterina,
It works like a charm! Thanks a lot.
Best wishes, Sergii Pryshchepa.
Collaboration Coordinator/Tools Programmer, Ubisoft Kiev