-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Provide a general summary of your changes in the Title above --> <!-- Apply the label "bug" or "enhacement" as applicable. --> ## Description / Motivation <!-- Describe your changes in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If it fixes an open issue, please link to the issue here. --> This adds a nice build summary to inspect results of testing, code coverage and benchmark runs. To clean up the results certain test code has been filtered and excluded. ## Testing - [X] The Unit & Intergration tests are passing. - [X] I have added the necesary tests to cover my changes. ## Terms <!-- Place an X in the [] to check. --> <!-- The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it. --> - [X] I agree to follow this project's [Code of Conduct](CODE_OF_CONDUCT.md). Co-authored-by: Ivan Lieckens <[email protected]>
- Loading branch information
1 parent
4967f4b
commit 0ce00e4
Showing
18 changed files
with
134 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[CmdletBinding()] | ||
Param ( | ||
[Parameter(HelpMessage = "Path to the XML summary file of code coverage.")] | ||
[string]$CoverageReportPath, | ||
[Parameter(HelpMessage = "Path to the folder with TRX results.")] | ||
[string]$ResultFolderPath | ||
) | ||
|
||
$result = [System.Text.StringBuilder]::new() | ||
|
||
# Test Result Summary | ||
[void]$result.AppendLine("# :vertical_traffic_light: Test Results") | ||
[void]$result.AppendLine("| Assembly | :arrow_forward: | :white_check_mark: | :x: | :hash: |") | ||
[void]$result.AppendLine("|----------|-----------------|--------------------|-----|--------|") | ||
$totalExecuted = 0 | ||
$totalPassed = 0 | ||
$totalFailed = 0 | ||
$total = 0 | ||
foreach ($trx in (Get-ChildItem $ResultFolderPath -Include *.trx)) { | ||
$testrun = ([xml](Get-Content ([string]$trx).Replace("[", "``[").Replace("]", "``]"))).TestRun | ||
$counters = $testrun.ResultSummary.Counters | ||
if ($counters.Total -gt 0) { | ||
$assembly = $testrun.TestDefinitions.ChildNodes[0].TestMethod.CodeBase.Split("/")[-1].Replace(".dll", "") | ||
[void]$result.Append("| $assembly ") | ||
[void]$result.Append("| $($counters.Executed) ") | ||
$totalExecuted = $totalExecuted + $counters.Executed | ||
[void]$result.Append("| $($counters.Passed) ") | ||
$totalPassed = $totalPassed + $counters.Passed | ||
[void]$result.Append("| $($counters.Failed) ") | ||
$totalFailed = $totalFailed + $counters.Failed | ||
[void]$result.Append("| $($counters.Total) ") | ||
$total = $total + $counters.Total | ||
[void]$result.AppendLine("|") | ||
} | ||
} | ||
[void]$result.AppendLine("| Total | $totalExecuted | $totalPassed | $totalFailed | $total |") | ||
|
||
# Coverage Report Summary | ||
$report = ([xml](Get-Content $CoverageReportPath)).CoverageReport | ||
$summary = $report.Summary | ||
[void]$result.AppendLine("# :bar_chart: Code Coverage") | ||
|
||
[void]$result.AppendLine("## Summary") | ||
[void]$result.AppendLine("| Lines | Branches | Methods |") | ||
[void]$result.AppendLine("|-------|----------|---------|") | ||
[void]$result.Append("| $($summary.Linecoverage)% ($($summary.Coveredlines) / $($summary.Coverablelines)) ") | ||
[void]$result.Append("| $($summary.Branchcoverage)% ($($summary.Coveredbranches) / $($summary.Totalbranches)) ") | ||
[void]$result.Append("| $($summary.Methodcoverage)% ($($summary.Coveredmethods) / $($summary.Totalmethods)) ") | ||
[void]$result.AppendLine("|") | ||
|
||
[void]$result.AppendLine("## Assembly Details") | ||
[void]$result.AppendLine("| Assembly | Lines | Branches | Methods |") | ||
[void]$result.AppendLine("|----------|-------|----------|---------|") | ||
foreach ($assembly in $report.Coverage.ChildNodes) { | ||
[void]$result.Append("| $($assembly.name) ") | ||
[void]$result.Append("| $($assembly.coverage)% ($($assembly.coveredlines) / $($assembly.coverablelines)) ") | ||
[void]$result.Append("| $($assembly.branchcoverage)% ($($assembly.coveredbranches) / $($assembly.totalbranches)) ") | ||
[void]$result.Append("| $($assembly.methodcoverage)% ($($assembly.coveredmethods) / $($assembly.totalmethods)) ") | ||
[void]$result.AppendLine("|") | ||
} | ||
|
||
return $result.ToString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
tests/Sitecore.AspNetCore.SDK.AutoFixture/ActionProviders/SetupActionsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...s/Sitecore.AspNetCore.SDK.AutoFixture/ActionProviders/StaticMethodSetupActionsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...Sitecore.AspNetCore.SDK.AutoFixture/ActionProviders/StaticPropertySetupActionsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
tests/Sitecore.AspNetCore.SDK.AutoFixture/Attributes/AutoNSubstituteDataAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
tests/Sitecore.AspNetCore.SDK.AutoFixture/Attributes/InlineAutoNSubstituteDataAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
tests/Sitecore.AspNetCore.SDK.AutoFixture/Attributes/InlineAutoSetupDataAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
tests/Sitecore.AspNetCore.SDK.AutoFixture/Attributes/MemberAutoNSubstituteDataAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
tests/Sitecore.AspNetCore.SDK.AutoFixture/Attributes/MemberAutoSetupDataAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
tests/Sitecore.AspNetCore.SDK.AutoFixture/Extensions/GuardClauseAssertionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters