Add unit specs to increase test coverage toward 90% - #402
Merged
Conversation
New specs cover the largest previously-untested areas: - LSP protocol classes (lsp_protocol.rb, lsp_types.rb, lsp_custom.rb) via dynamic ObjectSpace meta-test covering all LSP::LSPBase subclasses - DSP protocol classes (dsp_protocol.rb, dsp_base.rb) via the same pattern covering all DSP::DSPBase subclasses - PuppetEditorServices::Protocol::DebugAdapter (receive_data, encode_and_send, etc.) - PuppetEditorServices::Protocol::DebugAdapterMessages and JsonRPC message types - PuppetEditorServices logging (log_message, init_logging) - PuppetLanguageServer::CrashDump (default_crash_file, write_crash_file) - Cache::Base and Cache::Null sidecar cache classes 163 new examples, 0 failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #402 +/- ##
===========================================
+ Coverage 15.18% 85.24% +70.05%
===========================================
Files 92 92
Lines 8857 8857
===========================================
+ Hits 1345 7550 +6205
+ Misses 7512 1307 -6205 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Without a unique command_name, each of the three sequential RSpec invocations (languageserver, languageserver-sidecar, debugserver) wrote to coverage/.resultset.json under the same "RSpec" key, so each run overwrote the previous result. Codecov only received the final (debugserver) suite's data, reporting ~29% instead of the true combined coverage. Setting ENV['COVERAGE_SUITE'] in each suite-specific spec_helper and using it as the SimpleCov command_name causes SimpleCov to merge all three result sets before uploading. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gavindidrichsen
approved these changes
Sep 4, 2026
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
New specs
spec/languageserver/unit/lsp/lsp_protocol_spec.rbLSP::LSPBasesubclasses (lsp_protocol.rb, lsp_types.rb, lsp_custom.rb) via dynamic ObjectSpace meta-testspec/debugserver/unit/dsp/dsp_protocol_spec.rbDSP::DSPBasesubclasses (dsp_protocol.rb, dsp_base.rb) via dynamic ObjectSpace meta-testspec/languageserver/unit/puppet-editor-services/protocol/debug_adapter_spec.rbPuppetEditorServices::Protocol::DebugAdapter(receive_data, extract_headers, encode_and_send, send_json_string)spec/languageserver/unit/puppet-editor-services/protocol/debug_adapter_messages_spec.rbDebugAdapterMessages— ProtocolMessage, Request, Event, Response, and factory methodsspec/languageserver/unit/puppet-editor-services/protocol/json_rpc_messages_spec.rbspec/languageserver/unit/puppet-editor-services/logging_spec.rbPuppetEditorServices.log_messageandinit_loggingspec/languageserver/unit/puppet-languageserver/crash_dump_spec.rbPuppetLanguageServer::CrashDump.default_crash_fileandwrite_crash_filespec/languageserver-sidecar/unit/puppet-languageserver-sidecar/cache/base_spec.rbCache::Baseinterfacespec/languageserver-sidecar/unit/puppet-languageserver-sidecar/cache/null_spec.rbCache::NullimplementationTest plan
🤖 Generated with Claude Code