Skip to content

Commit

Permalink
Workaround until .NET 7 RC2 is released: use environment variable to …
Browse files Browse the repository at this point in the history
…pass to MSBuild (microsoft/vstest#4014)
  • Loading branch information
gimlichael committed Sep 22, 2022
1 parent 740290a commit e63ae3e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .azure/jobs/build-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
- template: ../steps/minverversion-override.yml
- template: ../steps/restore.yml
- template: ../steps/docker-compose-up.yml
#- template: ../steps/sonarcloud-prepare.yml
- template: ../steps/sonarcloud-prepare.yml
- template: ../steps/build-net6_0.yml
- template: ../steps/unit-test.yml
#- template: ../steps/codecov-setup.yml
#- template: ../steps/sonarcloud-finalize.yml
- template: ../steps/codecov-setup.yml
- template: ../steps/sonarcloud-finalize.yml
- template: ../steps/docker-compose-down.yml
- template: ../steps/publish-artifact.yml

Expand Down
28 changes: 15 additions & 13 deletions .azure/steps/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
publishTestResults: true
env:
ConnectionStrings__AdventureWorks: $(ConnectionStrings--AdventureWorks)
CollectCoverage: true
CoverletOutputFormat: opencover

- task: DotNetCoreCLI@2
displayName: 'Test Solution - Windows'
Expand All @@ -18,18 +20,18 @@
projects: test/**/*.csproj
arguments: '--configuration $(BuildConfiguration) --verbosity quiet --collect:"XPlat Code Coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter FullyQualifiedName!~SqlClient'
publishTestResults: true
env:
CollectCoverage: true
CoverletOutputFormat: opencover

# .NET7 SDK and dotnet test does not work well together in regards to generating opencover.xml files
# for now I will leave out these.

# - script: reportgenerator "-reports:**/*.opencover.xml" "-targetdir:$(Build.SourcesDirectory)/Coverage" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
# condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
# displayName: 'Create Code Coverage Reports'
- script: reportgenerator "-reports:**/*.opencover.xml" "-targetdir:$(Build.SourcesDirectory)/Coverage" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
displayName: 'Create Code Coverage Reports'

# - task: PublishCodeCoverageResults@1
# condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
# displayName: 'Publish Code Coverage'
# inputs:
# codeCoverageTool: Cobertura
# summaryFileLocation: '$(Build.SourcesDirectory)/Coverage/Cobertura.xml'
# reportDirectory: '$(Build.SourcesDirectory)/Coverage'
- task: PublishCodeCoverageResults@1
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
displayName: 'Publish Code Coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/Coverage/Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/Coverage'

0 comments on commit e63ae3e

Please sign in to comment.