Files
Chris CoutinhoandClaude Opus 4.6 aeddc28ca6 refactor: remove oauth profile, migrate MCP/OAuth tests to login-flow
Remove the oauth Docker Compose profile (mcp-oauth service, port 8001)
which used OAuth bearer tokens for direct NC API access, requiring
upstream OIDC patches. All NC access should use app passwords via
Login Flow v2 or BasicAuth.

Changes:
- Remove mcp-oauth service from docker-compose.yml
- Remove oauth mode from CI test matrix
- Delete oauth pass-through tests (core, permissions, token exchange)
- Delete oauth-specific tests (elicitation, NC PHP app, astrolabe)
- Migrate MCP/OAuth integration tests to login-flow profile:
  - DCR lifecycle, deletion, token type tests
  - Scope authorization (tool filtering) tests
  - Token introspection tests
- Fix flaky consent screen automation: replace JS btn.click() with
  Playwright native click + retry (handles Vue.js event binding race)
- Add scope-filtered OAuth client fixtures to login-flow conftest
- Keep keycloak profile for external IdP testing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:05:14 +02:00

105 lines
3.1 KiB
Python

"""Smoke tests - critical path tests for quick validation.
These tests verify the most essential functionality:
- MCP server connectivity
- Basic CRUD operations for core apps
- OAuth authentication
- Tool schema validation
Run with: uv run pytest -m smoke -v
Expected runtime: ~30-60 seconds
"""
import json
import pytest
pytestmark = [pytest.mark.integration, pytest.mark.smoke]
async def test_mcp_connectivity_smoke(nc_mcp_client):
"""Smoke test: Verify MCP server is reachable and lists tools."""
tools = await nc_mcp_client.list_tools()
# Should have a reasonable number of tools
assert len(tools.tools) > 30, f"Expected >30 tools, got {len(tools.tools)}"
# Check for core tool categories
tool_names = [tool.name for tool in tools.tools]
assert any("notes" in name for name in tool_names), "Missing notes tools"
assert any("calendar" in name for name in tool_names), "Missing calendar tools"
assert any("webdav" in name for name in tool_names), "Missing webdav tools"
async def test_notes_crud_smoke(nc_mcp_client, nc_client):
"""Smoke test: Verify basic Notes CRUD operations work."""
# Create
create_result = await nc_mcp_client.call_tool(
"nc_notes_create_note",
arguments={
"title": "Smoke Test Note",
"content": "Testing basic CRUD",
"category": "test",
},
)
assert create_result.isError is False
data = json.loads(create_result.content[0].text)
note_id = data["id"]
try:
# Read
get_result = await nc_mcp_client.call_tool(
"nc_notes_get_note",
arguments={"note_id": note_id},
)
assert get_result.isError is False
# Update
update_result = await nc_mcp_client.call_tool(
"nc_notes_update_note",
arguments={
"note_id": note_id,
"title": "Updated Smoke Test",
"content": "Updated content",
"category": "test",
"etag": data["etag"],
},
)
assert update_result.isError is False
finally:
# Delete
delete_result = await nc_mcp_client.call_tool(
"nc_notes_delete_note",
arguments={"note_id": note_id},
)
assert delete_result.isError is False
async def test_calendar_basic_smoke(nc_mcp_client):
"""Smoke test: Verify calendar operations work."""
# List calendars
result = await nc_mcp_client.call_tool(
"nc_calendar_list_calendars",
arguments={},
)
assert result.isError is False
data = json.loads(result.content[0].text)
assert "calendars" in data
assert len(data["calendars"]) > 0
async def test_webdav_basic_smoke(nc_mcp_client):
"""Smoke test: Verify WebDAV file operations work."""
# List root directory
result = await nc_mcp_client.call_tool(
"nc_webdav_list_directory",
arguments={"path": "/"},
)
assert result.isError is False
data = json.loads(result.content[0].text)
assert "files" in data
assert isinstance(data["files"], list)