mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
ci/cd: code coverage fix and pipelines tidy (#15357)
This commit is contained in:
@@ -454,22 +454,23 @@ stages:
|
|||||||
installationPath: $(Agent.ToolsDirectory)/dotnet
|
installationPath: $(Agent.ToolsDirectory)/dotnet
|
||||||
|
|
||||||
- task: DotNetCoreCLI@2
|
- task: DotNetCoreCLI@2
|
||||||
displayName: Unit Tests (Mono, Linux and macOS)
|
displayName: Unit Tests & Code Coverage
|
||||||
condition: and(succeeded(), not(startsWith(variables['runtime'], 'win')))
|
|
||||||
inputs:
|
inputs:
|
||||||
command: test
|
command: test
|
||||||
projects: '**/*.Test*/*.csproj'
|
projects: '$(Build.SourcesDirectory)/src/**/*.Test*/*.csproj'
|
||||||
arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)'
|
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)'
|
testRunTitle: 'Unit - $(buildDescription) - $(Build.BuildId)'
|
||||||
|
|
||||||
- task: DotNetCoreCLI@2
|
- task: PublishPipelineArtifact@1
|
||||||
displayName: Unit Tests & Code Coverage (Windows only)
|
condition: and(succeeded(), not(startsWith(variables['runtime'], 'win')))
|
||||||
|
inputs:
|
||||||
|
targetPath: $(Build.SourcesDirectory)/coverlet/reports/
|
||||||
|
|
||||||
|
- task: DownloadPipelineArtifact@2
|
||||||
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
||||||
inputs:
|
inputs:
|
||||||
command: test
|
downloadPath: $(Build.SourcesDirectory)/coverlet/reports/
|
||||||
projects: '**/*.Test*/*.csproj'
|
itemPattern: '**/coverage.cobertura.*.xml'
|
||||||
arguments: '--configuration $(buildConfiguration) --framework $(framework) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura'
|
|
||||||
testRunTitle: 'Unit - $(buildDescription) - $(Build.BuildId)'
|
|
||||||
|
|
||||||
- task: DotNetCoreCLI@2
|
- task: DotNetCoreCLI@2
|
||||||
displayName: Install Coverage ReportGenerator Tool (Windows only)
|
displayName: Install Coverage ReportGenerator Tool (Windows only)
|
||||||
@@ -477,21 +478,29 @@ stages:
|
|||||||
inputs:
|
inputs:
|
||||||
command: custom
|
command: custom
|
||||||
custom: tool
|
custom: tool
|
||||||
arguments: install --tool-path . dotnet-reportgenerator-globaltool
|
arguments: install -g dotnet-reportgenerator-globaltool
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: Generate Coverage Report (Windows only)
|
displayName: Generate Coverage Report (Windows only)
|
||||||
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
||||||
inputs:
|
inputs:
|
||||||
targetType: inline
|
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
|
- task: PublishCodeCoverageResults@1
|
||||||
displayName: Publish Code Coverage (Windows only)
|
displayName: Publish Code Coverage
|
||||||
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
condition: and(succeeded(), startsWith(variables['runtime'], 'win'))
|
||||||
inputs:
|
inputs:
|
||||||
codeCoverageTool: Cobertura
|
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
|
- stage: IntegrationTestJackett
|
||||||
displayName: Integration Tests
|
displayName: Integration Tests
|
||||||
@@ -570,20 +579,10 @@ stages:
|
|||||||
installationPath: $(Agent.ToolsDirectory)/dotnet
|
installationPath: $(Agent.ToolsDirectory)/dotnet
|
||||||
|
|
||||||
- task: DotNetCoreCLI@2
|
- task: DotNetCoreCLI@2
|
||||||
displayName: Integration Tests (Mono, Linux and macOS)
|
displayName: Integration Tests
|
||||||
condition: and(succeeded(), not(startsWith(variables['runtime'], 'win')))
|
|
||||||
inputs:
|
inputs:
|
||||||
command: test
|
command: test
|
||||||
projects: '**/*IntegrationTest*/*.csproj'
|
projects: '$(Build.SourcesDirectory)/src/**/*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'
|
|
||||||
arguments: '--configuration $(buildConfiguration) --framework $(framework)'
|
arguments: '--configuration $(buildConfiguration) --framework $(framework)'
|
||||||
testRunTitle: 'Integration - $(buildDescription) - $(Build.BuildId)'
|
testRunTitle: 'Integration - $(buildDescription) - $(Build.BuildId)'
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Autofac" Version="6.5.0" />
|
<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>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
Reference in New Issue
Block a user