Test the API handler and the server layer - #7
Merged
Conversation
Both packages leaned on the apps/rotom-ng integration tests for what coverage they had: libs/handlers 55%, libs/services 79%. This takes them to 91% and 96%. APIHandler is generic over its controller and worker types, so the tests instantiate it with fakes and drive its HTTP surface against a real ConnectionManager, selector, and jobs manager. That covers the device and controller action error mapping, the jobs endpoints, and pprof gating, none of which were exercised before. For the server layer: UI serving from both a directory and an embedded FS, session routes staying reachable without a credential, /api guarded while the UI is not, listener-versus-address serving, bind failure, route-installer errors, and shutdown timing out on an in-flight request. libs/services/static is a test fixture rather than a shipped asset. The embedded UI is served from a directory of that name at the root of the FS, so covering that path needs one in the package; its embed directive lives in the test file and never reaches a real build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AXB8suZYfpYZsSaoEps67m
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.
Both packages leaned on the apps/rotom-ng integration tests for what coverage they had: libs/handlers 55%, libs/services 79%. This takes them to 91% and 96%.
APIHandler is generic over its controller and worker types, so the tests instantiate it with fakes and drive its HTTP surface against a real ConnectionManager, selector, and jobs manager. That covers the device and controller action error mapping, the jobs endpoints, and pprof gating, none of which were exercised before.
For the server layer: UI serving from both a directory and an embedded FS, session routes staying reachable without a credential, /api guarded while the UI is not, listener-versus-address serving, bind failure, route-installer errors, and shutdown timing out on an in-flight request.
libs/services/static is a test fixture rather than a shipped asset. The embedded UI is served from a directory of that name at the root of the FS, so covering that path needs one in the package; its embed directive lives in the test file and never reaches a real build.
Claude-Session: https://claude.ai/code/session_01AXB8suZYfpYZsSaoEps67m