chore(scripts): harden bench suite report capture

Speedtest failures print an exit-code note instead of an empty section,
the report file writes progressively again (utf8 rewrite at the end),
and pytest-asyncio's py3.14 deprecation warning is filtered.
This commit is contained in:
imSp4rky
2026-07-16 18:07:55 -06:00
parent b2363e11c7
commit 8fecb49605
2 changed files with 9 additions and 3 deletions
+1
View File
@@ -116,6 +116,7 @@ filterwarnings = [
"ignore::DeprecationWarning:ast",
"ignore::aiohttp.web_exceptions.NotAppKeyWarning",
"ignore::DeprecationWarning:pycaption.*",
"ignore::DeprecationWarning:pytest_asyncio.*",
"ignore::bs4.XMLParsedAsHTMLWarning",
]
addopts = "-ra --strict-markers"
+8 -3
View File
@@ -48,6 +48,7 @@ function Run($a) {
# (e.g. "2Gbe -> ~1900 Mbps expected ceiling"). Uses whatever CLI exists.
Write-Output ""
Write-Output "==================== speedtest baseline ===================="
$global:LASTEXITCODE = 0
if (Get-Command speedtest -ErrorAction SilentlyContinue) {
& speedtest --accept-license --accept-gdpr 2>&1 | ForEach-Object { "$_" }
} elseif (Get-Command npx -ErrorAction SilentlyContinue) {
@@ -58,6 +59,9 @@ function Run($a) {
} else {
Write-Output "no speedtest CLI found (install Ookla 'speedtest', have npx, or 'pip install speedtest-cli') - skipping"
}
if ($LASTEXITCODE -ne 0) {
Write-Output ("(speedtest CLI failed - exit code " + $LASTEXITCODE + "; numbers above may be missing)")
}
# 1. Synthetic downloader benchmark (offline, deterministic)
Run @("scripts/bench_downloader.py", "--segments", "64", "--workers", "1,2,4,8,16", "--runs", "3")
@@ -101,6 +105,7 @@ function Run($a) {
Write-Output ""
Write-Output ("report saved: " + $out)
} | Tee-Object -Variable report
# utf8 (not Tee-Object's utf16) so reports diff and grep cleanly across machines
$report | Out-File -FilePath $out -Encoding utf8
} | Tee-Object -FilePath $out
# progressive tee keeps a partial report if the run dies; rewrite as utf8 at the end
# (Tee-Object only writes utf16) so reports diff and grep cleanly across machines
(Get-Content $out) | Out-File -FilePath $out -Encoding utf8