2017-03-21 11 views
0

SonarQube에 대한 Code Coverage Results Import (C#, VB.NET) 설명서를 따르고 있습니다. 내 프로젝트에 대한 VS 2015는 CodeCoverage.exe에서 생성 된 .coveragexml을 열 수 없습니다.

, 나는 문제없이이 파일을 열 수 있습니다 " SonarQubeTests.csproj.coverage"

비주얼 스튜디오와 같은 테스트 커버리지 바이너리 파일을 생성 할 수 있어요. 모든 세부 사항을 볼 수 있습니다.

다음 명령을 사용하여 ".coveragexml"파일을 생성하려고하면;

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe" "analyze /output:C:\SonarQubeTests.csproj.coveragexml C:\SonarQubeTests.csproj.coverage" 

은 ".coveragexml"파일을 생성하지 않습니다,하지만 난 비주얼 스튜디오를 열 때 그것은 나에게 다음과 같은 오류 제공 : 내가 텍스트 편집기 및 콘텐츠 보인다으로이 파일을 열 수 있습니다

enter image description here

을 괜찮아. 그러나 Visual Studio 2015와 sonarqube는이 파일을 읽지 않습니다.

내가 여기에 누락 되었습니까?

P.S 나는 또한 아래와 같이 Ms Test 러너에 대한 러너 설정을 가지고 있습니다. 이것이 영향을 미치는지 확실하지 않습니다.

<?xml version="1.0" encoding="utf-8"?> 
<RunSettings> 
    <!-- Configurations that affect the Test Framework --> 
    <RunConfiguration> 
    <MaxCpuCount>1</MaxCpuCount> 
    <!-- Path relative to solution directory --> 
    <ResultsDirectory>C:\</ResultsDirectory> 

    <!-- [x86] | x64  
     - You can also change it from menu Test, Test Settings, Default Processor Architecture --> 
    <TargetPlatform>x86</TargetPlatform> 

    <!-- Framework35 | [Framework40] | Framework45 --> 
    <TargetFrameworkVersion>Framework45</TargetFrameworkVersion> 

    <!-- Path to Test Adapters --> 
    <TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths> 
    </RunConfiguration> 

    <!-- Configurations for data collectors --> 
    <DataCollectionRunSettings> 
    <DataCollectors> 
     <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     <Configuration> 
      <CodeCoverage> 
      <ModulePaths> 
       <Exclude> 
       <ModulePath>.*CPPUnitTestFramework.*</ModulePath> 
       </Exclude> 
      </ModulePaths> 

      <!-- We recommend you do not change the following values: --> 
      <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation> 
      <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses> 
      <CollectFromChildProcesses>True</CollectFromChildProcesses> 
      <CollectAspDotNet>False</CollectAspDotNet> 

      </CodeCoverage> 
     </Configuration> 
     </DataCollector> 

    </DataCollectors> 
    </DataCollectionRunSettings> 

    <!-- Parameters used by tests at runtime --> 
    <TestRunParameters> 
    <Parameter name="webAppUrl" value="http://localhost" /> 
    <Parameter name="webAppUserName" value="Admin" /> 
    <Parameter name="webAppPassword" value="Password" /> 
    </TestRunParameters> 

    <!-- Adapter Specific sections --> 

    <!-- MSTest adapter --> 
    <MSTest> 
    <MapInconclusiveToFailed>True</MapInconclusiveToFailed> 
    <CaptureTraceOutput>false</CaptureTraceOutput> 
    <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete> 
    <DeploymentEnabled>False</DeploymentEnabled> 
    <AssemblyResolution> 
     <Directory Path="D:\myfolder\bin\" includeSubDirectories="false"/> 
    </AssemblyResolution> 
    </MSTest> 

</RunSettings> 

답변

0

코드 커버리지를 직접 얻기 위해 vstest.console을 사용할 수 있다고 생각합니다. VS가 타사 도구에서 생성 한 코드 범위를 열 수 있는지 여부는 확실하지 않습니다. 우리는 vstest.console 코드 커버리지를 얻을 수 있다면 문제가되지 않을 것이라고 생각합니다. 결과를 보려면 시도하십시오.

+0

CodeCoverage.exe는 타사가 아닙니다. 나는 .coveragexml을 생성하기 위해 그것을 사용하고있다. vstest.console.exe를 사용하여 .covagare 파일을 생성하고 있습니다. –

+0

그러면 .coverage 파일을 VS로 직접 드래그하여 coveragexml 파일로 내보낼 수 있습니다. – qianli

+0

신중하게 질문을 읽어보십시오. 나는 수동 프로세스를 원하지 않습니다. 이것은 SonarQube 프로세스의 단계입니다. 여기서 나는 문서를 따르려고합니다. –