@@ -27,26 +27,91 @@ wobble/
2727
2828### Test Discovery Engine (` discovery.py ` )
2929
30- ** Responsibility** : Locate and categorize tests across different repository structures.
30+ ** Responsibility** : Locate and categorize tests across different repository structures with enhanced logging and file output capabilities .
3131
3232** Key Classes** :
33- - ` TestDiscoveryEngine ` : Main discovery coordinator
33+ - ` TestDiscoveryEngine ` : Main discovery coordinator with progressive verbosity support
3434- Supports hierarchical (` tests/regression/ ` ) and flat (decorator-based) structures
3535- Provides filtering capabilities by category, performance, and environment
36+ - Implements structured data output for JSON serialization and file integration
3637
3738** Design Patterns** :
3839- ** Strategy Pattern** : Different discovery strategies for hierarchical vs. flat structures
3940- ** Factory Pattern** : Test suite creation from discovered test information
4041- ** Filter Pattern** : Composable test filtering by multiple criteria
42+ - ** Observer Pattern** : Integration with file output system for dual console/file logging
43+
44+ ** Enhanced Discovery Features** :
45+ - ** Progressive Verbosity** : Three levels of detail with distinct JSON structures:
46+ - Level 1: Basic counts only (` categories ` field)
47+ - Level 2: Level 1 + ` uncategorized ` field with test details
48+ - Level 3: Level 1 + ` tests_by_category ` field with complete test listings
49+ - ** File Path Detection** : Automatic detection and formatting of test file locations
50+ - ** JSON Serialization** : Structured data output compatible with programmatic analysis
51+ - ** Decorator Information** : Complete decorator metadata in detailed discovery output
4152
4253** Key Methods** :
4354``` python
4455def discover_tests (pattern : str ) -> Dict[str , List]
4556def filter_tests(categories: List[str ], exclude_slow: bool , exclude_ci: bool ) -> List[Dict]
57+ def get_discovery_summary(verbosity: int = 1 ) -> str
58+ def get_discovery_data(verbosity: int = 1 ) -> Dict[str , Any]
59+ def get_test_summary() -> str
4660def supports_hierarchical_structure() -> bool
4761def supports_decorator_structure() -> bool
4862```
4963
64+ ** Discovery Data Structure** :
65+ ```python
66+ {
67+ " discovery_summary" : {
68+ " timestamp" : " 2025-09-15T10:30:00.123456" ,
69+ " total_tests" : 42 ,
70+ " categories" : {
71+ " regression" : 15 ,
72+ " integration" : 12 ,
73+ " development" : 8 ,
74+ " uncategorized" : 7
75+ },
76+ # Verbosity level 2: uncategorized test details
77+ " uncategorized" : [ # Only present at verbosity level 2
78+ {
79+ " name" : " test_example" ,
80+ " class" : " TestExample" ,
81+ " module" : " test_example" ,
82+ " file" : " tests/test_example.py" ,
83+ " full_name" : " test_example.TestExample.test_example" ,
84+ " decorators" : [" @slow_test" ]
85+ }
86+ ],
87+
88+ # Verbosity level 3: complete test listings by category
89+ " tests_by_category" : { # Only present at verbosity level 3
90+ " regression" : [
91+ {
92+ " name" : " TestRegression.test_feature" ,
93+ " class" : " TestRegression" ,
94+ " module" : " test_regression" ,
95+ " file" : " tests/test_regression.py" ,
96+ " full_name" : " test_regression.TestRegression.test_feature" ,
97+ " decorators" : [" @regression_test" ]
98+ }
99+ ],
100+ " uncategorized" : [
101+ {
102+ " name" : " test_example" ,
103+ " class" : " TestExample" ,
104+ " module" : " test_example" ,
105+ " file" : " tests/test_example.py" ,
106+ " full_name" : " test_example.TestExample.test_example" ,
107+ " decorators" : [" @slow_test" ]
108+ }
109+ ]
110+ }
111+ }
112+ }
113+ ```
114+
50115### Decorator System (` decorators.py ` )
51116
52117** Responsibility** : Provide test categorization and metadata attachment.
@@ -149,6 +214,14 @@ def supports_decorator_structure() -> bool
149214- Multiple output destinations (console + file simultaneously)
150215- Format-specific strategies with auto-detection
151216- Graceful error handling and resource cleanup
217+ - Discovery mode integration with independent verbosity control
218+
219+ ** Discovery Integration** :
220+ - Discovery results support both console and file output simultaneously
221+ - Independent verbosity control: ` --discover-verbosity ` for console, ` --log-verbosity ` for file
222+ - JSON format support for structured discovery data with complete test metadata
223+ - File path detection and serialization for programmatic analysis
224+ - Event-driven architecture enables discovery output through observer pattern
152225
153226** Threading Architecture** :
154227``` python
0 commit comments