This commit is contained in:
Eilon Lipton 2019-09-24 11:51:00 -07:00
Родитель dc7fd448bb
Коммит 490a71f8fe
5 изменённых файлов: 3 добавлений и 45 удалений

Просмотреть файл

@ -14,7 +14,6 @@ variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
BuildPlatform: Any CPU
#codecov_token: # Get a new one from https://codecov.io/
#ci_feed: # find guid used by Azure DevOps Artifacts for the feed
NUGET_PACKAGES: $(Agent.TempDirectory)/.nuget/packages

Просмотреть файл

@ -45,5 +45,4 @@ jobs:
- template: install-dependencies.yml
parameters:
initArgs: -NoRestore
- template: publish-codecoverage.yml
- template: publish-deployables.yml

Просмотреть файл

@ -12,7 +12,7 @@ steps:
displayName: dotnet test -f net472
inputs:
command: test
arguments: --no-build -c $(BuildConfiguration) -f net472 --filter "TestCategory!=FailsInCloudTest" -v n /p:CollectCoverage=true
arguments: --no-build -c $(BuildConfiguration) -f net472 --filter "TestCategory!=FailsInCloudTest" -v n
testRunTitle: net472-$(Agent.JobName)
workingDirectory: src
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
@ -21,7 +21,7 @@ steps:
displayName: dotnet test -f netcoreapp2.1
inputs:
command: test
arguments: --no-build -c $(BuildConfiguration) -f netcoreapp2.1 --filter "TestCategory!=FailsInCloudTest" -v n /p:CollectCoverage=true
arguments: --no-build -c $(BuildConfiguration) -f netcoreapp2.1 --filter "TestCategory!=FailsInCloudTest" -v n
testRunTitle: netcoreapp2.1-$(Agent.JobName)
workingDirectory: src
@ -29,7 +29,7 @@ steps:
displayName: dotnet test -f netcoreapp3.0
inputs:
command: test
arguments: --no-build -c $(BuildConfiguration) -f netcoreapp2.2 --filter "TestCategory!=FailsInCloudTest" -v n /p:CollectCoverage=true
arguments: --no-build -c $(BuildConfiguration) -f netcoreapp2.2 --filter "TestCategory!=FailsInCloudTest" -v n
testRunTitle: netcoreapp3.0-$(Agent.JobName)
workingDirectory: src
@ -55,9 +55,3 @@ steps:
SymbolServerType: TeamServices
displayName: Publish symbols to symbol server
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Agent.OS'], 'Windows_NT'))
- bash: bash <(curl -s https://codecov.io/bash)
displayName: Publish code coverage results to codecov.io
condition: ne(variables['codecov_token'], '')
timeoutInMinutes: 3
continueOnError: true

Просмотреть файл

@ -1,31 +0,0 @@
steps:
- download: current
artifact: coverageResults-Windows
displayName: Download Windows code coverage results
continueOnError: true
- download: current
artifact: coverageResults-Linux
displayName: Download Linux code coverage results
continueOnError: true
- download: current
artifact: coverageResults-macOS
displayName: Download macOS code coverage results
continueOnError: true
- powershell: |
dotnet tool install --tool-path obj dotnet-reportgenerator-globaltool --version 4.2.2 --configfile azure-pipelines/justnugetorg.nuget.config
Copy-Item -Recurse $(Pipeline.Workspace)/coverageResults-Windows/obj/* $(System.DefaultWorkingDirectory)/obj
Write-Host "Substituting {reporoot} with $(System.DefaultWorkingDirectory)"
$reports = Get-ChildItem -Recurse "$(Pipeline.Workspace)/coverage.cobertura.xml"
$reports |% {
$content = Get-Content -Path $_ |% { $_.Replace("{reporoot}", "$(System.DefaultWorkingDirectory)") }
Set-Content -Path $_ -Value $content -Encoding UTF8
}
$Inputs = [string]::join(';', ($reports |% { Resolve-Path -relative $_ }))
obj/reportgenerator -reports:"$Inputs" -targetdir:coveragereport -reporttypes:Cobertura
displayName: Merge coverage
- task: PublishCodeCoverageResults@1
displayName: Publish code coverage results to Azure DevOps
inputs:
codeCoverageTool: cobertura
summaryFileLocation: 'coveragereport/Cobertura.xml'
failIfCoverageEmpty: true

Просмотреть файл

@ -1,8 +1,5 @@
<Project>
<PropertyGroup Condition=" '$(IsTestProject)' == 'true' ">
<CoverletOutputFormat>cobertura</CoverletOutputFormat>
<Exclude>[xunit.*]*</Exclude>
<!-- Ensure we preserve each coverlet output file per target framework: https://github.com/tonerdo/coverlet/issues/177 -->
<CoverletOutput>$(OutputPath)/</CoverletOutput>
</PropertyGroup>
</Project>