Fix plugin settings route endpoint and enable parallel test execution
Bugfix: Fix AttributeError in /api/plugins/settings-routes endpoint - Changed get_enabled_plugin_instances() to get_all_plugins() - Added explicit enabled check with pm.registry.is_enabled() - Test failure: test_no_route_answers_a_nonsense_filter_with_a_server_error Optimization: Enable parallel test execution (Phase 1 of pytest speedup) - Added pytest-xdist configuration to pytest.ini - Enabled -n auto (auto-detect CPU cores, typically 8 workers) - Added slow marker for future test categorization - Expected speedup: 4-8x (20 min -> 2.5-5 min) Root cause: 2857 tests recreate entire schema per test (0.4-0.6s overhead each) - Phase 2 (savepoint isolation) will achieve 80x total speedup - See docs/PYTEST-OPTIMIZATION-PLAN.md for full analysis Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,15 @@
|
|||||||
# a stale artefact.
|
# a stale artefact.
|
||||||
testpaths = tests
|
testpaths = tests
|
||||||
|
|
||||||
|
# Parallel execution: auto-detect CPU cores and run tests in parallel
|
||||||
|
# Gives 4-8x speedup on modern machines (pytest-xdist required, already installed)
|
||||||
|
# Disable with: pytest -n0
|
||||||
|
addopts = -n auto
|
||||||
|
|
||||||
|
# Test markers
|
||||||
|
markers =
|
||||||
|
slow: marks tests as slow (deselect with '-m "not slow"')
|
||||||
|
|
||||||
# Belt and braces: even an explicit path or an IDE run must not descend into
|
# Belt and braces: even an explicit path or an IDE run must not descend into
|
||||||
# build output or a staged copy of the tree.
|
# build output or a staged copy of the tree.
|
||||||
norecursedirs =
|
norecursedirs =
|
||||||
|
|||||||
@@ -57,7 +57,10 @@ def get_plugin_settings_routes():
|
|||||||
return success_response({'routes': []})
|
return success_response({'routes': []})
|
||||||
|
|
||||||
routes = []
|
routes = []
|
||||||
for plugin in pm.get_enabled_plugin_instances():
|
for plugin_name, plugin in pm.get_all_plugins().items():
|
||||||
|
# Only include routes from enabled plugins
|
||||||
|
if not pm.registry.is_enabled(plugin_name):
|
||||||
|
continue
|
||||||
if hasattr(plugin, 'get_settings_routes'):
|
if hasattr(plugin, 'get_settings_routes'):
|
||||||
plugin_routes = plugin.get_settings_routes()
|
plugin_routes = plugin.get_settings_routes()
|
||||||
if plugin_routes:
|
if plugin_routes:
|
||||||
|
|||||||
Reference in New Issue
Block a user