-
Notifications
You must be signed in to change notification settings - Fork 130
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
Page Scripting test result visualizer & updated test analyzer logic. #1423
Draft
spetersenms
wants to merge
31
commits into
microsoft:main
Choose a base branch
from
spetersenms:PageScriptReporter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 22 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
cfa1cf5
Page Scripting tests analyzer added
spetersenms d847c20
Running page scripting tests
spetersenms d6eb5d3
Unique identifier for each test analyzer step.
spetersenms 548333f
Moved TestResultAnalyzer load outside if statement.
spetersenms ff3c795
Removed commented code
spetersenms c8ab211
Updated return message when no BCPT test result file found.
spetersenms 8c97234
cleanup
spetersenms dc18262
Aligned pageScripting analyzer with other analyzer logic
spetersenms a963376
Added documentation for new param
spetersenms 6f277ed
Each analyzer step now depends on setting related to the analyzed typ…
spetersenms 8a0e951
pre-commit
spetersenms 0500101
Renamed default testsToAnalyzer param to app
spetersenms 0999647
Adding additional test analyzer steps to AppSource template yaml
spetersenms 6c3ed9c
Aligning Write-Host in pageScripting fucntion to original design
spetersenms 82522f4
Merge branch 'main' into PageScriptReporter
spetersenms f7cc15b
Renamed testsToAnalyze param to testType, and included a ValidateSet …
spetersenms d172421
Reading do not run settings for bcpt and page scripting tests
spetersenms 14ec8de
Using switch statement.
spetersenms d8191b0
Helper functions to build MD and html content.
spetersenms fa88a33
Using new helper functions
spetersenms 9a516a9
Fixed output type.
spetersenms 1e92ee4
Cleanup of old code.
spetersenms 6f289ca
pre-commit
spetersenms a0a0b47
renamed parameter.
spetersenms e66d313
Changed parameter type
spetersenms 5a615fe
Added generic MD table creator in own helper file.
spetersenms 3cf09ec
Pre-commit
spetersenms 1f7f2a7
Using new helper function.
spetersenms 80a89b8
typo in file name.
spetersenms e9c7297
Type error
spetersenms 01aceb3
Importing md helper correctly.
spetersenms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,45 +1,57 @@ | ||
Param( | ||
[Parameter(HelpMessage = "Project to analyze", Mandatory = $false)] | ||
[string] $project = '.' | ||
[string] $project = '.', | ||
[Parameter(HelpMessage = "Tests to analyze", Mandatory = $false)] | ||
[ValidateSet('normal', 'bcpt', 'pageScripting')] | ||
[string] $testType = 'normal' | ||
) | ||
|
||
. (Join-Path -Path $PSScriptRoot -ChildPath "..\AL-Go-Helper.ps1" -Resolve) | ||
|
||
. (Join-Path -Path $PSScriptRoot 'TestResultAnalyzer.ps1') | ||
|
||
$testResultsFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\TestResults.xml" | ||
$testResultsSummaryMD, $testResultsfailuresMD, $testResultsFailuresSummaryMD = GetTestResultSummaryMD -testResultsFile $testResultsFile | ||
$testResultsSummaryMD = '' | ||
$testResultsfailuresMD = '' | ||
$testResultsFailuresSummaryMD = '' | ||
|
||
$settings = $env:Settings | ConvertFrom-Json | ||
$bcptTestResultsFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\bcptTestResults.json" | ||
$bcptBaseLineFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\bcptBaseLine.json" | ||
$bcptThresholdsFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\bcptThresholds.json" | ||
$bcptSummaryMD = GetBcptSummaryMD ` | ||
-bcptTestResultsFile $bcptTestResultsFile ` | ||
-baseLinePath $bcptBaseLineFile ` | ||
-thresholdsPath $bcptThresholdsFile ` | ||
-bcptThresholds ($settings.bcptThresholds | ConvertTo-HashTable) | ||
switch ($testType) { | ||
'normal' { | ||
$testResultsFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\TestResults.xml" | ||
$testResultsSummaryMD, $testResultsfailuresMD, $testResultsFailuresSummaryMD = GetTestResultSummaryMD -testResultsFile $testResultsFile | ||
$testTitle = "Test results" | ||
} | ||
'bcpt' { | ||
$settings = $env:Settings | ConvertFrom-Json | ||
$bcptTestResultsFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\bcptTestResults.json" | ||
$bcptBaseLineFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\bcptBaseLine.json" | ||
$bcptThresholdsFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\bcptThresholds.json" | ||
$testResultsSummaryMD = GetBcptSummaryMD ` | ||
-bcptTestResultsFile $bcptTestResultsFile ` | ||
-baseLinePath $bcptBaseLineFile ` | ||
-thresholdsPath $bcptThresholdsFile ` | ||
-bcptThresholds ($settings.bcptThresholds | ConvertTo-HashTable) | ||
$testTitle = "Performance test results" | ||
} | ||
'pageScripting' { | ||
$testResultsFile = Join-Path $ENV:GITHUB_WORKSPACE "$project\PageScriptingTestResults.xml" | ||
$testResultsSummaryMD, $testResultsfailuresMD, $testResultsFailuresSummaryMD = GetPageScriptingTestResultSummaryMD -testResultsFile $testResultsFile | ||
$testTitle = "Page Scripting test results" | ||
} | ||
default { | ||
Write-Host "::error:: Unknown test type: $testType" | ||
return '' | ||
} | ||
} | ||
|
||
# If summary fits, we will display it in the GitHub summary | ||
if ($testResultsSummaryMD.Length -gt 65000) { | ||
# 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 | ||
$testResultsSummaryMD = "<i>Test results summary size exceeds GitHub summary capacity. Download **TestResults** artifact to see details.</i>" | ||
} | ||
# If summary AND BCPT summary fits, we will display both in the GitHub summary | ||
if ($testResultsSummaryMD.Length + $bcptSummaryMD.Length -gt 65000) { | ||
# If Combined Test Results and BCPT summary exceeds GitHub summary capacity, we will not display the BCPT summary | ||
$bcptSummaryMD = "<i>Performance test results summary size exceeds GitHub summary capacity. Download **BcptTestResults** artifact to see details.</i>" | ||
} | ||
# If summary AND BCPT summary AND failures summary fits, we will display all in the GitHub summary | ||
if ($testResultsSummaryMD.Length + $testResultsfailuresMD.Length + $bcptSummaryMD.Length -gt 65000) { | ||
# If Combined Test Results, failures and BCPT summary exceeds GitHub summary capacity, we will not display the failures details, only the failures summary | ||
if ($testResultsSummaryMD.Length + $testResultsfailuresMD.Length -gt 65000) { | ||
# If Combined Test Results and failures exceeds GitHub summary capacity, we will not display the failures details, only the failures summary | ||
$testResultsfailuresMD = $testResultsFailuresSummaryMD | ||
} | ||
|
||
Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "## Test results`n`n" | ||
Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "## $testTitle`n`n" | ||
Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "$($testResultsSummaryMD.Replace("\n","`n"))`n`n" | ||
Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "$($testResultsfailuresMD.Replace("\n","`n"))`n`n" | ||
if ($bcptSummaryMD) { | ||
Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "## Performance test results`n`n" | ||
Add-Content -Encoding UTF8 -path $ENV:GITHUB_STEP_SUMMARY -value "$($bcptSummaryMD.Replace("\n","`n"))`n`n" | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think the action has output.
OUTPUT variables
might need to be cleaned up.