Appveyor运行测试,但OpenCover不显示覆盖范围

时间:2017-04-12 07:41:10

标签: visual-studio-2017 opencover appveyor coveralls

我正在构建项目并在appveyor中运行测试用例。成功执行测试用例后,必须将覆盖率数据上载到工作服。 但在我的情况下,没有抛出任何错误,但正在记录覆盖范围。

我的项目的详细信息是

  

.Net Core 1.1.0   Visual Studio 2017   xunit - 2.2.0   OpenCover - 4.6.519   coveralls.net - 0.7.0

我的appveyor.yml如下:

version: 1.0.{build}
os: Visual Studio 2017
skip_tags: true
configuration: Release
environment:
 nodejs_version: "0.12"
COVERALLS_REPO_TOKEN:
  secure: rstgrtert
cache:
- "%LOCALAPPDATA%\\Yarn"
install:
- npm i -g yarn@0.16.1
- npm i -g typescript typings
- yarn global add typescript typings
- cd ".\Promact.Oauth.Server\src\Promact.Oauth.Server\"
- yarn
- cd..
- cd..
build_script:
- ps: dotnet restore
build:
project: .\Promact.Oauth.Server\Promact.Oauth.Server.sln
verbosity: minimal
test_script:
- cd ".\src\"
- ps: >-
 C:\Users\appveyor\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe-target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test -f netcoreapp1.1 -c Release .\Promact.Oauth.Server.Tests\Promact.Oauth.Server.Tests.csproj" -mergeoutput -hideskipped:File -output:opencover.xml -oldStyle -filter:"+[Promact.Oauth.Server]*Repository -[Promact.Oauth.Server.Tests*]*" -register:user
if(![string]::IsNullOrEmpty($env:COVERALLS_REPO_TOKEN)){

$coveralls = (Resolve-Path "C:\Users\appveyor\.nuget\packages\coveralls.net\0.7.0\tools\csmacnz.coveralls.  exe").ToString()

& $coveralls --opencover -i opencover.xml --repoToken 
$env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID

}

在appveyor中,它运行测试并只显示

 Committing...
No results, this could be for a number of reasons. The most common reasons are:
    1) missing PDBs for the assemblies that match the filter please review the
    output file and refer to the Usage guide (Usage.rtf) about filters.
    2) the profiler may not be registered correctly, please refer to the Usage
    guide and the -register switch.
Coverage data uploaded to coveralls.

link to the appveyor build

0 个答案:

没有答案