Fix failing tests for legacy auth and heartbeat
Build and Push Docker Image / test (push) Successful in 38s Details
Build and Push Docker Image / build (push) Successful in 55s Details

- Add agent_id parameter to legacy Bearer auth test (required by design)
- Add last_heartbeat to test_agent_with_secret fixture

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Matt 2025-12-08 12:40:02 +01:00
parent 42c682c579
commit d72a0c125b
2 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import pytest
import pytest_asyncio
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
from app.models.base import Base
from app.models.base import Base, utc_now
from app.models.tenant import Tenant
from app.models.agent import Agent
from app.models.registration_token import RegistrationToken
@ -139,6 +139,7 @@ async def test_agent_with_secret(
status="online",
token="", # Empty for new auth scheme
secret_hash=secret_hash,
last_heartbeat=utc_now(),
)
db.add(agent)
await db.commit()

View File

@ -109,6 +109,7 @@ class TestGetCurrentAgentCompat:
x_agent_id=None,
x_agent_secret=None,
authorization=f"Bearer {test_agent_legacy.token}",
agent_id=test_agent_legacy.id, # Legacy auth requires agent_id
)
assert result.id == test_agent_legacy.id