fix(test): fix 17 pre-existing unit test failures and add astrolabe CI build

Unit test fixes:
- test_userinfo_routes: patch nextcloud_httpx_client instead of httpx.AsyncClient
- test_instrument_tool: patch trace_operation in metrics module (where imported)
- test_management_app_password_endpoints: patch nextcloud_httpx_client and
  get_settings at correct import locations
- test_management_status_endpoint: patch detect_auth_mode and get_settings at
  correct import locations (api.management, not config/config_validators)
- test_token_exchange: fix TokenBrokerService constructor args (client_id/
  client_secret instead of encryption_key)

CI:
- Add Node.js setup and astrolabe build step (composer + npm ci + npm run build)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-02-27 21:53:06 +01:00
parent 59fdcd123a
commit 2d46959d01
7 changed files with 59 additions and 40 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ async def test_query_idp_userinfo_success(mocker):
mock_client.__aexit__.return_value = None
mocker.patch(
"nextcloud_mcp_server.auth.userinfo_routes.httpx.AsyncClient",
"nextcloud_mcp_server.auth.userinfo_routes.nextcloud_httpx_client",
return_value=mock_client,
)
@@ -59,7 +59,7 @@ async def test_query_idp_userinfo_failure(mocker):
mock_client.__aexit__.return_value = None
mocker.patch(
"nextcloud_mcp_server.auth.userinfo_routes.httpx.AsyncClient",
"nextcloud_mcp_server.auth.userinfo_routes.nextcloud_httpx_client",
return_value=mock_client,
)