public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "Guo, Gua" <gua.guo@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>,
	Michael Kubacki <mikuback@linux.microsoft.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH] .azurepipelines: Skip CodeCoverage if coverage.xml not found
Date: Fri, 6 Jan 2023 01:16:55 +0000	[thread overview]
Message-ID: <CO1PR11MB4929CB174E0CEBF2D5790F21D2FB9@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <4f8e95f65b608131ac7645cc3824624e913954fd.1672965793.git.gua.guo@intel.com>

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


  parent reply	other threads:[~2023-01-06  1:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2023-01-06  1:40 ` Michael Kubacki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR11MB4929CB174E0CEBF2D5790F21D2FB9@CO1PR11MB4929.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox