Skip to content
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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

spetersenms
Copy link
Contributor

I added functionality to visualize page scripting tests, similar to how app and bcpt tests are visualized as MD.

I also updated the test analyzer action to take a new param, which decides which of those 3 types of tests to analyze and visualize.
I think this is a better approach that a separate action for analyzing page scripting tests, as it is nearly identical in implementation.

This approach also splits the analyzer visualization step into 3 separate steps, for each of the 3 types. This have the advantage, that we can easily add new test types to the analyzer in the future, but we are also more likely to display the results in the build summary. As each step has a limit of 1MiB, the current approach of displaying both app and bcpt results in the same step, are more likely to reach that limit. Now each summary for each type have a separate limit of 1MiB.

@Copilot Copilot bot review requested due to automatic review settings January 28, 2025 15:36
@spetersenms spetersenms requested a review from a team as a code owner January 28, 2025 15:36
@spetersenms
Copy link
Contributor Author

This can't be fully tested yet, due to a current dependency error in bc-replay which fails on install.

Copy link
Collaborator

@mazhelez mazhelez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think are couple of things that need adjusting, see comments.

[string] $project = '.'
[string] $project = '.',
[Parameter(HelpMessage = "Tests to analyze", Mandatory = $false)]
[string] $testsToAnalyze = 'app'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ValidateSet here.

@@ -14,6 +14,7 @@ none
| :-- | :-: | :-- | :-- |
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
| project | Yes | Name of project to analyze or . if the repository is setup for single project | |
| testsToAnalyze | No | Which set of tests to analyze. Should be one of ('app', 'bcpt', 'pageScripting') | app |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: how about testType with possible values "normal" (or "test"), "bcpt" and "pageScripting".

-baseLinePath $bcptBaseLineFile `
-thresholdsPath $bcptThresholdsFile `
-bcptThresholds ($settings.bcptThresholds | ConvertTo-HashTable)
if ($testsToAnalyze -eq 'app') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a switch statement instead.


- name: Analyze BCPT Test Results
id: analyzeTestResultsBCPT
if: (success() || failure()) && env.doNotRunBcptTests == 'False'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this env variable set?

I believe it needs to be included in "Read Settings", line 97.

Same for doNotRunpageScriptingTests.

@@ -14,6 +14,7 @@ none
| :-- | :-: | :-- | :-- |
| shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell |
| project | Yes | Name of project to analyze or . if the repository is setup for single project | |
| testsToAnalyze | No | Which set of tests to analyze. Should be one of ('app', 'bcpt', 'pageScripting') | app |

## OUTPUT
Copy link
Collaborator

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.


#Write total summary for all test suites
Write-Host "$totalTests tests, $totalPassed passed, $totalFailed failed, $totalSkipped skipped, $totalTime seconds"
$summarySb.AppendLine('|Suite|Tests|Passed|Failed|Skipped|Time|') | Out-Null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PowerShell generating Markdown is extremely hard to read.

Is there a way to define some MD templates with placeholders that could be used to generate the end-goal MD?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try see if I can come up with something that is easier to debug / code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants