Repository navigation
ci: compare the performance measurements with recorded baselines - #155
Conversation
CIC-13. The performance tests write each measurement to the file ISL_PERFORMANCE_RESULTS names, the tests job runs them three times, and Build/Test-PerformanceBaseline.ps1 compares the median of each with the baseline recorded for the runner image in Tests/Performance/Baselines.psd1. A runner without a baseline is reported and not gated.
… runs Three jobs, three runs of the suite each: the medians of the jobs were up to a third apart in time and equal in memory, so a median twice its baseline, or a quarter more memory, fails the build. Closes #136
fadwen-ai
left a comment
There was a problem hiding this comment.
Four nits on the performance gate (CIC-13). The design holds up: the median of three runs, a baseline keyed by runner image, architecture and PowerShell version, failing when a baseline has no measurement, and a warning (not a failure) for a new image. The margins match the recorded runs, and the 8 unit tests cover the main paths.
Build/Test-PerformanceBaseline.ps1:142:-Recordformats decimals in the current culture. Under de-DE it printsSeconds = 1,06, which a psd1 reads as an array..github/workflows/quality-gates.yml:130: the performance step no longer writes an NUnit report or a job summary. A separate output folder for each run would keep both.Tests/Performance/AgentLogReader.Tests.ps1:162: the results file is only appended to, so a local-Recordtakes its median over earlier runs as well.Tests/Unit/Build/Test-PerformanceBaseline.Tests.ps1:149: no test covers a measurement without a baseline, which every CI run hits at 2,500 lines, or the default-Runnerkey.
Details are in the inline comments.
🤖 Generated with Claude Code
…un's reports -f wrote 1,06 under de-DE, which a baseline entry pasted into the data file reads as an array. Each performance run writes its NUnit file to a folder of its own and adds to the job summary. A results file with measurements from more than one PowerShell version is refused, and the tests cover a size without a baseline and the default runner key.
|
Round 1: 4 fixed, 0 not changed.
The branch also carries #154's round-1 fix, merged up. 12 passed on PowerShell 7.6 and 5.1; PSScriptAnalyzer clean in 354 files; CI is dispatched on this head. The description is updated. 🤖 Generated with Claude Code |
fadwen-ai
left a comment
There was a problem hiding this comment.
Round 2: all four round-1 findings are fixed, and I resolved their threads.
- Culture:
Format-Invariantwrites the numbers in the-Recordentry, the warning and the comparison lines, and the de-DE test fails against the round-1 script. - Reports: each run writes
reports/performance/run<n>/testResults.xml(Invoke-Tests.ps1creates the folder) and appends to the job summary. - Appended file: measurements from more than one PowerShell version are refused, and the help says to delete the file before a recording. Two recordings on the same version are not told apart. I accept the reason given: their median still describes that version.
- Coverage: new tests for a size without a baseline, the default runner key, and two versions in one file.
I re-read the whole diff against fix/ci-runner-tests and found nothing new. Test-PerformanceBaseline.Tests.ps1 passes 12 of 12 on PowerShell 7.6.10 and Windows PowerShell 5.1. With the round-1 script, the two new tests (two versions in one file, and the de-DE record) fail on both versions, so they test the fixes. The dispatched Quality Gates run on d3dc7a4 (45728469676) was still in progress when I approved; it is the first run of the gate against the recorded baselines.
🤖 Generated with Claude Code
Summary
Closes #136. CIC-13 asks for a gate that compares execution time and memory with recorded baselines for the code that has performance tests. The performance tests of #151 measured the log readers and held absolute limits; nothing compared a run with the runs before it. Stacked on #154, which makes
main's CI pass again; merge that first.Changes
Tests/Performance/AgentLogReader.Tests.ps1: each measurement is also written as a JSON line (name, lines, seconds, megabytes kept, PowerShell version) to the fileISL_PERFORMANCE_RESULTSnames.Build/Test-PerformanceBaseline.ps1: reads those lines, takes the median of each measurement over the runs, and compares it with the baseline of the runner:ImageOS/architecture/PowerShell major.minoron a hosted runner (win25-vs2026/X64/7.6today), the computer's name elsewhere. A median abovebaseline * (1 + margin)fails; a measurement with a baseline that was not taken fails; a runner with no baseline, such as a new image or a developer's computer, gets a warning with the medians and passes, so that an image change does not fail every build.-Recordprints the medians as a baseline entry. Numbers are written in the invariant culture, so an entry recorded under de-DE still reads1.06, and a file with measurements from more than one PowerShell version is refused.Tests/Performance/Baselines.psd1: the baselines ofwin25-vs2026/X64/7.6for both readers at 10,000 lines, and the margins: 1.0 for time and 0.25 for memory..github/workflows/quality-gates.yml: the performance step runs the suite three times with the variable set, each run writing its NUnit file toreports/performance/run<n>and adding to the job summary, and then the gate;measurements.jsonlis uploaded with the other reports.Tests/Unit/Build/Test-PerformanceBaseline.Tests.ps1(12 tests): within and over the margin for each measure, the median against one slow run, a baseline with nothing measured, no measurements, a size without a baseline, two PowerShell versions in one file, the default runner key, a runner without baselines, and-Record, also under de-DE.docs/StandardsDecisions.md,CLAUDE.mdandCHANGELOG.md.Verification
win25-vs2026. The job medians were 0.90, 1.06 and 1.10 s forGet-IntuneAgentLogand 1.24, 1.63 and 1.69 s forGet-IntuneAgentTimelineat 10,000 lines; the first run of each job took about twice as long as the other two, which the median leaves out. Memory kept was 25.7 and 20.2 MB in every run. The baselines are the middle job's medians.Test-PerformanceBaseline.Tests.ps1: 12 passed on PowerShell 7.6 and Windows PowerShell 5.1. PSScriptAnalyzer clean in 354 files; Markdown links clean.Notes
-Recordfrom those jobs.