Repository navigation
Description
Summary
The repo has no automated tests: no test directory, no test_*.py, and no pytest configuration. Every MCP tool module has zero coverage, including the only tool that writes to disk and the four tools that act on a live server. Add a pytest suite under mcp-server/tests/ and run it in CI.
Where
mcp-server/tools/(all modules:scaffold.py,manifest_gen.py,manifest_common.py,natives.py,detect_framework.py,event_search.py,docs_search.py,txadmin.py,txadmin_client.py).github/workflows/validate.yml:234-260(validate-python)
Details
Several bugs found in this audit would have been caught by basic tests. The bug issues carry the specific test cases for each module; this issue is the umbrella for the harness and the modules not covered there:
- "scaffold_resource_tool overwrites existing files and writes relative to the CWD" (scaffold tests)
- "generate_manifest emits Lua tables without commas, mishandles scanned scripts" (manifest tests)
- "detect_framework reports ox_lib users as ox_core and breaks ties by dict order" (detection tests)
- "txAdmin tools report unexpected or error responses as success" (txAdmin tests with a fake HTTP panel)
- "lookup_native returns nothing for canonical SCREAMING_SNAKE native names" (natives tests)
Modules with no bug issue of their own: event_search.py, docs_search.py, and manifest_common.py helpers.
Impact
Any change to the tools can regress unnoticed, and fixes for the bugs above cannot be pinned. The txAdmin tools cannot be exercised without a real panel.
Suggested fix
- Add
mcp-server/requirements-dev.txtwithpytest, andmcp-server/tests/conftest.pythat putsmcp-serveronsys.path. - Use
tmp_pathandmonkeypatch.chdirfor file-writing tools, small fixture JSON files for the data tools, and a localhttp.server.ThreadingHTTPServeron127.0.0.1:0as a fake txAdmin panel (no real network). - Test files:
test_scaffold.py,test_manifest_gen.py,test_manifest_common.py,test_detect_framework.py,test_natives.py,test_txadmin.py,test_search.py(events and docs),test_server.py(importserver, assertlist_tools()returns the 10 documented names). - Cases for
test_search.py: empty query returns the summary for each tool;search_events(side="server")includessharedevents;search_events(game="rdr3")excludes gta5-only events; invalid docs section returns the error; missing and malformed data files return an error rather than raising. - Cases for
manifest_common.py:read_workspace_contextskipsnode_modules/.gitand returns the first author found;validate_inputsaccepts every framework inVALID_FRAMEWORKS. - Add a
pyteststep to thevalidate-pythonjob.
Acceptance criteria
-
cd mcp-server && pytestruns and passes locally with no network access. - Every tool module has at least one test file.
- CI runs the suite on every PR and push to main.
- Contributor docs explain how to run the tests.
Getting started
- Relevant files:
mcp-server/tools/,mcp-server/server.py,.github/workflows/validate.yml - How to run checks: there is no test suite yet; run the MCP server with
cd mcp-server && pip install -r requirements.txt && python server.py, and CI checks live in.github/workflows/validate.yml - Related docs:
CONTRIBUTING.md,CLAUDE.md(MCP server development)
Filed by repo-audit/full-audit at 701824d. Severity: medium. Effort: M. audit-key: testing|mcp-server/tools|pytest-suite
Activity
TMHSDigital commentedon Nov 21, 2026
Fixed in 19d907a.
Added mcp-server/tests/ (one file per tool module plus a server registration test), a fake txAdmin panel, fixture data, requirements-dev.txt, a pytest step in CI, and a CONTRIBUTING section on running the tests. Data tools now return an error for malformed data files.
Verified: 104 tests pass locally with no network access.