fix(docker): drop the unused .w-meter style; the bars test reads the loaded plugin's models (#5214)
CI / lint (push) Successful in 3s
CI / integration (push) Successful in 1m13s
CI / unit (push) Successful in 1m35s
CI / publish (push) Successful in 1m24s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 15:08:15 -04:00
co-authored by Claude Opus 5.5
parent 05eaca3f2f
commit 30f4de3612
2 changed files with 13 additions and 5 deletions
+13 -2
View File
@@ -4,6 +4,7 @@ time bucket in one query (#5214). Two samples share a bucket and must merge
from __future__ import annotations
import asyncio
import importlib
import os
import uuid
from datetime import datetime, timedelta, timezone
@@ -21,10 +22,20 @@ def app():
return create_app(testing=False)
def _docker(sub):
"""The app's loaded docker plugin module: importing plugins.docker.models a
second time raises "Table already defined" (see test_mcp_plugin_tools)."""
from steward.core.plugin_manager import get_loaded_plugin_modules
loaded = get_loaded_plugin_modules().get("docker")
base = loaded.__name__ if loaded is not None else "plugins.docker"
return importlib.import_module(f"{base}.{sub}")
def test_recent_usage_averages_each_containers_bucket(app):
from plugins.docker.models import DockerMetric
from plugins.docker.service import bar_slots, recent_usage
from steward.models.hosts import Host
DockerMetric = _docker("models").DockerMetric
service = _docker("service")
bar_slots, recent_usage = service.bar_slots, service.recent_usage
tag = uuid.uuid4().hex[:8]
hid = str(uuid.uuid4())