Skip to content

Commit 2307f65

Browse files
authored
Replace Newtonsoft.Json package with System.Text.Json (#1513)
* use system.Text.Json * improve dotnetTool test * check stderr * use dotnet-reportgenerator-globaltool * fix variable name * use system.Text.Json * improve dotnetTool test * check stderr * use dotnet-reportgenerator-globaltool * fix variable name * incorporate review comments * add code coverage badge for master branch * Restart CI * asdd standardOutput in test details * get more info’s for sporadic test errors * copy trx files to artifacts/TestLogs * fix folder name * Start CI
1 parent 85fa12e commit 2307f65

22 files changed

+1245
-1067
lines changed

.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-reportgenerator-globaltool": {
6+
"version": "5.1.24",
7+
"commands": [
8+
"reportgenerator"
9+
]
10+
}
11+
}
12+
}

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
We can check minimum supported package version here https://github.com/Microsoft/vstest/blob/master/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj#L34
4747
-->
4848
<PackageVersion Include="System.Reflection.Metadata" Version="1.6.0" />
49+
<PackageVersion Include="System.Text.Json" Version="7.0.3" />
4950
<!-- Coverlet.Core.Tests executed in Visual Studio will fail with Tmds.ExecFunction version > 0.4.0 => use "dotnet test"
5051
System.TypeInitializationException : The type initializer for 'Tmds.Utils.ExecFunction' threw an exception.
5152
System.NotSupportedException : Application is running as testhost, unable to determine parent 'dotnet' process.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Coverlet
22

3-
[![Build Status](https://dev.azure.com/tonerdo/coverlet/_apis/build/status/coverlet-coverage.coverlet?branchName=master)](https://dev.azure.com/tonerdo/coverlet/_build/latest?definitionId=5&branchName=master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/coverlet-coverage/coverlet/blob/master/LICENSE)
3+
[![Build Status](https://dev.azure.com/tonerdo/coverlet/_apis/build/status/coverlet-coverage.coverlet?branchName=master)](https://dev.azure.com/tonerdo/coverlet/_build/latest?definitionId=5&branchName=master) ![Code%20Coverage](https://img.shields.io/azure-devops/coverage/tonerdo/coverlet/5/master?label=Code%20Coverage) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/coverlet-coverage/coverlet/blob/master/LICENSE)
44

55
| Driver | Current version | Downloads |
66
|---|---|---|
@@ -170,8 +170,8 @@ Author and owner
170170

171171
Co-maintainers
172172

173-
* [David Müller](https://github.com/daveMueller)
174-
* [Bert](https://github.com/Bertk)
173+
* [David Müller](https://github.com/daveMueller)
174+
* [Bert](https://github.com/Bertk)
175175
* [Peter Liljenberg](https://github.com/petli)
176176
* [Marco Rossignoli](https://github.com/MarcoRossignoli)
177177

eng/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ trigger:
22
branches:
33
include: ["master", "*_validate"]
44
paths:
5-
exclude: [".github", "doc", "*.md"]
5+
exclude: [".github", "Documentation", "*.md"]
66

77
jobs:
88
- job: Windows

eng/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ steps:
2727

2828
- template: publish-coverlet-result-files.yml
2929

30-
#- template: publish-coverage-results.yml
31-
# parameters:
32-
# reports: $(Build.SourcesDirectory)/**/coverage.opencover.xml
33-
# condition: and(succeeded(), eq(variables['_BuildConfig'], 'Debug'))
34-
# assemblyfilters: '-xunit*;+Coverlet.Core.*;+Coverlet.Collector.*'
30+
- template: publish-coverage-results.yml
31+
parameters:
32+
reports: $(Build.SourcesDirectory)/**/coverage.opencover.xml
33+
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Debug'))
34+
assemblyfilters: '-xunit'
35+

eng/publish-coverage-results.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,29 @@ parameters:
55
condition: 'succeeded()'
66
reports: ''
77
assemblyfilters: '-xunit*'
8+
classfilters: ''
89
breakBuild: false
910

1011
steps:
11-
- task: reportgenerator@5
12+
- task: Powershell@2
1213
displayName: ReportGenerator
1314
condition: ${{parameters.condition}}
1415
inputs:
15-
reports: ${{parameters.reports}}
16-
targetdir: $(Build.SourcesDirectory)/artifacts/CoverageReport
17-
reporttypes: Html;HtmlInline_AzurePipelines_Dark;Cobertura
18-
verbosity: 'Verbose'
19-
assemblyfilters: ${{parameters.assemblyfilters}}
16+
targetType: inline
17+
pwsh: true
18+
script: |
19+
dotnet tool restore
20+
dotnet reportgenerator -reports:"${{parameters.reports}}" -targetdir:"$(Build.SourcesDirectory)/artifacts/CoverageReport" -reporttypes:"Html;HtmlInline_AzurePipelines_Dark;Cobertura" -assemblyfilters:"${{parameters.assemblyfilters}}" -classfilters:"${{parameters.classfilters}}" -verbosity:Verbose
21+
22+
# - task: reportgenerator@5
23+
# displayName: ReportGenerator
24+
# condition: ${{parameters.condition}}
25+
# inputs:
26+
# reports: ${{parameters.reports}}
27+
# targetdir: $(Build.SourcesDirectory)/artifacts/CoverageReport
28+
# reporttypes: Html;HtmlInline_AzurePipelines_Dark;Cobertura
29+
# verbosity: 'Verbose'
30+
# assemblyfilters: ${{parameters.assemblyfilters}}
2031

2132
- publish: '$(Build.SourcesDirectory)/artifacts/CoverageReport'
2233
displayName: 'Publish CoverageReport Artifact'

eng/publish-coverlet-result-files.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
steps:
22
- task: Powershell@2
3-
displayName: Prepare coverage files to Upload
3+
displayName: Prepare log files to Upload
44
inputs:
55
targetType: inline
66
pwsh: true
@@ -26,8 +26,15 @@ steps:
2626
continueOnError: true
2727
condition: always()
2828

29+
- task: CopyFiles@2
30+
displayName: Copy trx files
31+
inputs:
32+
SourceFolder: '$(Agent.TempDirectory)'
33+
Contents: '**/*.trx'
34+
TargetFolder: '$(Build.SourcesDirectory)/artifacts/TestLogs'
35+
2936
- task: PublishPipelineArtifact@1
30-
displayName: Publish coverage logs
37+
displayName: Publish Coverlet logs
3138
continueOnError: true
3239
condition: always()
3340
inputs:

src/coverlet.collector/coverlet.collector.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
<ItemGroup>
3838
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" />
39+
<PackageReference Include="NuGet.Frameworks" />
3940
</ItemGroup>
4041

4142
<ItemGroup>

0 commit comments

Comments
 (0)