From 096017b93f4b2c952678357beb16381fbcc918c3 Mon Sep 17 00:00:00 2001 From: tegwick Date: Sat, 25 Oct 2025 02:37:45 +0200 Subject: [PATCH] feat: reorganize tests by capability with separate test targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separate capability-specific tests from core system tests to establish clear test organization and separation of concerns. ## Test Reorganization: - **markitect-content tests**: Moved 6 tests to capabilities/markitect-content/tests/ - **markitect-finance tests**: Moved 7 tests to markitect/finance/tests/ - **markitect-query tests**: Moved 1 test to markitect/query_paradigms/tests/ - **markitect-graphql tests**: Moved 2 tests to markitect/graphql/tests/ - **markitect-plugins tests**: Moved 2 tests to markitect/plugins/tests/ ## Makefile Updates: - **make test**: Excludes capability tests, runs only core system tests - **make test-capabilities**: Runs all capability tests - **make test-capability-***: Individual capability test targets - Updated all test targets (test-red, test-green, test-ultra-fast, test-perf) - Added capability test targets to help documentation ## Benefits: - Clear separation between core system tests and capability-specific tests - Faster core test execution (capability tests not run by default) - Individual capability testing for focused development - Supports future capability extraction workflow - Maintains capability test independence Test verification: - Core tests: 1291 tests (capability tests excluded) - Finance capability: 143 tests working independently - Content capability: 79 tests working independently 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Makefile | 82 +++++++++++++++++-- ...test_issue_46_schema_generation_outline.py | 0 .../test_issue_50_metaschema_definition.py | 0 .../test_issue_54_content_instructions.py | 0 ..._issue_55_schema_based_draft_generation.py | 0 ...t_issue_56_data_driven_draft_generation.py | 0 .../test_markdownmatters_integration.py | 0 markitect/finance/tests/__init__.py | 0 .../finance/tests}/test_cost_cli_commands.py | 0 .../finance/tests}/test_cost_manager.py | 0 .../tests}/test_cost_report_generator.py | 0 .../finance/tests}/test_finance_models.py | 0 .../test_issue_122_worktime_tracking.py | 0 .../tests}/test_period_cli_commands.py | 0 .../finance/tests}/test_period_manager.py | 0 markitect/graphql/tests/__init__.py | 0 .../tests}/test_issue_10_graphql_mutations.py | 0 .../tests}/test_issue_9_graphql_interface.py | 0 markitect/plugins/tests/__init__.py | 0 .../test_issue_19_plugin_architecture.py | 0 .../tests}/test_issue_83_full_text_search.py | 0 markitect/query_paradigms/tests/__init__.py | 0 .../tests}/test_query_paradigms.py | 0 23 files changed, 74 insertions(+), 8 deletions(-) rename {tests => capabilities/markitect-content/tests}/test_issue_46_schema_generation_outline.py (100%) rename {tests => capabilities/markitect-content/tests}/test_issue_50_metaschema_definition.py (100%) rename {tests => capabilities/markitect-content/tests}/test_issue_54_content_instructions.py (100%) rename {tests => capabilities/markitect-content/tests}/test_issue_55_schema_based_draft_generation.py (100%) rename {tests => capabilities/markitect-content/tests}/test_issue_56_data_driven_draft_generation.py (100%) rename {tests => capabilities/markitect-content/tests}/test_markdownmatters_integration.py (100%) create mode 100644 markitect/finance/tests/__init__.py rename {tests => markitect/finance/tests}/test_cost_cli_commands.py (100%) rename {tests => markitect/finance/tests}/test_cost_manager.py (100%) rename {tests => markitect/finance/tests}/test_cost_report_generator.py (100%) rename {tests => markitect/finance/tests}/test_finance_models.py (100%) rename {tests => markitect/finance/tests}/test_issue_122_worktime_tracking.py (100%) rename {tests => markitect/finance/tests}/test_period_cli_commands.py (100%) rename {tests => markitect/finance/tests}/test_period_manager.py (100%) create mode 100644 markitect/graphql/tests/__init__.py rename {tests => markitect/graphql/tests}/test_issue_10_graphql_mutations.py (100%) rename {tests => markitect/graphql/tests}/test_issue_9_graphql_interface.py (100%) create mode 100644 markitect/plugins/tests/__init__.py rename {tests => markitect/plugins/tests}/test_issue_19_plugin_architecture.py (100%) rename {tests => markitect/plugins/tests}/test_issue_83_full_text_search.py (100%) create mode 100644 markitect/query_paradigms/tests/__init__.py rename {tests => markitect/query_paradigms/tests}/test_query_paradigms.py (100%) diff --git a/Makefile b/Makefile index 2b776e15..46b82626 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,9 @@ help: @echo " venv-status - Check if venv is active" @echo "" @echo "Development:" - @echo " test - Run all tests" + @echo " test - Run core tests (excluding capability-specific tests)" + @echo " test-capabilities - Run all capability-specific tests" + @echo " test-capability-* - Run specific capability tests (content, utils, finance, etc.)" @echo " test-status - Show test status summary without re-running" @echo " test-new - Create new test file template" @echo " test-coverage - Analyze test coverage" @@ -320,25 +322,77 @@ setup-dev: install-dev # Run tests test: $(VENV)/bin/activate - @echo "🧪 Running tests..." + @echo "🧪 Running core tests (excluding capability-specific tests)..." @if [ -f $(VENV)/bin/pytest ]; then \ - PYTHONPATH=. $(VENV)/bin/pytest tests/ -v; \ + PYTHONPATH=. $(VENV)/bin/pytest tests/ -v \ + --ignore=capabilities/markitect-content/tests/ \ + --ignore=capabilities/markitect-utils/tests/ \ + --ignore=markitect/finance/tests/ \ + --ignore=markitect/query_paradigms/tests/ \ + --ignore=markitect/graphql/tests/ \ + --ignore=markitect/plugins/tests/; \ else \ - PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ -v 2>/dev/null || \ + PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ -v \ + --ignore=capabilities/markitect-content/tests/ \ + --ignore=capabilities/markitect-utils/tests/ \ + --ignore=markitect/finance/tests/ \ + --ignore=markitect/query_paradigms/tests/ \ + --ignore=markitect/graphql/tests/ \ + --ignore=markitect/plugins/tests/ 2>/dev/null || \ PYTHONPATH=. $(VENV_PYTHON) -m unittest discover tests/ -v; \ fi +# Capability-Specific Test Targets +test-capabilities: test-capability-content test-capability-utils test-capability-finance test-capability-query test-capability-graphql test-capability-plugins + @echo "✅ All capability tests completed" + +test-capability-content: $(VENV)/bin/activate + @echo "🧪 Running markitect-content capability tests..." + @cd capabilities/markitect-content && python -m pytest tests/ -v + +test-capability-utils: $(VENV)/bin/activate + @echo "🧪 Running markitect-utils capability tests..." + @cd capabilities/markitect-utils && python -m pytest tests/ -v + +test-capability-finance: $(VENV)/bin/activate + @echo "🧪 Running finance capability tests..." + @PYTHONPATH=. $(VENV_PYTHON) -m pytest markitect/finance/tests/ -v + +test-capability-query: $(VENV)/bin/activate + @echo "🧪 Running query paradigms capability tests..." + @PYTHONPATH=. $(VENV_PYTHON) -m pytest markitect/query_paradigms/tests/ -v + +test-capability-graphql: $(VENV)/bin/activate + @echo "🧪 Running GraphQL capability tests..." + @PYTHONPATH=. $(VENV_PYTHON) -m pytest markitect/graphql/tests/ -v + +test-capability-plugins: $(VENV)/bin/activate + @echo "🧪 Running plugins capability tests..." + @PYTHONPATH=. $(VENV_PYTHON) -m pytest markitect/plugins/tests/ -v + # TDD8 Workflow Optimized Test Targets (Issue #57) # Fast test execution for TDD red phase test-red: $(VENV)/bin/activate @echo "🔴 TDD Red Phase - Fast test execution..." - PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ -x --maxfail=1 --tb=short -q + PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ -x --maxfail=1 --tb=short -q \ + --ignore=capabilities/markitect-content/tests/ \ + --ignore=capabilities/markitect-utils/tests/ \ + --ignore=markitect/finance/tests/ \ + --ignore=markitect/query_paradigms/tests/ \ + --ignore=markitect/graphql/tests/ \ + --ignore=markitect/plugins/tests/ # Comprehensive test execution for TDD green phase test-green: $(VENV)/bin/activate @echo "🟢 TDD Green Phase - Comprehensive validation..." - PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ --tb=short + PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ --tb=short \ + --ignore=capabilities/markitect-content/tests/ \ + --ignore=capabilities/markitect-utils/tests/ \ + --ignore=markitect/finance/tests/ \ + --ignore=markitect/query_paradigms/tests/ \ + --ignore=markitect/graphql/tests/ \ + --ignore=markitect/plugins/tests/ # Smart test selection - changed files only test-smart: $(VENV)/bin/activate @@ -354,12 +408,24 @@ test-smart: $(VENV)/bin/activate # Ultra-fast test execution test-ultra-fast: $(VENV)/bin/activate @echo "⚡ Ultra-fast test execution..." - PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ -m "not slow" --maxfail=1 -x -q + PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ -m "not slow" --maxfail=1 -x -q \ + --ignore=capabilities/markitect-content/tests/ \ + --ignore=capabilities/markitect-utils/tests/ \ + --ignore=markitect/finance/tests/ \ + --ignore=markitect/query_paradigms/tests/ \ + --ignore=markitect/graphql/tests/ \ + --ignore=markitect/plugins/tests/ # Test with performance monitoring test-perf: $(VENV)/bin/activate @echo "📊 Test execution with performance monitoring..." - PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ --durations=10 --tb=short + PYTHONPATH=. $(VENV_PYTHON) -m pytest tests/ --durations=10 --tb=short \ + --ignore=capabilities/markitect-content/tests/ \ + --ignore=capabilities/markitect-utils/tests/ \ + --ignore=markitect/finance/tests/ \ + --ignore=markitect/query_paradigms/tests/ \ + --ignore=markitect/graphql/tests/ \ + --ignore=markitect/plugins/tests/ # Test health check test-health: $(VENV)/bin/activate diff --git a/tests/test_issue_46_schema_generation_outline.py b/capabilities/markitect-content/tests/test_issue_46_schema_generation_outline.py similarity index 100% rename from tests/test_issue_46_schema_generation_outline.py rename to capabilities/markitect-content/tests/test_issue_46_schema_generation_outline.py diff --git a/tests/test_issue_50_metaschema_definition.py b/capabilities/markitect-content/tests/test_issue_50_metaschema_definition.py similarity index 100% rename from tests/test_issue_50_metaschema_definition.py rename to capabilities/markitect-content/tests/test_issue_50_metaschema_definition.py diff --git a/tests/test_issue_54_content_instructions.py b/capabilities/markitect-content/tests/test_issue_54_content_instructions.py similarity index 100% rename from tests/test_issue_54_content_instructions.py rename to capabilities/markitect-content/tests/test_issue_54_content_instructions.py diff --git a/tests/test_issue_55_schema_based_draft_generation.py b/capabilities/markitect-content/tests/test_issue_55_schema_based_draft_generation.py similarity index 100% rename from tests/test_issue_55_schema_based_draft_generation.py rename to capabilities/markitect-content/tests/test_issue_55_schema_based_draft_generation.py diff --git a/tests/test_issue_56_data_driven_draft_generation.py b/capabilities/markitect-content/tests/test_issue_56_data_driven_draft_generation.py similarity index 100% rename from tests/test_issue_56_data_driven_draft_generation.py rename to capabilities/markitect-content/tests/test_issue_56_data_driven_draft_generation.py diff --git a/tests/test_markdownmatters_integration.py b/capabilities/markitect-content/tests/test_markdownmatters_integration.py similarity index 100% rename from tests/test_markdownmatters_integration.py rename to capabilities/markitect-content/tests/test_markdownmatters_integration.py diff --git a/markitect/finance/tests/__init__.py b/markitect/finance/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_cost_cli_commands.py b/markitect/finance/tests/test_cost_cli_commands.py similarity index 100% rename from tests/test_cost_cli_commands.py rename to markitect/finance/tests/test_cost_cli_commands.py diff --git a/tests/test_cost_manager.py b/markitect/finance/tests/test_cost_manager.py similarity index 100% rename from tests/test_cost_manager.py rename to markitect/finance/tests/test_cost_manager.py diff --git a/tests/test_cost_report_generator.py b/markitect/finance/tests/test_cost_report_generator.py similarity index 100% rename from tests/test_cost_report_generator.py rename to markitect/finance/tests/test_cost_report_generator.py diff --git a/tests/test_finance_models.py b/markitect/finance/tests/test_finance_models.py similarity index 100% rename from tests/test_finance_models.py rename to markitect/finance/tests/test_finance_models.py diff --git a/tests/test_issue_122_worktime_tracking.py b/markitect/finance/tests/test_issue_122_worktime_tracking.py similarity index 100% rename from tests/test_issue_122_worktime_tracking.py rename to markitect/finance/tests/test_issue_122_worktime_tracking.py diff --git a/tests/test_period_cli_commands.py b/markitect/finance/tests/test_period_cli_commands.py similarity index 100% rename from tests/test_period_cli_commands.py rename to markitect/finance/tests/test_period_cli_commands.py diff --git a/tests/test_period_manager.py b/markitect/finance/tests/test_period_manager.py similarity index 100% rename from tests/test_period_manager.py rename to markitect/finance/tests/test_period_manager.py diff --git a/markitect/graphql/tests/__init__.py b/markitect/graphql/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_issue_10_graphql_mutations.py b/markitect/graphql/tests/test_issue_10_graphql_mutations.py similarity index 100% rename from tests/test_issue_10_graphql_mutations.py rename to markitect/graphql/tests/test_issue_10_graphql_mutations.py diff --git a/tests/test_issue_9_graphql_interface.py b/markitect/graphql/tests/test_issue_9_graphql_interface.py similarity index 100% rename from tests/test_issue_9_graphql_interface.py rename to markitect/graphql/tests/test_issue_9_graphql_interface.py diff --git a/markitect/plugins/tests/__init__.py b/markitect/plugins/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_issue_19_plugin_architecture.py b/markitect/plugins/tests/test_issue_19_plugin_architecture.py similarity index 100% rename from tests/test_issue_19_plugin_architecture.py rename to markitect/plugins/tests/test_issue_19_plugin_architecture.py diff --git a/tests/test_issue_83_full_text_search.py b/markitect/plugins/tests/test_issue_83_full_text_search.py similarity index 100% rename from tests/test_issue_83_full_text_search.py rename to markitect/plugins/tests/test_issue_83_full_text_search.py diff --git a/markitect/query_paradigms/tests/__init__.py b/markitect/query_paradigms/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_query_paradigms.py b/markitect/query_paradigms/tests/test_query_paradigms.py similarity index 100% rename from tests/test_query_paradigms.py rename to markitect/query_paradigms/tests/test_query_paradigms.py