Skip to content

Commit c4a6a8e

Browse files
committed
Tests: Add software tests for examples/mcptools.sh
1 parent e59b991 commit c4a6a8e

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ jobs:
6868
enable-cache: true
6969
version: "latest"
7070

71+
- name: Set up mcptools
72+
run: |
73+
go install github.com/f/mcptools/cmd/mcptools@latest
74+
7175
- name: Set up project
7276
run: |
7377
uv pip install --editable='.[all,develop,test]'

examples/mcptools.sh

100644100755
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/usr/bin/env sh
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
24

35
# CrateDB MCP Server example with `mcptools`
46
#
@@ -22,3 +24,5 @@ mcpt call get_cratedb_documentation_index uvx cratedb-mcp serve
2224
mcpt call \
2325
fetch_cratedb_docs --params '{"link":"https://cratedb.com/docs/cloud/en/latest/_sources/cluster/integrations/mongo-cdc.md.txt"}' \
2426
uvx cratedb-mcp serve
27+
28+
echo "Ready."

tests/test_examples.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ruff: noqa: S603, S607
2+
import subprocess
3+
from shutil import which
4+
5+
import pytest
6+
7+
8+
@pytest.mark.skipif(not which("mcpt"), reason="requires mcptools")
9+
def test_mcptools():
10+
proc = subprocess.run(["examples/mcptools.sh"], capture_output=True, timeout=15, check=True)
11+
assert proc.returncode == 0
12+
assert b"Ready." in proc.stdout

0 commit comments

Comments
 (0)