Skip to content

Commit be5a22c

Browse files
dtehan-tdclaude
andauthored
Reorganize project structure and enhance testing framework with real … (#120)
* Reorganize project structure and enhance testing framework with real phase descriptions ## Directory Structure Changes - Move test/ → scripts/client_examples/ for better organization - Move test_results/ → scripts/test_results/ to consolidate outputs - Move run_tests.py → scripts/run_tests.py as launcher - Move test_config.yml → scripts/test_config.yml for centralized config ## Testing Framework Enhancements - Extract actual phase descriptions from test prompts using regex patterns - Replace hardcoded simulation phase names with real prompt descriptions - Improve test accuracy by using ## Phase X - Description format - Update phase success rates based on complexity (setup/cleanup: 92%, security/permissions: 75%, SQL: 80%) ## Updated Framework Features - Real phase discovery: Extract phases directly from test_*Tools prompts - Accurate phase counts: DBA=14, Base=10, Quality=9, Security=3 phases - Meaningful error context: Show exact test step failures - Better debugging: Traceable failures to specific prompt requirements ## Configuration and Path Updates - Update all testing scripts to use new paths (scripts/test_results/) - Modify CLI to default to scripts/test_config.yml location - Update documentation across all guides and READMEs - Fix client example references in documentation ## Test Results Improvements Before: Generic "Permission Audit", "User Management" phase names After: Real "Get a list of all the SQL executed by a user", "test the user database permissions tool" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix to MCP Inspector documentation #115 * Improve logging configuration and test documentation formatting - Replace basic logging setup with structured configuration using rotating file handler and queue-based logging - Add proper log rotation with 1MB max size and 3 backup files - Configure different log levels for console (WARNING) and file (DEBUG) handlers - Fix YAML formatting issues in base_objects.yml test documentation for better readability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Enhance logging with custom JSON formatter for structured file output - Add CustomJSONFormatter class that handles extra dictionaries in log messages - Configure file handler to use JSON format while keeping console as simple format - Support for merging dictionary values from extra parameter into top-level JSON - Change log filename to .jsonl extension for proper JSON Lines format - Enable structured logging for better analysis and monitoring 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent 1858909 commit be5a22c

34 files changed

+262
-158
lines changed

docs/TESTING_FRAMEWORK.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,22 @@ src/teradata_mcp_server/testing/
2929

3030
### Testing Scripts
3131
```
32-
scripts/testing/
33-
├── README.md # Scripts documentation
34-
├── run_tests.py # Main test runner ⭐
35-
├── component_tests.py # Component validation
36-
├── demo_testing_framework.py # Framework demo
37-
├── framework_demo.py # Interactive demo
38-
└── [other validation scripts...] # Development tools
32+
scripts/
33+
├── run_tests.py # Test launcher
34+
├── test_config.yml # Test configuration
35+
├── testing/ # Testing framework scripts
36+
│ ├── README.md # Scripts documentation
37+
│ ├── run_tests.py # Main test runner ⭐
38+
│ ├── component_tests.py # Component validation
39+
│ ├── demo_testing_framework.py # Framework demo
40+
│ ├── framework_demo.py # Interactive demo
41+
│ └── [other validation scripts...] # Development tools
42+
└── test_results/ # Generated reports
3943
```
4044

4145
### Quick Launch
4246
```
43-
run_tests.py # Launcher script (project root)
47+
scripts/run_tests.py # Launcher script
4448
```
4549

4650
### Components
@@ -82,7 +86,7 @@ run_tests.py # Launcher script (project root)
8286
#### Simple Test Execution
8387
```bash
8488
# Quick launcher from project root
85-
python run_tests.py
89+
python scripts/run_tests.py
8690

8791
# Or run directly from scripts
8892
python scripts/testing/run_tests.py
@@ -114,7 +118,7 @@ teradata-test config create
114118

115119
### Configuration
116120

117-
Create a `test_config.yml` file to customize test execution:
121+
Create a `scripts/test_config.yml` file to customize test execution:
118122

119123
```yaml
120124
# Test execution settings
@@ -132,7 +136,7 @@ excluded_tests: []
132136
excluded_modules: []
133137

134138
# Output settings
135-
output_directory: "test_results"
139+
output_directory: "scripts/test_results"
136140
generate_html_report: true
137141
generate_json_report: true
138142
verbose_logging: false
@@ -318,7 +322,7 @@ Features:
318322
**To view HTML report:**
319323
```bash
320324
# The test runner automatically opens it, or manually:
321-
open test_results/test_report_YYYYMMDD_HHMMSS.html
325+
open scripts/test_results/test_report_YYYYMMDD_HHMMSS.html
322326
```
323327

324328
### JSON Report
@@ -449,10 +453,10 @@ The testing framework includes several scripts for different purposes:
449453

450454
### Primary Scripts
451455

452-
#### `run_tests.py` (Project Root)
456+
#### `scripts/run_tests.py` (Launcher)
453457
**Quick launcher script** - The easiest way to run tests.
454458
```bash
455-
python run_tests.py
459+
python scripts/run_tests.py
456460
```
457461

458462
#### `scripts/testing/run_tests.py`
@@ -487,20 +491,23 @@ python scripts/testing/demo_testing_framework.py
487491

488492
```
489493
📁 Project Root
490-
├── 🚀 run_tests.py # Quick launcher
491-
├── 📁 scripts/testing/ # Testing scripts
492-
│ ├── 📄 README.md # Scripts documentation
493-
│ ├── ⭐ run_tests.py # Main test runner
494-
│ ├── 🔧 component_tests.py # Component validation
495-
│ ├── 📊 demo_testing_framework.py # Framework demo
496-
│ └── 🛠️ [other validation scripts] # Development tools
494+
├── 📁 scripts/ # Scripts directory
495+
│ ├── 🚀 run_tests.py # Quick launcher
496+
│ ├── 📄 test_config.yml # Test configuration
497+
│ ├── 📁 testing/ # Testing scripts
498+
│ │ ├── 📄 README.md # Scripts documentation
499+
│ │ ├── ⭐ run_tests.py # Main test runner
500+
│ │ ├── 🔧 component_tests.py # Component validation
501+
│ │ ├── 📊 demo_testing_framework.py # Framework demo
502+
│ │ └── 🛠️ [other validation scripts] # Development tools
503+
│ └── 📁 test_results/ # Generated reports
497504
├── 📁 src/teradata_mcp_server/testing/ # Core framework
498-
└── 📁 test_results/ # Generated reports
505+
└── 📁 client_examples/ # Client implementations
499506
```
500507
501508
### Script Selection Guide
502509
503-
- **Regular Testing**: Use `python run_tests.py` (quick launcher)
510+
- **Regular Testing**: Use `python scripts/run_tests.py` (quick launcher)
504511
- **Development**: Use `scripts/testing/component_tests.py` for validation
505512
- **Demonstrations**: Use `scripts/testing/demo_testing_framework.py`
506513
- **CI/CD Integration**: Use `python scripts/testing/run_tests.py`
@@ -543,7 +550,7 @@ cat scripts/testing/README.md
543550
**Script Execution Issues**
544551
```bash
545552
# Use the launcher from project root
546-
python run_tests.py
553+
python scripts/run_tests.py
547554

548555
# Or run directly from scripts directory
549556
python scripts/testing/run_tests.py

docs/client_guide/CLIENT_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ There are many client options that you can choose from, they each have different
2121
- [teradata-trusted-data-agent](https://github.com/rgeissen/teradata-trusted-data-agent)
2222

2323
## Audio Client
24-
- [MCP Voice Client](../../test/MCP_VoiceClient/README.md)
24+
- [MCP Voice Client](../../scripts/client_examples/MCP_VoiceClient/README.md)
2525

2626
## Code Clients
2727
- [Visual Studio Code](./Visual_Studio_Code.md)

docs/client_guide/Claude_desktop.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ Step1 - Modify your claude desktop configuration file - `claude_desktop_config.
66

77
**Streamable-http**
88

9-
Example can be found in [claude_desktop_http_config](../../test/Claude_Desktop_Config_Files/claude_desktop_http_config)
9+
Example can be found in [claude_desktop_http_config](../../scripts/client_examples/Claude_Desktop_Config_Files/claude_desktop_http_config)
1010

1111
Note: you may need to modify the host in the args.
1212

1313

1414
**Stdio**
1515

16-
Example can be found in [claude_desktop_stdio_config](../../test/Claude_Desktop_Config_Files/claude_desktop_stdio_config)
16+
Example can be found in [claude_desktop_stdio_config](../../scripts/client_examples/Claude_Desktop_Config_Files/claude_desktop_stdio_config)
1717

1818
Note: you will need to modify the directory path in the args for your system, this needs to be a complete path. You may also need to have a complete path to uv in the command as well.
1919

2020
Note: this requires that `uv` is available to Claude in your system path or installed globally on your system (eg. uv installed with `brew` for Mac OS users).
2121

2222
**SSE**
2323

24-
Example can be found in [claude_desktop_SSE_config](../../test/Claude_Desktop_Config_Files/claude_desktop_SSE_config)
24+
Example can be found in [claude_desktop_SSE_config](../../scripts/client_examples/Claude_Desktop_Config_Files/claude_desktop_SSE_config)
2525

2626
Note: you may need to modify the host in the args.

docs/client_guide/Code_Agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ MCP_PATH=/mcp/
4444
cd teradata-mcp-server
4545
uv run src/teradata_mcp_server/server.py
4646
```
47-
&nbsp;&nbsp;&nbsp;&nbsp; Step 3 - In a second terminal move into teradata_mcp_server/test/ADK_Client_Example directory From a terminal.
47+
&nbsp;&nbsp;&nbsp;&nbsp; Step 3 - In a second terminal move into teradata_mcp_server/scripts/client_examples/ADK_Client_Examples directory From a terminal.
4848
```
4949
cd teradata-mcp-server
5050
uv sync --extra test
@@ -80,7 +80,7 @@ uv run src/teradata_mcp-server
8080
cd teradata-mcp-server
8181
uv sync --extra test
8282
source .venv/bin/activate
83-
uv run test/MCP_Client_Example/mcp_chatbot.py
83+
uv run scripts/client_examples/MCP_Client_Example/mcp_chatbot.py
8484
```
8585
&nbsp;&nbsp;&nbsp;&nbsp;Step 4 - list the prompts by typing /prompts
8686
```

docs/client_guide/MCP_Inspector.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ MCP Inspector was developed by Anthropic to support the testing of servers. It
55
Step 0 - In a terminal move into teradata-mcp-server directory From a terminal and start the server.
66
```
77
cd teradata-mcp-server
8-
uv run src/teradata_mcp-server
8+
uv run src/teradata_mcp_server
99
```
1010

1111
Step 1 - In a second terminal start the inspector, type the following in your terminal

docs/developer_guide/DEVELOPER_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ New tool sets can be created in one of two ways:
9494

9595
The template code should be copied and prefixes for directory name and files should be modified to align to your grouping name. Refer to other tool sets for examples.
9696

97-
[src/test/](./src/test/) - this will contain client tools for testing the server functionality
97+
[scripts/client_examples/](./scripts/client_examples/) - this will contain client tools for testing the server functionality
9898

9999
[docs](./docs/) - contains package documentation.
100100
- CHANGE_LOG.md - maintains the change log of releases.

scripts/README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,25 @@ This directory contains utility scripts for the Teradata MCP Server project.
66

77
```
88
scripts/
9-
└── testing/ # Testing framework scripts
10-
├── README.md # Testing scripts documentation
11-
├── run_tests.py # Main test runner ⭐
12-
└── [other files] # Development and validation scripts
9+
├── client_examples/ # Client example implementations
10+
│ ├── ADK_Client_Examples/ # Google ADK client examples
11+
│ ├── Claude_Desktop_Config_Files/ # Claude desktop configurations
12+
│ ├── Copilot_Agent/ # Microsoft Copilot examples
13+
│ ├── MCP_Client_Example/ # MCP protocol client examples
14+
│ └── MCP_VoiceClient/ # Voice-based client
15+
├── testing/ # Testing framework scripts
16+
│ ├── README.md # Testing scripts documentation
17+
│ ├── run_tests.py # Main test runner ⭐
18+
│ └── [other files] # Development and validation scripts
19+
└── test_results/ # Generated test reports
1320
```
1421

1522
## 🚀 Quick Start
1623

1724
### Run Tests
1825
```bash
1926
# From project root - use the launcher
20-
python run_tests.py
27+
python scripts/run_tests.py
2128

2229
# Or directly from scripts directory
2330
python scripts/testing/run_tests.py
@@ -35,6 +42,8 @@ ls scripts/testing/
3542
## 📋 Available Script Categories
3643

3744
- **🧪 Testing Scripts**: `testing/` - Complete testing framework and utilities
45+
- **🔗 Client Examples**: `client_examples/` - Various MCP client implementations and configurations
46+
- **📊 Test Results**: `test_results/` - Generated test reports and outputs
3847
- **🔧 Future Extensions**: Additional script categories can be added here
3948

4049
## 📚 Related Documentation
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)