versions used
SonarCloudAnalyze@1 as available in azure devops
error observed
I have a dotnet core project, I use azure CI pipeline to build, test and analyze with sonar
Everything works, project is analyzed, data is published to sonarcloud.
However, there is an error thrown and reported by azure pipeline
##[error]Nov 18, 2019 9:53:36 AM okhttp3.internal.platform.Platform log
steps to reproduce
- create an azure devops project
- have a dotnet project hosted with github
- add azure-pipeline.yml, an example below; do use SonarCloudPrepare@1, SonarCloudAnalyze@1 and SonarCloudPublish@1
potential workaround
None. However, the build passes, it’s just the error is highlighted and makes the whole build look like it’s hiding an error.
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ubuntu-latest
steps:
- task: SonarCloudPrepare@1
displayName: 'Prepare sonar'
inputs:
SonarCloud: 'Workload-SonarCloud'
organization: ui
projectKey: '${{ parameters.artifact }}'
projectName: '${{ parameters.artifact }}'
extraProperties: 'sonar.cs.opencover.reportsPaths=$(Build.ArtifactStagingDirectory)/${{ parameters.artifact }}/coverage/coverage.opencover.xml'
- powershell: |
dotnet tool install --global coverlet.console
displayName: Install corvelet
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: '**/${{ parameters.workingDirectory }}/*.sln'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: '**/${{ parameters.workingDirectory }}/*.sln'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: '**/${{ parameters.workingDirectory }}/*.sln'
arguments: "--configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=$(Build.ArtifactStagingDirectory)/${{ parameters.artifact }}/coverage/"
- task: SonarCloudAnalyze@1
displayName: 'Run sonar'
- task: SonarCloudPublish@1
displayName: 'Publish sonar'