diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d8f096b92..fed731232 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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)' diff --git a/src/Jackett.Test/Jackett.Test.csproj b/src/Jackett.Test/Jackett.Test.csproj index ee57d40d4..655b8457e 100644 --- a/src/Jackett.Test/Jackett.Test.csproj +++ b/src/Jackett.Test/Jackett.Test.csproj @@ -20,7 +20,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive