Skip to content

Overhaul test suite: MCP tool-level integration tests#2

Merged
oleksandr-nc merged 1 commit intomainfrom
feature/p1-test-suite-overhaul
Mar 22, 2026
Merged

Overhaul test suite: MCP tool-level integration tests#2
oleksandr-nc merged 1 commit intomainfrom
feature/p1-test-suite-overhaul

Conversation

@bigcat88
Copy link
Contributor

Summary

  • All integration tests now call MCP tools by name through the full tool stack (permission checks, argument parsing, JSON serialization), not just raw HTTP client calls
  • Added McpTestHelper fixture for easy tool invocation in tests
  • Added test_server.py — tool registration, descriptions, server configuration
  • Added test_permissions.py — READ/WRITE/DESTRUCTIVE enforcement end-to-end against live Nextcloud
  • Added test_errors.pyNextcloudError message quality at both client and MCP tool level
  • Split monolithic file lifecycle test into focused per-operation tests (list, get, upload, create, delete, move)
  • Per-test cleanup fixture ensures test isolation (no leaked files/notifications between tests)
  • Edge case coverage: empty files, UTF-8 content, binary files, large files, duplicate creates, nonexistent resources

Test counts: 109 total (26 unit + 83 integration), all against real Nextcloud

Test plan

  • All 109 tests pass on NC master (ran twice)
  • All 83 integration tests pass on NC stable33
  • ruff check, ruff format --check, isort --check — clean
  • pyright strict — 0 errors
  • CI should pass on NC 31 + NC 32

- Add McpTestHelper that calls MCP tools by name through the full tool stack
- All integration tests now exercise tools via MCP, not raw client calls
- Add test_server.py: tool registration, descriptions, server configuration
- Add test_permissions.py: READ/WRITE/DESTRUCTIVE enforcement end-to-end
- Add test_errors.py: NextcloudError messages at client and MCP tool level
- Split monolithic file lifecycle test into focused per-operation tests
- Add per-test cleanup fixture to ensure test isolation
- Add tests for edge cases: empty files, UTF-8, binary, large files, duplicates
- 109 total tests (26 unit + 83 integration), all against real Nextcloud
@bigcat88 bigcat88 marked this pull request as ready for review March 21, 2026 08:33
@bigcat88
Copy link
Contributor Author

Ready for review.

Summary: Complete test suite overhaul — 109 tests (26 unit + 83 integration), all against real Nextcloud.

Key changes:

  • Tests now call MCP tools through the full stack (not raw HTTP client)
  • Permission enforcement tested end-to-end at READ/WRITE/DESTRUCTIVE levels
  • Error message quality tested at both client and MCP layers
  • Per-test cleanup ensures isolation
  • Edge cases: empty files, UTF-8, binary, large files, duplicates, nonexistent resources

CI green on NC 31 + NC 32. Tested locally on master + stable33 (twice each).

@oleksandr-nc oleksandr-nc merged commit e1a7b94 into main Mar 22, 2026
5 checks passed
@oleksandr-nc oleksandr-nc deleted the feature/p1-test-suite-overhaul branch March 22, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants