Fork channel

Create a new channel as a copy of main.

Rename channel

Rename main to:

Delete channel

Delete main? This cannot be undone.

mode name
drwxr-xr-x data/
-rw-r--r-- README.md
-rw-r--r-- TESTING.md
-rw-r--r-- test_db_state.sh
-rw-r--r-- test_export.sh
-rw-r--r-- test_import.sh
-rw-r--r-- test_lib.sh
-rw-r--r-- test_sql.sh
-rw-r--r-- test_time.sh
README

Shell Test Scripts

Comprehensive test suite for the Skraak MCP Server.

Quick Start

cd shell_scripts

# Run all tests (recommended)
./test_time.sh && ./test_sql.sh && ./test_resources.sh && \
./test_write_tools.sh && ./test_import.sh && ./test_db_state.sh && \
./test_sql_limit.sh && ./test_export.sh && ./test_event_log.sh && \
./test_calls_from_preds.sh

# Or run individually
./test_time.sh              # Time tool (no DB needed)
./test_sql.sh               # SQL queries
./test_resources.sh         # Schema resources
./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 (to be implemented)
./test_db_state.sh          # Database integrity check
./test_sql_limit.sh         # SQL row limit enforcement
./test_export.sh            # Dataset export (fresh DB) #######
./test_event_log.sh         # Transaction event logging
./test_calls_from_preds.sh  # Prediction file import

Test Categories

Read-Only Tests (Safe, Repeatable)

These tests read from the database and don’t modify it. Run as many times as you want.

ScriptDescriptionDefault DB
test_time.shTest get_current_time toolNone
test_sql.shTest execute_sql queries, securitytest.duckdb
test_resources.shTest schema resourcestest.duckdb
test_db_state.shVerify database integritytest.duckdb

Write Tests (Fresh DB Each Run)

These tests modify the database. They automatically create a fresh copy of the production database in /tmp and clean up afterward.

ScriptDescriptionDB Handling
test_write_tools.shTest create_or_update_* toolsFresh DB in /tmp
test_import.shTest import tools validationFresh DB in /tmp
test_bulk_import.shTest bulk import CLI commandtest.duckdb

Database Safety

  • Read-only tests: Use test.duckdb (default) or specify path
  • Write tests: Automatically create fresh DB from skraak.duckdb/tmp/skraak_test_$$.duckdb
  • Never touches production: Write tests are isolated

Test Library

All scripts source test_lib.sh which provides:

  • send_request - Send MCP request and get response
  • run_test - Run test with pass/fail tracking
  • print_summary - Print test results
  • fresh_test_db - Create fresh test database
  • cleanup_test_db - Clean up test database

Running Individual Tests

# 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

Expected Output

Each test prints:

  • Test names with ✓ (pass) or ✗ (fail)
  • Summary with counts
  • Exit code 0 on success, 1 on failure
=== 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

See Also

  • TESTING.md - Comprehensive testing documentation
  • test_lib.sh - Shared test functions