-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage: use nuget package #1737
Code coverage: use nuget package #1737
Conversation
812de51
to
6d35ed8
Compare
The XML Serializer does not set any culture. This results in "," vs "." problems in the conversion (see e.g. Before: <?xml version="1.0" encoding="UTF-8" ?>
<results>
<modules>
<module name="consoleapp2.dll" path="consoleapp2.dll" id="24DC3BD206049A4BBC0F96655A7CC2A601000000" block_coverage="33.33" line_coverage="25.00" blocks_covered="1" blocks_not_covered="2" lines_covered="1" lines_partially_covered="0" lines_not_covered="3"> After: <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<results>
<modules>
<module block_coverage="33,33" line_coverage="25,00" blocks_covered="1" blocks_not_covered="2" lines_covered="1" lines_partially_covered="0" lines_not_covered="3" name="consoleapp2.dll" path="consoleapp2.dll" id="24DC3BD206049A4BBC0F96655A7CC2A601000000"> |
util.ConvertCoverageFile(
path: inputBinaryFilePath,
outputPath: outputXmlFilePath,
includeSkippedFunctions: true,
includeSkippedModules: true); includeSkippedFunctions and includeSkippedModules add <module block_coverage="100,00" line_coverage="100,00" blocks_covered="3" blocks_not_covered="0" lines_covered="4" lines_partially_covered="0" lines_not_covered="0" name="testproject1.dll" path="testproject1.dll" id="9FEC91B69E3A6F429ABE0FF734AB036A01000000">
<functions>
<function block_coverage="100,00" line_coverage="100,00" blocks_covered="3" blocks_not_covered="0" lines_covered="4" lines_partially_covered="0" lines_not_covered="0" id="8284" token="0x6000003" name="TestMethod1()" namespace="TestProject1" type_name="UnitTest1">
<ranges>
<range source_id="0" covered="yes" start_line="9" start_column="9" end_line="9" end_column="10" />
<range source_id="0" covered="yes" start_line="10" start_column="13" end_line="10" end_column="43" />
<range source_id="0" covered="yes" start_line="11" start_column="13" end_line="11" end_column="35" />
<range source_id="0" covered="yes" start_line="12" start_column="9" end_line="12" end_column="10" />
</ranges>
</function>
</functions>
<skipped_functions>
<skipped_function id="8272" original_id="8272" token="0x6000001" name="Main(string[])" type_name="AutoGeneratedProgram" reason="attribute_excluded" />
</skipped_functions>
<source_files>
<source_file id="0" path="E:\ConsoleApp2\TestProject1\UnitTest1.cs" checksum_type="SHA256" checksum="1E5F51A4FC20C14E35B72D29D21E6372AA9BA14E42E52F33FB7ABC8AA21C1C96" />
</source_files>
</module>
</modules>
<skipped_modules>
<skipped_module name="clrjit.dll" path="clrjit.dll" reason="path_is_excluded" />
<skipped_module name="icu.dll" path="icu.dll" reason="no_symbols" /> We probably want this to be turned off. |
The current generated file looks a bit different than the expected file, but the content is the same: |
Tests/SonarScanner.MSBuild.TFS.Test/Classic/BinaryToXmlCoverageReportConverterTests.cs
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.TFS.Test/Classic/BinaryToXmlCoverageReportConverterTests.cs
Show resolved
Hide resolved
src/SonarScanner.MSBuild.TFS.Classic/BinaryToXmlCoverageReportConverter.cs
Show resolved
Hide resolved
src/SonarScanner.MSBuild.TFS.Classic/BinaryToXmlCoverageReportConverter.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.TFS.Classic/BinaryToXmlCoverageReportConverter.cs
Show resolved
Hide resolved
src/SonarScanner.MSBuild.TFS.Classic/BinaryToXmlCoverageReportConverter.cs
Show resolved
Hide resolved
075b51d
to
0a59134
Compare
Tests/SonarScanner.MSBuild.TFS.Test/ApplicationCultureInfoTests.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.TFS.Test/ApplicationCultureInfoTests.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.TFS.Test/Classic/BinaryToXmlCoverageReportConverterTests.cs
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.TFS.Test/Classic/BinaryToXmlCoverageReportConverterTests.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.TFS.Test/Classic/BinaryToXmlCoverageReportConverterTests.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.TFS.Test/Classic/BinaryToXmlCoverageReportConverterTests.cs
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.TFS.Test/Classic/BinaryToXmlCoverageReportConverterTests.cs
Show resolved
Hide resolved
src/SonarScanner.MSBuild.TFS.Classic/BinaryToXmlCoverageReportConverter.cs
Show resolved
Hide resolved
src/SonarScanner.MSBuild.TFS.Classic/BinaryToXmlCoverageReportConverter.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.TFS.Classic/BinaryToXmlCoverageReportConverter.cs
Show resolved
Hide resolved
src/SonarScanner.MSBuild.TFS.Classic/BinaryToXmlCoverageReportConverter.cs
Show resolved
Hide resolved
Co-authored-by: Costin Zaharia <[email protected]>
5be0583
to
8bb576b
Compare
SonarCloud Quality Gate failed. 0 Bugs 100.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
567335b
into
feature/BreakingChanges
Co-authored-by: Costin Zaharia <[email protected]>
Co-authored-by: Costin Zaharia <[email protected]>
Based on #1736
To Dos
ICoverageReportConverter.Initialize()
(follow-up PR)IVisualStudioSetupConfigurationFactory
(follow-up PR)resx
resources 54f16bcutil.ConvertCoverageFile
in a problematic culture like "de-DE" (1.123d is serialized as 1,123) 1d63afdApplicationCultureInfo
2ad12e3CodeCoverageExeTestMethodAttribute
4b89eedFixes #1652