Skip to content

fix: isolate integration test imports and mocks - #175

Merged
TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
laozhej:fix/174-integration-test-isolation
Nov 25, 2026
Merged

TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
laozhej:fix/174-integration-test-isolation

Conversation

@laozhej

@laozhej laozhej commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

What changed

Load the integration suite's tool modules and real command guard during test collection, then reset mock implementations and queued one-shot results before every test. This keeps cold module loading outside individual test timeouts and prevents leftover SSH results from affecting the next test.

Why

Fixes #174. The existing clearAllMocks() clears call history but leaves queued results and overridden implementations in place.

Type

  • New MCP tool
  • New skill
  • New rule
  • Bug fix
  • Documentation
  • Other

Testing

  • cd mcp-server && npm run build && npm test passes: 549 passed, 10 live-Pi tests skipped
  • cd mcp-server && npm run typecheck passes
  • pytest tests/ -v --tb=short passes: 273 passed
  • Tested against a live Pi (not applicable; test-only change)

A temporary queued-result probe made the existing health-check assertion fail on the original suite and pass after this change; the probe was removed after verification. All 23 integration tests also pass with shuffled seeds 174, 20261119, and 42. Tested on macOS with Node 22.23.0; the reported Windows timing failure was not reproduced locally.

Checklist

  • No secrets or credentials committed
  • CHANGELOG.md updated
  • README.md updated (not applicable; no new tools/skills/rules)
  • CLAUDE.md updated (not applicable; no new tools/skills/rules)

Prepared with OpenAI Codex assistance. The commit includes the required DCO sign-off.

@laozhej
laozhej requested a review from TMHSDigital as a code owner November 19, 2026 16:00
@github-actions github-actions Bot added documentation Improvements or additions to documentation mcp labels Nov 19, 2026
@TMHSDigital
TMHSDigital merged commit 6faad61 into TMHSDigital:main Nov 25, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation mcp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration tests import tool modules inside tests and can time out under load

2 participants