test: close major coverage gaps in service-context, stream-registry, genie connector, files plugin#278
Closed
jamesbroadhead wants to merge 2 commits intodatabricks:mainfrom
Closed
Conversation
…ctor, files plugin New test files covering major coverage gaps: - context/tests/service-context.test.ts (35 tests, 7% -> 100%) - stream/tests/stream-registry.test.ts (34 tests, 32% -> 100%) - connectors/genie/tests/client.test.ts (28 tests, 61% -> 97%) - plugins/files/tests/upload-and-write.test.ts (50 tests, 69% -> 89%) Total: 1566 -> 1713 tests, all passing. Co-authored-by: Isaac
Contributor
Author
|
Tests are now included in #256. |
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
Adds 131 tests across 4 new test files targeting the largest coverage gaps in the backend. No production code changes.
context/service-context.tsstream/stream-registry.tsconnectors/genie/client.tsplugins/files/plugin.tsWhat's now covered
service-context.ts — initialization with pre-configured and auto-created clients, idempotency, concurrent call deduplication,
createUserContextwith OBO tokens, warehouse auto-discovery with state priority sorting (RUNNING > STOPPED > STARTING), workspace ID via SCIM API fallback, error paths for missing env vars and unreachable workspacestream-registry.ts — LRU eviction under capacity pressure, SSE
STREAM_EVICTEDerror broadcast to all connected clients,AbortControllerabort on eviction with correct reason strings,clear()with "Server shutdown" abort, edge cases (capacity=1, same-id update, sequential evictions, mixed writable states)genie/client.ts —
streamSendMessagefor new + existing conversations with query result emission,streamConversationwith parallel query fetch viaPromise.allSettledand partial failure handling,streamGetMessagepolling until terminal state with abort signal,classifyGenieErrorerror mapping,mapAttachmentsfor query/text/suggestedQuestionsfiles/plugin.ts — upload streaming with mid-transfer
TransformStreamsize enforcement, cache invalidation on upload/delete/mkdir, raw endpoint CSP sandbox with safe vs unsafe content type handling, downloadContent-Dispositionfilename sanitization,_handleApiErrorforAuthenticationError/ApiError/generic errors, shutdown with in-flight write tracking and 10s deadline, volume discovery merging (explicit config wins over env vars)Test plan
This pull request was AI-assisted by Isaac.