1 Replies Last post: Oct 3, 2013 3:48 PM by Ekaterina Solovova  
RC1971 Newbie 12 posts since
Nov 12, 2012
Currently Being Moderated

Oct 2, 2013 11:54 PM

No source available when running dotcover with cover option and converting to htm report

Maybe I'm missing something here but when I run dotcover with cover as the option after converting the snapshot to htm I cannot see the source.  Although if I run dotcover with the analyze option I get the source is this a bug?

 

 

1) Command when using "analyze"

 

<Exec Command='"$(dotCoverExePath)" a /TargetExecutable="$(MsTestPath)" /TargetArguments="/testcontainer:&quot;$(CurrAssemblyFullPathx64)&quot; /testsettings:&quot;$(BuildFolder)\Main\Dev\TraceAndTestImpact.testsettings&quot;"  /Filters=+:module=$(TestAssembliesNameX64);-:function=.ctor  /TargetWorkingDir="$(TestResPath)" /ReportType:XML /Output="$(DCoverOutDir)\$(CurrAssemblyFilex64).xml" /LogFile="$(TestResPath)\$(CurrAssemblyFilex64).dotCover.Report.log" /CoreLogMask=PdbBridge,Api,PdbGt,MetaDataGt,InstrumentationGt '/>

 

 

2) I run the following sequence when creating a merge report and individual report using snapshot

 

a) First run dotcover with the following command to produce a snapshot

 

<Exec Command='"$(dotCoverExePath)" cover /TargetExecutable="$(MsTestPath)" /TargetArguments="/testcontainer:&quot;$(CurrAssemblyFullPathx64)&quot; /testsettings:&quot;$(BuildFolder)\Main\Dev\TraceAndTestImpact.testsettings&quot;"  /Filters=+:module=$(TestAssembliesNameX64);-:function=.ctor  /TargetWorkingDir="$(TestResPath)" /Output="$(DCoverOutDir)\$(CurrAssemblyFilex64).cover" /LogFile="$(TestResPath)\$(CurrAssemblyFilex64).dotCover.Report.log" /CoreLogMask=PdbBridge,Api,PdbGt,MetaDataGt,InstrumentationGt '/>

 

b) Next I run this command to merge the snapshot into one snapshot

 

<Exec Command='"$(dotCoverExePath)" merge /Source="@(DotCoverResultFiles)" /Output="$(DotCoverMergeOutDir)\DotcoverMerge.cover" /LogFile="$(DotCoverLogOutDir)\DotCoverMerge.Report.log"'/>

 

c) After step "b" I run the following command to produce a htm report

 

<Exec Command='"$(dotCoverExePath)" report /Source="$(DotCoverMergeOutDir)\DotcoverMerge.cover" /ReportType:HTML /Output="$(DotCoverReportOutDir)\All\AllMerge.htm" /LogFile="$(DotCoverLogOutDir\DotCoverAll.Report.log"'/>

 

d) After step "c" I run dotcover again this time to produce individual htm repor.  What this command do is msbuild runs the GenerateReport and then the "GenerateReport" will call the "GenerateOneReport" supplying one snapshot at a time to generate one htm file.

 

  <Target Name="GenerateReport">

 

    <!-- Call CheckOneAssemblyFile foreach file in DotCoverResultFiles -->
    <MSBuild Projects="$(MSBuildProjectFile)"
            Properties="CurrDotCoverFile=%(DotCoverResultFiles.FileName);CurrDotCoverFileFullPath=%(DotCoverResultFiles.FullPath);DCoverOutDir=$(DotCoverOutDir);CtOnErr=$(ContOnError)"
            Targets="GenerateOneReport">
    </MSBuild>

 

  </Target>

 

  <Target Name="GenerateOneReport">

 

    <Message Text="Current Assembly File: $(CurrDotCoverFile)"/>
    <Message Text="Current Assembly Full Path: $(CurrDotCoverFileFullPath)"/>
    <Message Text="Continue On Error: $(ContOnError)"/>

 

    <!-- This will produce an htm output -->
    <Message Text="Generate One report per assembly" Importance="high"/>

 

    <Exec Command='"$(dotCoverExePath)" report /Source="$(CurrDotCoverFileFullPath).cover" /ReportType:HTML /Output="$(DotCoverReportOutDir)\Individual\$(CurrDotCoverFile).htm" /LogFile="$(DotCoverLogOutDir)\$(CurrDotCoverFile).Report.log"'/>

 

  </Target>

 

 

So, after the reports are generated when I click the report I do not see any source while if I run dotcover with the "analyze" option I get the source.  So what am I missing here?

Ekaterina Solovova JetBrains 34 posts since
Jun 26, 2012

Hi Ray,

 

Could you please send me your build log and dotCover logs?

You can remove /CoreLogMask key from dotCover commands - this key is needed for debugging purposes only and if it's present dotCover logs can contain a very large amount of information.

 

As a hypothesis: sources can be absent in a html report if they were inaccessible when the report was generated. dotCover looks for source files using paths from which assemblies being analyzed have been built. For example if you build your assembly and get a coverage snapshot on one machine and then generate a report by this snapshot on another machine, the report won't contain sources.

 

Thanks in advance. Best regards.

More Like This

  • Retrieving data ...