test(traefik): mount the plugin's routes in the route test (#5741)
#5741 "Traefik routers are graded against their own normal". CI run 9126: the new route test got 404, because CI doesn't enable the Traefik plugin (enabling it would start its scraper against the shared database). The test now mounts traefik_bp on its own app, as plugin_manager.load_plugins does, with the plugin.yaml scrape interval. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -225,6 +225,12 @@ def test_the_page_grades_a_router_against_its_normal_and_lists_its_anomalies(app
|
||||
return (rows.status_code, await rows.get_data(as_text=True),
|
||||
widget.status_code, await widget.get_data(as_text=True))
|
||||
|
||||
# CI doesn't enable the plugin (it would start scraping), so mount its
|
||||
# blueprint here the way plugin_manager.load_plugins does.
|
||||
from plugins.traefik.routes import traefik_bp
|
||||
app.register_blueprint(traefik_bp, url_prefix="/plugins/traefik")
|
||||
app.config["PLUGINS"].setdefault("traefik", {"enabled": True, "scrape_interval_seconds": 60})
|
||||
|
||||
rows_status, page, widget_status, widget = asyncio.run(go())
|
||||
assert rows_status == 200 and widget_status == 200
|
||||
assert "4xx 60.0% is usual 58.0% at this hour" in page # healthy, and says why
|
||||
|
||||
Reference in New Issue
Block a user