diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bafdac2ed..3f10e6c4c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -313,15 +313,6 @@ stages: projects: '**/*.Test*/*.csproj' arguments: '--configuration $(buildConfiguration) --runtime $(runtime) --framework $(framework)' - - task: DotNetCoreCLI@2 - displayName: Unit Tests (Windows only) - condition: and(succeeded(), startsWith(variables['runtime'], 'win')) - inputs: - command: test - projects: '**/*.Test*/*.csproj' - arguments: '--configuration $(buildConfiguration) --framework $(framework)' - testRunTitle: 'Unit - $(buildDescription) - $(Build.BuildId)' - - task: DotNetCoreCLI@2 displayName: Unit Tests (Mono, Linux and macOS) condition: and(succeeded(), not(startsWith(variables['runtime'], 'win'))) @@ -331,6 +322,37 @@ stages: arguments: '--configuration $(buildConfiguration) --framework $(framework) --runtime $(runtime)' testRunTitle: 'Unit - $(buildDescription) - $(Build.BuildId)' + - task: DotNetCoreCLI@2 + displayName: Unit Tests & Code Coverage (Windows only) + 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)' + + - task: DotNetCoreCLI@2 + displayName: Install Coverage ReportGenerator Tool (Windows only) + condition: and(succeeded(), startsWith(variables['runtime'], 'win')) + inputs: + command: custom + custom: tool + arguments: install --tool-path . 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" + + - task: PublishCodeCoverageResults@1 + displayName: Publish Code Coverage (Windows only) + condition: and(succeeded(), startsWith(variables['runtime'], 'win')) + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: $(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml + - stage: Integration displayName: Integration Tests diff --git a/src/Jackett.IntegrationTests/Jackett.IntegrationTests.csproj b/src/Jackett.IntegrationTests/Jackett.IntegrationTests.csproj index df5b5b421..69c71647f 100644 --- a/src/Jackett.IntegrationTests/Jackett.IntegrationTests.csproj +++ b/src/Jackett.IntegrationTests/Jackett.IntegrationTests.csproj @@ -12,10 +12,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/Jackett.Test/Jackett.Test.csproj b/src/Jackett.Test/Jackett.Test.csproj index 68d8836d7..363f12514 100644 --- a/src/Jackett.Test/Jackett.Test.csproj +++ b/src/Jackett.Test/Jackett.Test.csproj @@ -23,6 +23,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive +