1+ name : RMCP Test Suite
2+
3+ on :
4+ push :
5+ branches : [ main, develop ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+ unit-tests :
11+ name : Unit Tests
12+ runs-on : ubuntu-latest
13+ strategy :
14+ matrix :
15+ python-version : [3.8, 3.9, "3.10", "3.11"]
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - name : Set up Python ${{ matrix.python-version }}
21+ uses : actions/setup-python@v4
22+ with :
23+ python-version : ${{ matrix.python-version }}
24+
25+ - name : Set up R
26+ uses : r-lib/actions/setup-r@v2
27+ with :
28+ r-version : release
29+
30+ - name : Install R packages
31+ run : |
32+ R -e "install.packages(c('jsonlite', 'plm', 'lmtest', 'sandwich', 'AER', 'dplyr', 'forecast', 'vars', 'urca', 'tseries', 'nortest', 'car', 'rpart', 'randomForest', 'ggplot2', 'gridExtra', 'tidyr', 'rlang', 'readxl'), repos='https://cran.rstudio.com/')"
33+
34+ - name : Install Python dependencies
35+ run : |
36+ python -m pip install --upgrade pip
37+ pip install click jsonschema pytest pytest-asyncio
38+
39+ - name : Run unit tests
40+ run : |
41+ python -m pytest tests/unit/ -v
42+
43+ - name : Test new tools specifically
44+ run : |
45+ python tests/unit/test_new_tools.py
46+
47+ integration-tests :
48+ name : Integration Tests
49+ runs-on : ubuntu-latest
50+ needs : unit-tests
51+
52+ steps :
53+ - uses : actions/checkout@v4
54+
55+ - name : Set up Python 3.10
56+ uses : actions/setup-python@v4
57+ with :
58+ python-version : " 3.10"
59+
60+ - name : Set up R
61+ uses : r-lib/actions/setup-r@v2
62+ with :
63+ r-version : release
64+
65+ - name : Install R packages
66+ run : |
67+ R -e "install.packages(c('jsonlite', 'plm', 'lmtest', 'sandwich', 'AER', 'dplyr', 'forecast', 'vars', 'urca', 'tseries', 'nortest', 'car', 'rpart', 'randomForest', 'ggplot2', 'gridExtra', 'tidyr', 'rlang', 'readxl'), repos='https://cran.rstudio.com/')"
68+
69+ - name : Install Python dependencies
70+ run : |
71+ python -m pip install --upgrade pip
72+ pip install click jsonschema pytest pytest-asyncio
73+
74+ - name : Run MCP interface tests
75+ run : |
76+ python tests/integration/test_mcp_interface.py
77+
78+ - name : Run direct capabilities tests
79+ run : |
80+ python tests/integration/test_direct_capabilities.py
81+
82+ - name : Run new features integration tests
83+ run : |
84+ python tests/integration/test_new_features_integration.py
85+
86+ e2e-tests :
87+ name : End-to-End Tests
88+ runs-on : ubuntu-latest
89+ needs : integration-tests
90+
91+ steps :
92+ - uses : actions/checkout@v4
93+
94+ - name : Set up Python 3.10
95+ uses : actions/setup-python@v4
96+ with :
97+ python-version : " 3.10"
98+
99+ - name : Set up R
100+ uses : r-lib/actions/setup-r@v2
101+ with :
102+ r-version : release
103+
104+ - name : Install R packages
105+ run : |
106+ R -e "install.packages(c('jsonlite', 'plm', 'lmtest', 'sandwich', 'AER', 'dplyr', 'forecast', 'vars', 'urca', 'tseries', 'nortest', 'car', 'rpart', 'randomForest', 'ggplot2', 'gridExtra', 'tidyr', 'rlang', 'readxl'), repos='https://cran.rstudio.com/')"
107+
108+ - name : Install Python dependencies
109+ run : |
110+ python -m pip install --upgrade pip
111+ pip install click jsonschema pytest pytest-asyncio
112+
113+ - name : Run realistic scenarios
114+ run : |
115+ python tests/e2e/realistic_scenarios.py
116+
117+ - name : Run Claude Desktop scenarios
118+ run : |
119+ python tests/e2e/test_claude_desktop_scenarios.py
120+
121+ - name : Run Docker simulation tests
122+ run : |
123+ python tests/e2e/test_docker_simulation.py
124+
125+ tool-count-verification :
126+ name : Verify Tool Count
127+ runs-on : ubuntu-latest
128+ needs : unit-tests
129+
130+ steps :
131+ - uses : actions/checkout@v4
132+
133+ - name : Set up Python 3.10
134+ uses : actions/setup-python@v4
135+ with :
136+ python-version : " 3.10"
137+
138+ - name : Set up R
139+ uses : r-lib/actions/setup-r@v2
140+ with :
141+ r-version : release
142+
143+ - name : Install R packages
144+ run : |
145+ R -e "install.packages(c('jsonlite', 'plm', 'lmtest', 'sandwich', 'AER', 'dplyr'), repos='https://cran.rstudio.com/')"
146+
147+ - name : Install Python dependencies
148+ run : |
149+ python -m pip install --upgrade pip
150+ pip install click jsonschema
151+
152+ - name : Verify tool registration count
153+ run : |
154+ python -c "
155+ import sys
156+ sys.path.insert(0, '.')
157+ from rmcp.core.server import create_server
158+ from rmcp.cli import _register_builtin_tools
159+ server = create_server()
160+ _register_builtin_tools(server)
161+ import asyncio
162+ async def count():
163+ ctx = server.create_context('test', 'tools/list')
164+ result = await server.tools.list_tools(ctx)
165+ count = len(result['tools'])
166+ print(f'Registered tools: {count}')
167+ assert count >= 39, f'Expected at least 39 tools, got {count}'
168+ print('✅ Tool count verification passed')
169+ asyncio.run(count())
170+ "
171+
172+ # New feature verification
173+ new-features-smoke-test :
174+ name : New Features Smoke Test
175+ runs-on : ubuntu-latest
176+ needs : unit-tests
177+
178+ steps :
179+ - uses : actions/checkout@v4
180+
181+ - name : Set up Python 3.10
182+ uses : actions/setup-python@v4
183+ with :
184+ python-version : " 3.10"
185+
186+ - name : Set up R
187+ uses : r-lib/actions/setup-r@v2
188+ with :
189+ r-version : release
190+
191+ - name : Install R packages
192+ run : |
193+ R -e "install.packages(c('jsonlite', 'dplyr'), repos='https://cran.rstudio.com/')"
194+
195+ - name : Install Python dependencies
196+ run : |
197+ python -m pip install --upgrade pip
198+ pip install click jsonschema
199+
200+ - name : Test formula builder
201+ run : |
202+ python -c "
203+ import sys, asyncio, json
204+ sys.path.insert(0, '.')
205+ from rmcp.core.server import create_server
206+ from rmcp.registries.tools import register_tool_functions
207+ from rmcp.tools.formula_builder import build_formula
208+ from rmcp.tools.helpers import suggest_fix, load_example
209+
210+ async def test():
211+ server = create_server()
212+ register_tool_functions(server.tools, build_formula, suggest_fix, load_example)
213+
214+ # Test formula building
215+ req = {'jsonrpc': '2.0', 'id': 1, 'method': 'tools/call', 'params': {'name': 'build_formula', 'arguments': {'description': 'predict sales from marketing'}}}
216+ resp = await server.handle_request(req)
217+ result = json.loads(resp['result']['content'][0]['text'])
218+ assert 'formula' in result
219+ print(f'✅ Formula builder: {result[\"formula\"]}')
220+
221+ # Test error recovery
222+ req = {'jsonrpc': '2.0', 'id': 2, 'method': 'tools/call', 'params': {'name': 'suggest_fix', 'arguments': {'error_message': 'there is no package called \"forecast\"'}}}
223+ resp = await server.handle_request(req)
224+ result = json.loads(resp['result']['content'][0]['text'])
225+ assert result['error_type'] == 'missing_package'
226+ print(f'✅ Error recovery: {result[\"error_type\"]}')
227+
228+ # Test example datasets
229+ req = {'jsonrpc': '2.0', 'id': 3, 'method': 'tools/call', 'params': {'name': 'load_example', 'arguments': {'dataset_name': 'sales', 'size': 'small'}}}
230+ resp = await server.handle_request(req)
231+ result = json.loads(resp['result']['content'][0]['text'])
232+ assert 'data' in result
233+ print(f'✅ Example datasets: {result[\"metadata\"][\"rows\"]} rows loaded')
234+
235+ print('🎊 All new features working!')
236+
237+ asyncio.run(test())
238+ "
239+
240+ documentation-check :
241+ name : Documentation Check
242+ runs-on : ubuntu-latest
243+
244+ steps :
245+ - uses : actions/checkout@v4
246+
247+ - name : Check README mentions new features
248+ run : |
249+ grep -q "39 statistical tools" README.md || (echo "❌ README doesn't mention 39 tools" && exit 1)
250+ grep -q "Natural Language" README.md || (echo "❌ README doesn't mention natural language features" && exit 1)
251+ grep -q "Error Recovery" README.md || (echo "❌ README doesn't mention error recovery" && exit 1)
252+ echo "✅ Documentation check passed"
253+
254+ - name : Check version consistency
255+ run : |
256+ grep -q "Version 0.3.5" README.md || (echo "❌ README version not updated" && exit 1)
257+ grep -q "version.*0.3.5" pyproject.toml || (echo "❌ pyproject.toml version not updated" && exit 1)
258+ echo "✅ Version consistency check passed"
0 commit comments