public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found
@ 2023-01-06  0:44 Guo, Gua
  2023-01-06  1:04 ` [edk2-devel] " Sean
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guo, Gua @ 2023-01-06  0:44 UTC (permalink / raw)
  To: devel; +Cc: Gua Guo, Sean Brogan, Michael Kubacki, Michael D Kinney,
	Liming Gao

From: Gua Guo <gua.guo@intel.com>

Skip CodeCoverage if coverage.xml not found

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Gua Guo <gua.guo@intel.com>
---
 .azurepipelines/templates/pr-gate-build-job.yml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.azurepipelines/templates/pr-gate-build-job.yml b/.azurepipelines/templates/pr-gate-build-job.yml
index 840852b606..fff61a3193 100644
--- a/.azurepipelines/templates/pr-gate-build-job.yml
+++ b/.azurepipelines/templates/pr-gate-build-job.yml
@@ -100,16 +100,24 @@ jobs:
         buildType: 'current'
         targetPath: '$(Build.ArtifactStagingDirectory)'
 
+    - powershell: Write-Host "##vso[task.setvariable variable=is_code_coverage]0"
+      displayName: Give default value for whether CodeCoverage or not
+
+    - powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**/coverage.xml) {Write-Host "##vso[task.setvariable variable=is_code_coverage]1"}
+      displayName: Check coverage.xml exist or not
+
     - task: CmdLine@2
       displayName: Create code coverage report
       inputs:
         script: |
           dotnet tool install -g dotnet-reportgenerator-globaltool
           reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
+      condition: eq(variables.is_code_coverage, 1)
 
     - task: PublishCodeCoverageResults@1
       displayName: 'Publish code coverage'
       inputs:
         codeCoverageTool: Cobertura
         summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
+      condition: eq(variables.is_code_coverage, 1)
 
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found
  2023-01-06  0:44 [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found Guo, Gua
@ 2023-01-06  1:04 ` Sean
  2023-01-06  1:16 ` Michael D Kinney
  2023-01-06  1:40 ` [edk2-devel] " Michael Kubacki
  2 siblings, 0 replies; 4+ messages in thread
From: Sean @ 2023-01-06  1:04 UTC (permalink / raw)
  To: devel, gua.guo; +Cc: Sean Brogan, Michael Kubacki, Michael D Kinney, Liming Gao

Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>


On 1/5/2023 4:44 PM, Guo, Gua wrote:
> From: Gua Guo <gua.guo@intel.com>
>
> Skip CodeCoverage if coverage.xml not found
>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Gua Guo <gua.guo@intel.com>
> ---
>   .azurepipelines/templates/pr-gate-build-job.yml | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/.azurepipelines/templates/pr-gate-build-job.yml b/.azurepipelines/templates/pr-gate-build-job.yml
> index 840852b606..fff61a3193 100644
> --- a/.azurepipelines/templates/pr-gate-build-job.yml
> +++ b/.azurepipelines/templates/pr-gate-build-job.yml
> @@ -100,16 +100,24 @@ jobs:
>           buildType: 'current'
>
>           targetPath: '$(Build.ArtifactStagingDirectory)'
>
>   
>
> +    - powershell: Write-Host "##vso[task.setvariable variable=is_code_coverage]0"
>
> +      displayName: Give default value for whether CodeCoverage or not
>
> +
>
> +    - powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**/coverage.xml) {Write-Host "##vso[task.setvariable variable=is_code_coverage]1"}
>
> +      displayName: Check coverage.xml exist or not
>
> +
>
>       - task: CmdLine@2
>
>         displayName: Create code coverage report
>
>         inputs:
>
>           script: |
>
>             dotnet tool install -g dotnet-reportgenerator-globaltool
>
>             reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
>
> +      condition: eq(variables.is_code_coverage, 1)
>
>   
>
>       - task: PublishCodeCoverageResults@1
>
>         displayName: 'Publish code coverage'
>
>         inputs:
>
>           codeCoverageTool: Cobertura
>
>           summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
>
> +      condition: eq(variables.is_code_coverage, 1)
>
>   
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found
  2023-01-06  0:44 [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found Guo, Gua
  2023-01-06  1:04 ` [edk2-devel] " Sean
@ 2023-01-06  1:16 ` Michael D Kinney
  2023-01-06  1:40 ` [edk2-devel] " Michael Kubacki
  2 siblings, 0 replies; 4+ messages in thread
From: Michael D Kinney @ 2023-01-06  1:16 UTC (permalink / raw)
  To: Guo, Gua, devel@edk2.groups.io, Kinney, Michael D
  Cc: Sean Brogan, Michael Kubacki, Gao, Liming, Kinney, Michael D

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>


> -----Original Message-----
> From: Guo, Gua <gua.guo@intel.com>
> Sent: Thursday, January 5, 2023 4:44 PM
> To: devel@edk2.groups.io
> Cc: Guo, Gua <gua.guo@intel.com>; Sean Brogan <sean.brogan@microsoft.com>; Michael Kubacki <mikuback@linux.microsoft.com>; Kinney,
> Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>
> Subject: [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found
> 
> From: Gua Guo <gua.guo@intel.com>
> 
> Skip CodeCoverage if coverage.xml not found
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Gua Guo <gua.guo@intel.com>
> ---
>  .azurepipelines/templates/pr-gate-build-job.yml | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/.azurepipelines/templates/pr-gate-build-job.yml b/.azurepipelines/templates/pr-gate-build-job.yml
> index 840852b606..fff61a3193 100644
> --- a/.azurepipelines/templates/pr-gate-build-job.yml
> +++ b/.azurepipelines/templates/pr-gate-build-job.yml
> @@ -100,16 +100,24 @@ jobs:
>          buildType: 'current'
> 
>          targetPath: '$(Build.ArtifactStagingDirectory)'
> 
> 
> 
> +    - powershell: Write-Host "##vso[task.setvariable variable=is_code_coverage]0"
> 
> +      displayName: Give default value for whether CodeCoverage or not
> 
> +
> 
> +    - powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**/coverage.xml) {Write-Host "##vso[task.setvariable
> variable=is_code_coverage]1"}
> 
> +      displayName: Check coverage.xml exist or not
> 
> +
> 
>      - task: CmdLine@2
> 
>        displayName: Create code coverage report
> 
>        inputs:
> 
>          script: |
> 
>            dotnet tool install -g dotnet-reportgenerator-globaltool
> 
>            reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -
> targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
> 
> +      condition: eq(variables.is_code_coverage, 1)
> 
> 
> 
>      - task: PublishCodeCoverageResults@1
> 
>        displayName: 'Publish code coverage'
> 
>        inputs:
> 
>          codeCoverageTool: Cobertura
> 
>          summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
> 
> +      condition: eq(variables.is_code_coverage, 1)
> 
> 
> 
> --
> 2.31.1.windows.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found
  2023-01-06  0:44 [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found Guo, Gua
  2023-01-06  1:04 ` [edk2-devel] " Sean
  2023-01-06  1:16 ` Michael D Kinney
@ 2023-01-06  1:40 ` Michael Kubacki
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Kubacki @ 2023-01-06  1:40 UTC (permalink / raw)
  To: devel, gua.guo; +Cc: Sean Brogan, Michael D Kinney, Liming Gao

Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>

On 1/5/2023 7:44 PM, Guo, Gua wrote:
> From: Gua Guo <gua.guo@intel.com>
> 
> Skip CodeCoverage if coverage.xml not found
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Gua Guo <gua.guo@intel.com>
> ---
>   .azurepipelines/templates/pr-gate-build-job.yml | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/.azurepipelines/templates/pr-gate-build-job.yml b/.azurepipelines/templates/pr-gate-build-job.yml
> index 840852b606..fff61a3193 100644
> --- a/.azurepipelines/templates/pr-gate-build-job.yml
> +++ b/.azurepipelines/templates/pr-gate-build-job.yml
> @@ -100,16 +100,24 @@ jobs:
>           buildType: 'current'
> 
>           targetPath: '$(Build.ArtifactStagingDirectory)'
> 
>   
> 
> +    - powershell: Write-Host "##vso[task.setvariable variable=is_code_coverage]0"
> 
> +      displayName: Give default value for whether CodeCoverage or not
> 
> +
> 
> +    - powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**/coverage.xml) {Write-Host "##vso[task.setvariable variable=is_code_coverage]1"}
> 
> +      displayName: Check coverage.xml exist or not
> 
> +
> 
>       - task: CmdLine@2
> 
>         displayName: Create code coverage report
> 
>         inputs:
> 
>           script: |
> 
>             dotnet tool install -g dotnet-reportgenerator-globaltool
> 
>             reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
> 
> +      condition: eq(variables.is_code_coverage, 1)
> 
>   
> 
>       - task: PublishCodeCoverageResults@1
> 
>         displayName: 'Publish code coverage'
> 
>         inputs:
> 
>           codeCoverageTool: Cobertura
> 
>           summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
> 
> +      condition: eq(variables.is_code_coverage, 1)
> 
>   
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-06  1:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-06  0:44 [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found Guo, Gua
2023-01-06  1:04 ` [edk2-devel] " Sean
2023-01-06  1:16 ` Michael D Kinney
2023-01-06  1:40 ` [edk2-devel] " Michael Kubacki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox