test: add unit tests for DB repositories, Sentry module, and Sentry router adapter#1008
Merged
test: add unit tests for DB repositories, Sentry module, and Sentry router adapter#1008
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
approved these changes
Mar 23, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — Well-structured test suite covering 136+ cases across DB repositories, Sentry client/integration, and Sentry router adapter. Tests correctly verify actual implementation behavior (costUsd string conversion, null coalescing, URL encoding, processable resource filtering, concurrency edge cases). Follows established project patterns (mockDb helpers, sharedMocks, vi.mock hoisting). Vitest config change properly adds sentry tests to the unit-core project.
🕵️ claude-code · claude-opus-4-6 · run details
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runsRepository(core CRUD + concurrency),runStatsRepository,llmCallsRepository,debugAnalysisRepository,runLogsRepository,webhookLogsRepository,joinHelperssentry/client.ts(factory, API methods, URL construction, error handling) andsentry/integration.ts(config resolution, boolean delegation)router/adapters/sentry.ts(SentryRouterAdapterfull interface:parseWebhook,isProcessableEvent,isSelfAuthored,resolveProject,dispatchWithCredentials,buildJob,postAck)vitest.config.tsto includetests/unit/sentry/**in theunit-coreprojectTest details
11 new test files — 136+ new test cases:
tests/unit/db/repositories/runsRepository-core.test.tstests/unit/db/repositories/runsRepository-concurrency.test.tstests/unit/db/repositories/runStatsRepository.test.tstests/unit/db/repositories/llmCallsRepository.test.tstests/unit/db/repositories/debugAnalysisRepository.test.tstests/unit/db/repositories/runLogsRepository.test.tstests/unit/db/repositories/webhookLogsRepository.test.tstests/unit/db/repositories/joinHelpers.test.tstests/unit/sentry/client.test.tstests/unit/sentry/integration.test.tstests/unit/router/adapters/sentry.test.tsTesting approach
createMockDbWithGetDb()pattern frommockDb.ts+mockDbClientModulefromsharedMocks.ts; schema mocked viavi.mockonsrc/db/schema/index.jsvi.stubEnvfor token management,vi.stubGlobal('fetch')for HTTP mockingvi.mockonintegrationsRepositorywithvi.mocked()for type-safe mock accesstests/unit/router/adapters/github.test.tsVerification
Trello: https://trello.com/c/69c187eb70655f3bbeccf7ee
🕵️ claude-code · claude-sonnet-4-6 · run details