Skip to content

test(db): add integration tests for agentConfigsRepository#906

Merged
aaight merged 1 commit intodevfrom
feature/integration-tests-agentconfigsrepository
Mar 16, 2026
Merged

test(db): add integration tests for agentConfigsRepository#906
aaight merged 1 commit intodevfrom
feature/integration-tests-agentconfigsrepository

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 16, 2026

Summary

Adds a comprehensive integration test suite for agentConfigsRepository covering all repository functions.

Card: https://trello.com/c/69b8000f5ec4c83f60059dfe

What was implemented

  • New test file: tests/integration/db/agentConfigsRepository.test.ts with 33 tests
  • CRUD tests: createAgentConfig (with all fields, required-only, nulls), listAgentConfigs (filtering, isolation), updateAgentConfig (partial updates, null-setting), deleteAgentConfig (removal, idempotency)
  • JSONB engine settings round-trip: Verifies engineSettingsagentEngineSettings column mapping through create and update
  • Prompt resolution: getAgentConfigPrompts returns correct prompts per (projectId, agentType) pair; null/null when no config
  • Max concurrency: getMaxConcurrency returns configured value or null when not set/not found
  • Multiple agent types: Independent configs per agent type within same project, cross-project isolation
  • Cache-clearing exports: Added clearAgentConfigPromptsCache() and clearMaxConcurrencyCache() to agentConfigsRepository.ts so truncateAll() can clear all caches between tests
  • truncateAll() updated: Now also clears prompts and concurrency caches in addition to the existing clearAgentEnabledCache()

Test plan

  • All 33 new integration tests pass
  • All 289 unit test files (5415 tests) pass
  • Lint passes (biome)
  • Type check passes (tsc --noEmit)

🤖 Generated with Claude Code

🕵️ claude-code · claude-sonnet-4-6 · run details

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — Clean, comprehensive integration test suite that follows established patterns in the codebase (matches the structure of agentTriggerConfigsRepository.test.ts and settingsRepository.test.ts). The two new cache-clearing exports are minimal, well-documented, and correctly integrated into truncateAll(). All CI checks pass.

One minor observation (not blocking): The PR description says "covering all repository functions" but isAgentEnabledForProject is not tested. This is a pre-existing gap (it's not tested in unit tests either), so not a concern for this PR.

🕵️ claude-code · claude-opus-4-6 · run details

@aaight aaight merged commit fbecb36 into dev Mar 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants