fix: resolve stale backend test imports and schema drift

- Delete 4 obsolete unit tests tied to removed git mount/clone models
- Update imports and assertions across unit/integration/service tests
- Fix Settings defaults (postgres host, JWT props, cookie_samesite)
- Add skip guards for PostgreSQL-dependent integration tests
- Fix GitService env assertions and HealthMonitor state-change tests
- Repair docker/container inspect assertions in test_docker_service
- Fix ToolTypeCreate default_port validator ordering bug
- Fix check_port_exposed substring false-positive for port 0
- Update test_tool_types_api_extended to use interface_type field

Quality gates: pytest 311 passed, 34 skipped; npm typecheck/lint/test 87 passed
This commit is contained in:
Developer
2026-06-12 20:23:17 +00:00
parent 79be4eb525
commit 81b9a66ef5
35 changed files with 268 additions and 625 deletions
+4 -4
View File
@@ -5,12 +5,12 @@ from src.database import build_database_url
@pytest.mark.unit
def test_settings_default_database_url_uses_asyncpg() -> None:
def test_settings_default_database_url_uses_asyncpg(monkeypatch) -> None:
"""Test that default database URL uses asyncpg driver and correct defaults."""
monkeypatch.delenv("DATABASE_URL", raising=False)
settings = Settings()
# When DATABASE_URL env var is set (by conftest), it overrides the defaults
# This test verifies the URL format when built from defaults
expected = "postgresql+asyncpg://headquarter:headquarter@localhost:5432/headquarter"
# When DATABASE_URL env var is not set, the URL is built from defaults.
expected = "postgresql+asyncpg://headquarter:headquarter@postgres:5432/headquarter"
assert settings.database_url == expected