AutoMetabuilder Test Suite
Running Tests
Run all tests:
pytest backend/tests/
Run specific test files:
pytest backend/tests/test_main.py
pytest backend/tests/test_workflow_plugins.py
Run with verbose output:
pytest backend/tests/ -v
Test Structure
Core Tests (Always Passing)
test_main.py- Tests for main utility functionstest_metadata.py- Tests for metadata loadingtest_n8n_schema.py- Tests for N8N workflow schema validationtest_roadmap.py- Tests for roadmap utilitiestest_workflow_plugins.py- Tests for workflow plugin system (logic, math, string, list, dict plugins)test_unit_testing_plugins.py- Tests for testing framework plugins
Integration Tests (Require Dependencies)
test_ajax_contracts.py- Tests for API endpoints (requires Flask and workflow execution)test_web_plugins.py- Tests for web-specific plugins (requires Flask)test_workflow_graph.py- Tests for workflow graph building
Known Issues
Missing Optional Dependencies
Some tests require optional dependencies that may not be installed:
flask- Required for web server functionalitygithub(PyGithub) - Required for GitHub integrationopenai- Required for AI request pluginspython-dotenv- Required for environment loadingtenacity- Required for retry logic
To install all dependencies:
pip install flask PyGithub openai python-dotenv tenacity
Workflow-Based Architecture
The system has been refactored to use a workflow-based architecture. Some plugins that were previously static imports now need to be invoked through the workflow system:
-
Server Setup: The Flask server is no longer a static module but is built dynamically through workflow execution (see
packages/web_server_bootstrap/workflow.json) -
Plugin Imports: Some plugins have import path issues that need fixing:
web.build_contextreferences old route structure- Various plugins may reference
autometabuilder.workflow.plugins.*_helpersmodules
-
Test Adaptation: Tests should use the workflow execution model where appropriate (principle: "if in doubt, use the workflow")
Test Philosophy
Primary Principle: When in doubt, use the workflow.
The workflow system is the primary interface for the application. Tests should:
- Execute workflows to build/configure components
- Use workflow plugins for data access
- Avoid direct imports of implementation details where possible
Current Status
- ✅ 36 core tests passing
- ⚠️ 11 tests require dependencies or refactoring
- 📝 Test suite documented and configured with
conftest.py