Comprehensive test suite for the Skraak MCP Server.
cd shell_scripts
# Run all tests (recommended)
./test_time.sh && ./test_sql.sh && ./test_resources.sh && ./test_prompts.sh && \
./test_write_tools.sh && ./test_import.sh && ./test_bulk_import.sh && ./test_db_state.sh && ./test_sql_limit.sh && ./test_export.sh && ./test_event_log.sh
# Or run individually
./test_time.sh # Time tool (no DB needed)
./test_sql.sh # SQL queries
./test_resources.sh # Schema resources
./test_prompts.sh # All 6 prompts
./test_write_tools.sh # Create/update tools (fresh DB)
./test_import.sh # Import tools validation (fresh DB)
./test_bulk_import.sh # Bulk import CLI validation
./test_db_state.sh # Database integrity check
These tests read from the database and don't modify it. Run as many times as you want.
| Script | Description | Default DB |
|--------|-------------|------------|
| test_time.sh | Test get_current_time tool | None |
| test_sql.sh | Test execute_sql queries, security | test.duckdb |
| test_resources.sh | Test schema resources | test.duckdb |
| test_prompts.sh | Test all 6 MCP prompts | test.duckdb |
| test_db_state.sh | Verify database integrity | test.duckdb |
These tests modify the database. They automatically create a fresh copy of the production database in /tmp and clean up afterward.
| Script | Description | DB Handling |
|--------|-------------|-------------|
| test_write_tools.sh | Test create_or_update_* tools | Fresh DB in /tmp |
| test_import.sh | Test import tools validation | Fresh DB in /tmp |
| test_bulk_import.sh | Test bulk import CLI command | test.duckdb |
test.duckdb (default) or specify pathskraak.duckdb → /tmp/skraak_test_$$.duckdbAll scripts source test_lib.sh which provides:
send_request - Send MCP request and get responserun_test - Run test with pass/fail trackingprint_summary - Print test resultsfresh_test_db - Create fresh test databasecleanup_test_db - Clean up test database# With default test database
./test_sql.sh
# With specific database
./test_sql.sh /path/to/database.duckdb
# Write tests always use fresh DB (no argument needed)
./test_write_tools.sh
Each test prints:
=== Testing execute_sql Tool ===
✓ Simple SELECT
✓ SELECT with limit
✓ Parameterized query
✓ JOIN query
✓ Aggregate query
✓ CTE query
✓ INSERT blocked (correctly rejected)
✓ SQL injection blocked (correctly rejected)
✓ DELETE blocked (correctly rejected)
=== Summary ===
Tests run: 9
Passed: 9
Failed: 0
TESTING.md - Comprehensive testing documentationtest_lib.sh - Shared test functions