1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-23 20:09:03 +00:00

Exclude already-existing layers from pull progress calculation

Layers that already exist locally should not count towards download
progress since there's nothing to download for them. Only layers that
need pulling are included in the progress calculation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Stefan Agner
2025-12-01 18:24:35 +01:00
parent 91f1f548e5
commit 24377b51df
5 changed files with 39 additions and 35 deletions

View File

@@ -305,8 +305,8 @@ async def test_api_progress_updates_home_assistant_update(
and evt.args[0]["data"]["event"] == WSEvent.JOB
and evt.args[0]["data"]["data"]["name"] == "home_assistant_core_update"
]
# Count-based progress: 4 layers (2 cached = 50%, 2 pulling = 25% each)
# Cached layers contribute immediately when downloading starts
# Count-based progress: 2 layers need pulling (each worth 50%)
# Layers that already exist are excluded from progress calculation
assert events[:5] == [
{
"stage": None,
@@ -320,34 +320,34 @@ async def test_api_progress_updates_home_assistant_update(
},
{
"stage": None,
"progress": 50.0,
"progress": 9.2,
"done": False,
},
{
"stage": None,
"progress": 54.6,
"progress": 25.6,
"done": False,
},
{
"stage": None,
"progress": 62.8,
"progress": 35.4,
"done": False,
},
]
assert events[-5:] == [
{
"stage": None,
"progress": 95.7,
"progress": 95.5,
"done": False,
},
{
"stage": None,
"progress": 97.1,
"progress": 96.9,
"done": False,
},
{
"stage": None,
"progress": 98.4,
"progress": 98.2,
"done": False,
},
{