mirror of https://github.com/Jackett/Jackett
ci/cd: code coverage fix and pipelines tidy (#15357)
This commit is contained in:
parent
7531b04b63
commit
0dc0a82ba0
|
@ -431,7 +431,7 @@ stages:
|
|||
framework: $(netCoreFramework)
|
||||
runtime: osx-x64
|
||||
LinuxAMDx64:
|
||||
buildDescription: Linux AMD x64
|
||||
buildDescription: LinuxAMDx64
|
||||
imageName: ubuntu-22.04
|
||||
framework: $(netCoreFramework)
|
||||
runtime: linux-x64
|
||||
|
@ -454,22 +454,23 @@ stages:
|
|||
installationPath: $(Agent.ToolsDirectory)/dotnet
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Unit Tests (Mono, Linux and macOS)
|
||||
condition: and(succeeded(), not(startsWith(variables['runtime'], 'win')))
|
||||
displayName: Unit Tests & Code Coverage
|
||||
inputs:
|
||||
command: test
|
||||
projects: '**/*.Test*/*.csproj'
|
||||
arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)'
|
||||
projects: '$(Build.SourcesDirectory)/src/**/*.Test*/*.csproj'
|
||||
arguments: '--configuration $(buildConfiguration) --framework $(framework) /p:CollectCoverage=true /p:CoverletOutput=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.$(buildDescription).xml /p:CoverletOutputFormat=cobertura /p:IncludeTestAssembly=true /p:ExcludeByAttribute=TestSDKAutoGeneratedCode'
|
||||
testRunTitle: 'Unit - $(buildDescription) - $(Build.BuildId)'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Unit Tests & Code Coverage (Windows only)
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: and(succeeded(), not(startsWith(variables['runtime'], 'win')))
|
||||
inputs:
|
||||
targetPath: $(Build.SourcesDirectory)/coverlet/reports/
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
||||
inputs:
|
||||
command: test
|
||||
projects: '**/*.Test*/*.csproj'
|
||||
arguments: '--configuration $(buildConfiguration) --framework $(framework) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura'
|
||||
testRunTitle: 'Unit - $(buildDescription) - $(Build.BuildId)'
|
||||
downloadPath: $(Build.SourcesDirectory)/coverlet/reports/
|
||||
itemPattern: '**/coverage.cobertura.*.xml'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Install Coverage ReportGenerator Tool (Windows only)
|
||||
|
@ -477,21 +478,29 @@ stages:
|
|||
inputs:
|
||||
command: custom
|
||||
custom: tool
|
||||
arguments: install --tool-path . dotnet-reportgenerator-globaltool
|
||||
arguments: install -g dotnet-reportgenerator-globaltool
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Generate Coverage Report (Windows only)
|
||||
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: ./reportgenerator -reports:$(Build.SourcesDirectory)/src/*.Test*/coverage.*.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"
|
||||
script: reportgenerator -reports:$(Build.SourcesDirectory)/coverlet/reports/**/coverage.cobertura.*.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports/final/ -sourcedirs:$(Build.SourcesDirectory)/src/ -reporttypes:"Cobertura"
|
||||
|
||||
- task: PublishCodeCoverageResults@1
|
||||
displayName: Publish Code Coverage (Windows only)
|
||||
displayName: Publish Code Coverage
|
||||
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
||||
inputs:
|
||||
codeCoverageTool: Cobertura
|
||||
summaryFileLocation: $(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml
|
||||
summaryFileLocation: $(Build.SourcesDirectory)/coverlet/reports/final/Cobertura.xml
|
||||
pathToSources: $(Build.SourcesDirectory)/src/
|
||||
additionalCodeCoverageFiles: $(Agent.TempDirectory)/*.trx
|
||||
failIfCoverageEmpty: true
|
||||
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
||||
inputs:
|
||||
targetPath: $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.Windows.net6.0.xml
|
||||
|
||||
- stage: IntegrationTestJackett
|
||||
displayName: Integration Tests
|
||||
|
@ -570,20 +579,10 @@ stages:
|
|||
installationPath: $(Agent.ToolsDirectory)/dotnet
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Integration Tests (Mono, Linux and macOS)
|
||||
condition: and(succeeded(), not(startsWith(variables['runtime'], 'win')))
|
||||
displayName: Integration Tests
|
||||
inputs:
|
||||
command: test
|
||||
projects: '**/*IntegrationTest*/*.csproj'
|
||||
arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)'
|
||||
testRunTitle: 'Integration - $(buildDescription) - $(Build.BuildId)'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Integration Tests (Windows only)
|
||||
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
||||
inputs:
|
||||
command: test
|
||||
projects: '**/*IntegrationTest*/*.csproj'
|
||||
projects: '$(Build.SourcesDirectory)/src/**/*IntegrationTest*/*.csproj'
|
||||
arguments: '--configuration $(buildConfiguration) --framework $(framework)'
|
||||
testRunTitle: 'Integration - $(buildDescription) - $(Build.BuildId)'
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autofac" Version="6.5.0" />
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
|
||||
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
Loading…
Reference in New Issue