mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-24 18:05:07 +00:00
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:
@@ -116,6 +116,7 @@ filterwarnings = [
|
|||||||
"ignore::DeprecationWarning:ast",
|
"ignore::DeprecationWarning:ast",
|
||||||
"ignore::aiohttp.web_exceptions.NotAppKeyWarning",
|
"ignore::aiohttp.web_exceptions.NotAppKeyWarning",
|
||||||
"ignore::DeprecationWarning:pycaption.*",
|
"ignore::DeprecationWarning:pycaption.*",
|
||||||
|
"ignore::DeprecationWarning:pytest_asyncio.*",
|
||||||
"ignore::bs4.XMLParsedAsHTMLWarning",
|
"ignore::bs4.XMLParsedAsHTMLWarning",
|
||||||
]
|
]
|
||||||
addopts = "-ra --strict-markers"
|
addopts = "-ra --strict-markers"
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ function Run($a) {
|
|||||||
# (e.g. "2Gbe -> ~1900 Mbps expected ceiling"). Uses whatever CLI exists.
|
# (e.g. "2Gbe -> ~1900 Mbps expected ceiling"). Uses whatever CLI exists.
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
Write-Output "==================== speedtest baseline ===================="
|
Write-Output "==================== speedtest baseline ===================="
|
||||||
|
$global:LASTEXITCODE = 0
|
||||||
if (Get-Command speedtest -ErrorAction SilentlyContinue) {
|
if (Get-Command speedtest -ErrorAction SilentlyContinue) {
|
||||||
& speedtest --accept-license --accept-gdpr 2>&1 | ForEach-Object { "$_" }
|
& speedtest --accept-license --accept-gdpr 2>&1 | ForEach-Object { "$_" }
|
||||||
} elseif (Get-Command npx -ErrorAction SilentlyContinue) {
|
} elseif (Get-Command npx -ErrorAction SilentlyContinue) {
|
||||||
@@ -58,6 +59,9 @@ function Run($a) {
|
|||||||
} else {
|
} else {
|
||||||
Write-Output "no speedtest CLI found (install Ookla 'speedtest', have npx, or 'pip install speedtest-cli') - skipping"
|
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)
|
# 1. Synthetic downloader benchmark (offline, deterministic)
|
||||||
Run @("scripts/bench_downloader.py", "--segments", "64", "--workers", "1,2,4,8,16", "--runs", "3")
|
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 ""
|
||||||
Write-Output ("report saved: " + $out)
|
Write-Output ("report saved: " + $out)
|
||||||
} | Tee-Object -Variable report
|
} | Tee-Object -FilePath $out
|
||||||
# utf8 (not Tee-Object's utf16) so reports diff and grep cleanly across machines
|
# progressive tee keeps a partial report if the run dies; rewrite as utf8 at the end
|
||||||
$report | Out-File -FilePath $out -Encoding utf8
|
# (Tee-Object only writes utf16) so reports diff and grep cleanly across machines
|
||||||
|
(Get-Content $out) | Out-File -FilePath $out -Encoding utf8
|
||||||
|
|||||||
Reference in New Issue
Block a user