Creator App Tests / PR Spam Gate (push) Skipped
Frontend Tests / PR Spam Gate (push) Skipped
NPM Format (website & console) / PR Spam Gate (push) Skipped
Pre-commit Checks / PR Spam Gate (push) Skipped
QwenPaw Creator Plugin Release / check-version (push) Canceled after 0s
QwenPaw Creator Plugin Release / upload-oss (push) Canceled after 0s
Tests / PR Spam Gate (push) Skipped
CodeQL / CodeQL (python) (push) Canceled after 0s
CodeQL / CodeQL (typescript) (push) Canceled after 0s
Creator App Tests / Creator Backend Tests (push) Canceled after 0s
Creator App Tests / Creator UI Build & Tests (push) Canceled after 0s
E2E Smoke Tests / Playwright UI Smoke (push) Canceled after 0s
Frontend Tests / Detect console changes (push) Canceled after 0s
NPM Format (website & console) / website format check (push) Canceled after 0s
NPM Format (website & console) / console format check (push) Canceled after 0s
Pre-commit Checks / Pre-commit (push) Canceled after 0s
QwenPaw Data Plugin Release / check-version (push) Canceled after 0s
Tests / Detect code changes (push) Canceled after 0s
Frontend Tests / Vitest Unit Tests (push) Canceled after 0s
Frontend Tests / Frontend Summary (push) Canceled after 0s
QwenPaw Data Plugin Release / upload-oss (push) Canceled after 0s
Tests / Maintainer Approval (push) Canceled after 0s
Tests / Unit Tests - py3.11 - macos-latest (push) Canceled after 0s
Tests / Unit Tests - py3.11 - ubuntu-latest (push) Canceled after 0s
Tests / Unit Tests - py3.13 - ubuntu-latest (push) Canceled after 0s
Tests / Unit Tests - py3.11 - windows-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - macos-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - ubuntu-latest (push) Canceled after 0s
Tests / Contract Tests - py3.13 - ubuntu-latest (push) Canceled after 0s
Tests / Contract Tests - py3.11 - windows-latest (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - macos-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - fallback (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - ubuntu-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.13 - ubuntu-latest - p2 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p0 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p1 (push) Canceled after 0s
Tests / Integrated Tests - py3.11 - windows-latest - p2 (push) Canceled after 0s
Tests / Coverage Report (push) Canceled after 0s
Tests / Test Summary (push) Canceled after 0s
64 lines
1.9 KiB
Python
64 lines
1.9 KiB
Python
# -*- coding: utf-8 -*-
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from qwenpaw.app.workspace import Workspace
|
|
from qwenpaw.drivers.contracts import DriverCard
|
|
from qwenpaw.drivers.storage import card_path, dump_card
|
|
from tests.integration.driver_mcp_fakes import patch_mcp_runtime_clients
|
|
|
|
|
|
def _mcp_card(name: str) -> DriverCard:
|
|
return DriverCard(
|
|
name=name,
|
|
protocol="mcp",
|
|
endpoint={"transport": "stdio", "command": "fake-mcp"},
|
|
)
|
|
|
|
|
|
async def _start_driver_service(workspace: Workspace):
|
|
# pylint: disable=protected-access
|
|
descriptor = workspace._service_manager.descriptors["driver_manager"]
|
|
await workspace._service_manager._start_service(descriptor)
|
|
return workspace.driver_manager
|
|
|
|
|
|
async def _active_driver_names(manager) -> list[str]:
|
|
infos = await manager.list_drivers()
|
|
return [info.name for info in infos if info.status == "active"]
|
|
|
|
|
|
@pytest.mark.integration
|
|
@pytest.mark.asyncio
|
|
@pytest.mark.p1
|
|
async def test_driver_manager_uses_per_workspace_storage(
|
|
tmp_path: Path,
|
|
monkeypatch: pytest.MonkeyPatch,
|
|
) -> None:
|
|
patch_mcp_runtime_clients(monkeypatch)
|
|
workspace_one = Workspace("agent-one", str(tmp_path / "one"))
|
|
workspace_two = Workspace("agent-two", str(tmp_path / "two"))
|
|
dump_card(
|
|
_mcp_card("driver-one"),
|
|
card_path(
|
|
workspace_one.workspace_dir / "drivers",
|
|
"driver-one",
|
|
protocol="mcp",
|
|
),
|
|
)
|
|
dump_card(
|
|
_mcp_card("driver-two"),
|
|
card_path(
|
|
workspace_two.workspace_dir / "drivers",
|
|
"driver-two",
|
|
protocol="mcp",
|
|
),
|
|
)
|
|
|
|
manager_one = await _start_driver_service(workspace_one)
|
|
manager_two = await _start_driver_service(workspace_two)
|
|
|
|
assert await _active_driver_names(manager_one) == ["driver-one"]
|
|
assert await _active_driver_names(manager_two) == ["driver-two"]
|