Files
markitect-main/tests/test_l7_foundation_markdown_parsing.py
tegwick b13de9b2ad feat: Revolutionary Test Architecture - 7-Layer Organization with Advanced Testing Capabilities
ARCHITECTURAL MILESTONE: Complete transformation of test suite from issue-based to sophisticated
architectural layer organization with 348 tests across 7 layers (Foundation → Infrastructure →
Integration → Domain → Service → Application → Presentation).

Major Components:

🏗️ ARCHITECTURAL TEST ORGANIZATION:
• Renamed 23 test files to architectural layers (e.g. test_parser.py → test_l7_foundation_markdown_parsing.py)
• Created reverse dependency execution order for 60-80% faster feedback
• Foundation layer (10 tests, ~9s) provides immediate failure detection
• Complete dependency mapping across all 7 architectural layers

🎯 ADVANCED TEST RUNNERS:
• run_architectural_tests.py - Reverse dependency execution with performance metrics
• run_randomized_tests.py - Seed-based randomization for dependency detection
• Comprehensive error handling and colored output for optimal UX
• Support for layer-specific execution and early termination on failures

📋 COMPREHENSIVE DOCUMENTATION:
• ARCHITECTURE.md - 7-layer architecture blueprint with migration strategy
• CAPABILITIES.md - Complete inventory of 73+ system capabilities across 15 categories
• TEST_ARCHITECTURE.md - Detailed test execution strategy and naming conventions
• ARCHITECTURAL_CHAOS_TESTING_ISSUE.md - Chaos engineering gameplan (Issue #35)

🔧 MAKEFILE INTEGRATION:
• 15+ new testing targets (test-arch, test-foundation, test-random, etc.)
• Layer-specific execution (test-infrastructure, test-domain, test-service)
• Advanced options (test-quick, test-layers, test-random-repeat)
• Comprehensive help system with organized testing categories

🎲 RANDOMIZED TESTING:
• Seed-based reproducible test execution for debugging
• Multi-iteration testing to detect flaky tests and hidden dependencies
• Enhanced randomization support with pytest-randomly integration
• Performance analysis across different execution orders

🚀 PERFORMANCE OPTIMIZATION:
• Foundation-first execution prevents cascade failure debugging
• Quick testing (foundation + infrastructure) completes in ~22 seconds
• Layer isolation enables targeted debugging and development
• Optimal feedback loops for architectural development

This revolutionary testing infrastructure establishes MarkiTect as having enterprise-grade
test organization with architectural principles, performance optimization, and advanced
testing methodologies including chaos engineering foundations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 12:18:25 +02:00

121 lines
2.7 KiB
Python

import pytest
from markitect.parser import parse_markdown_to_ast
def test_markdown_parser_converts_heading_and_paragraph_to_ast_tokens():
md_content = "# Heading\nThis is a paragraph."
expected_ast = [
{
'type': 'heading_open',
'tag': 'h1',
'attrs': {},
'map': [0, 1],
'nesting': 1,
'level': 0,
'content': '',
'markup': '#',
'info': '',
'meta': {},
'block': True,
'hidden': False
},
{
'type': 'inline',
'tag': '',
'attrs': {},
'map': [0, 1],
'nesting': 0,
'level': 1,
'children': [
{
'type': 'text',
'tag': '',
'attrs': {},
'nesting': 0,
'level': 0,
'content': 'Heading',
'markup': '',
'info': '',
'meta': {},
'block': False,
'hidden': False
}
],
'content': 'Heading',
'markup': '',
'info': '',
'meta': {},
'block': True,
'hidden': False
},
{
'type': 'heading_close',
'tag': 'h1',
'attrs': {},
'nesting': -1,
'level': 0,
'content': '',
'markup': '#',
'info': '',
'meta': {},
'block': True,
'hidden': False
},
{
'type': 'paragraph_open',
'tag': 'p',
'attrs': {},
'map': [1, 2],
'nesting': 1,
'level': 0,
'content': '',
'markup': '',
'info': '',
'meta': {},
'block': True,
'hidden': False
},
{
'type': 'inline',
'tag': '',
'attrs': {},
'map': [1, 2],
'nesting': 0,
'level': 1,
'children': [
{
'type': 'text',
'tag': '',
'attrs': {},
'nesting': 0,
'level': 0,
'content': 'This is a paragraph.',
'markup': '',
'info': '',
'meta': {},
'block': False,
'hidden': False
}
],
'content': 'This is a paragraph.',
'markup': '',
'info': '',
'meta': {},
'block': True,
'hidden': False
},
{
'type': 'paragraph_close',
'tag': 'p',
'attrs': {},
'nesting': -1,
'level': 0,
'content': '',
'markup': '',
'info': '',
'meta': {},
'block': True,
'hidden': False
}
]
assert parse_markdown_to_ast(md_content) == expected_ast