Repository navigation
[Draft] Add BCApps test worker timing markers - #14657
Esteban (esardaya) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Could not find a linked work item. Please link one in either of these ways: (1) link an ADO work item using the pattern 'AB#' followed by the work item number - you may use the 'Fixes' keyword to automatically resolve it when the pull request is merged, e.g. 'Fixes AB#1234'; or (2) link a GitHub issue of type 'Task' using the pattern 'Fixes #' followed by the issue number, e.g. 'Fixes #1234'. |
| function Write-TestWorkerTiming { | ||
| param( | ||
| [hashtable]$Timing, | ||
| [string]$Event, |
| Describe 'BCApps test worker timing' { | ||
| BeforeAll { | ||
| $scripts = Split-Path $PSScriptRoot | ||
| $timingModule = Import-Module (Join-Path $scripts 'ParallelTestExecution.psm1') -PassThru -Force |
| $fixture = Join-Path (Convert-Path $TestDrive) 'worker' | ||
| New-Item -ItemType Directory -Path $fixture, (Join-Path $fixture 'TestTolerance') | Out-Null | ||
| $wrapperPath = Join-Path $fixture 'RunTestsInBcContainer.ps1' | ||
| Copy-Item (Join-Path $scripts 'RunTestsInBcContainer.ps1') $wrapperPath |
There was a problem hiding this comment.
The worker test copies RunTestsInBcContainer.ps1 into its isolated fixture but does not copy TestWorkerTiming.ps1. The fixture's stub ParallelTestExecution.psm1 therefore never defines Write-TestWorkerTiming in the background job, so the timing assertions exercise unresolved commands rather than the intended worker instrumentation. Add the timing script to the fixture or explicitly dot-source it from the copied wrapper before invoking the timing functions.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v10.0.7
What & why
Add worker timing markers to logs when running tests to better understand where time is spent.
Linked work
Fixes #
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility