Browse Source

Fix pipeline deprecation warnings (#651)

Upgrade PublishCodeCoverageResults@2
Vince Salvino 8 months ago
parent
commit
a5cdd188c3
2 changed files with 3 additions and 3 deletions
  1. 1 2
      azure-pipelines.yml
  2. 2 1
      ci/compare-codecov.ps1

+ 1 - 2
azure-pipelines.yml

@@ -81,11 +81,10 @@ stages:
         testResultsFiles: '**/test-*.xml'
         testRunTitle: 'Publish test results for Python $(python.version)'
 
-    - task: PublishCodeCoverageResults@1
+    - task: PublishCodeCoverageResults@2
       displayName: 'Publish code coverage report'
       condition: succeededOrFailed()
       inputs:
-        codeCoverageTool: Cobertura
         summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
 
 

+ 2 - 1
ci/compare-codecov.ps1

@@ -68,7 +68,8 @@ foreach ($cov in $mainCoverageJson.coverageData.coverageStats) {
 
 
 # Get current code coverage from coverage.xml file.
-$coveragePath = Get-ChildItem -Recurse -Filter "coverage.xml" $wd
+# Use the first one, if there are multiple i.e. from multiple runs.
+$coveragePath = (Get-ChildItem -Recurse -Filter "coverage.xml" $wd)[0]
 if (Test-Path -Path $coveragePath) {
     [xml]$BranchXML = Get-Content $coveragePath
 }