2
2
[Parameter (HelpMessage = " Specifies the parent telemetry scope for the telemetry signal" , Mandatory = $false )]
3
3
[string ] $parentTelemetryScopeJson = ' 7b7d' ,
4
4
[Parameter (HelpMessage = " Project to analyze" , Mandatory = $false )]
5
- [string ] $project
5
+ [string ] $project = ' . '
6
6
)
7
7
8
8
$telemetryScope = $null
@@ -17,25 +17,40 @@ try {
17
17
. (Join-Path - Path $PSScriptRoot ' TestResultAnalyzer.ps1' )
18
18
19
19
$testResultsFile = Join-Path $ENV: GITHUB_WORKSPACE " $project \TestResults.xml"
20
- if (Test-Path $testResultsFile ) {
21
- $testResults = [xml ](Get-Content " $project \TestResults.xml" )
22
- $testResultSummary = GetTestResultSummary - testResults $testResults - includeFailures 50
20
+ $testResultsSummaryMD , $testResultsfailuresMD , $testResultsFailuresSummaryMD = GetTestResultSummaryMD - testResultsFile $testResultsFile
23
21
24
- Add-Content - Encoding UTF8 - Path $env: GITHUB_OUTPUT - Value " TestResultMD=$testResultSummary "
25
- Write-Host " TestResultMD=$testResultSummary "
22
+ $settings = $env: Settings | ConvertFrom-Json
23
+ $bcptTestResultsFile = Join-Path $ENV: GITHUB_WORKSPACE " $project \bcptTestResults.json"
24
+ $bcptBaseLineFile = Join-Path $ENV: GITHUB_WORKSPACE " $project \bcptBaseLine.json"
25
+ $bcptThresholdsFile = Join-Path $ENV: GITHUB_WORKSPACE " $project \bcptThresholds.json"
26
+ $bcptSummaryMD = GetBcptSummaryMD `
27
+ - bcptTestResultsFile $bcptTestResultsFile `
28
+ - baseLinePath $bcptBaseLineFile `
29
+ - thresholdsPath $bcptThresholdsFile `
30
+ - bcptThresholds ($settings.bcptThresholds | ConvertTo-HashTable )
26
31
27
- Add-Content - path $ENV: GITHUB_STEP_SUMMARY - value " $ ( $testResultSummary.Replace (" \n" , " `n " )) `n "
32
+ # If summary fits, we will display it in the GitHub summary
33
+ if ($testResultsSummaryMD.Length -gt 65000 ) {
34
+ # If Test results summary is too long, we will not display it in the GitHub summary, instead we will display a message to download the test results
35
+ $testResultsSummaryMD = " <i>Test results summary size exceeds GitHub summary capacity. Download **TestResults** artifact to see details.</i>"
28
36
}
29
- else {
30
- Write-Host " Test results not found"
37
+ # If summary AND BCPT summary fits, we will display both in the GitHub summary
38
+ if ($testResultsSummaryMD.Length + $bcptSummaryMD.Length -gt 65000 ) {
39
+ # If Combined Test Results and BCPT summary exceeds GitHub summary capacity, we will not display the BCPT summary
40
+ $bcptSummaryMD = " <i>Performance test results summary size exceeds GitHub summary capacity. Download **BcptTestResults** artifact to see details.</i>"
31
41
}
32
-
33
- $bcptTestResultsFile = Join-Path $ ENV: GITHUB_WORKSPACE " $project \BCPTTestResults.json "
34
- if ( Test-Path $bcptTestResultsFile ) {
35
- # TODO Display BCPT Test Results
42
+ # If summary AND BCPT summary AND failures summary fits, we will display all in the GitHub summary
43
+ if ( $testResultsSummaryMD .Length + $testResultsfailuresMD .Length + $bcptSummaryMD .Length -gt 65000 ) {
44
+ # If Combined Test Results, failures and BCPT summary exceeds GitHub summary capacity, we will not display the failures details, only the failures summary
45
+ $testResultsfailuresMD = $testResultsFailuresSummaryMD
36
46
}
37
- else {
38
- # Add-Content -path $ENV:GITHUB_STEP_SUMMARY -value "*BCPT test results not found*`n`n"
47
+
48
+ Add-Content - Encoding UTF8 - path $ENV: GITHUB_STEP_SUMMARY - value " ## Test results`n`n "
49
+ Add-Content - Encoding UTF8 - path $ENV: GITHUB_STEP_SUMMARY - value " $ ( $testResultsSummaryMD.Replace (" \n" , " `n " )) `n`n "
50
+ Add-Content - Encoding UTF8 - path $ENV: GITHUB_STEP_SUMMARY - value " $ ( $testResultsfailuresMD.Replace (" \n" , " `n " )) `n`n "
51
+ if ($bcptSummaryMD ) {
52
+ Add-Content - Encoding UTF8 - path $ENV: GITHUB_STEP_SUMMARY - value " ## Performance test results`n`n "
53
+ Add-Content - Encoding UTF8 - path $ENV: GITHUB_STEP_SUMMARY - value " $ ( $bcptSummaryMD.Replace (" \n" , " `n " )) `n`n "
39
54
}
40
55
41
56
TrackTrace - telemetryScope $telemetryScope
0 commit comments