Add test coverage to reach 90% line coverage - #3408
Draft
bronachfalls wants to merge 9 commits into
Draft
Conversation
Adds new spec files and extends existing ones to increase test coverage from ~89.73% to 90.00% (9343/10380 lines). Changes include: New spec files: - spec/unit/transport/orch_spec.rb - spec/unit/transport/lxd_spec.rb, lxd/connection_spec.rb - spec/unit/transport/docker_spec.rb, docker/connection_spec.rb - spec/unit/transport/podman_spec.rb, podman/connection_spec.rb - spec/unit/apply_inventory_spec.rb, apply_target_spec.rb - spec/unit/container_result_spec.rb, error_spec.rb - spec/unit/plan_result_spec.rb, rerun_spec.rb, r10k_log_proxy_spec.rb - spec/unit/outputter/logger_spec.rb - spec/unit/bolt_server/file_cache_spec.rb - spec/unit/plugin/task_spec.rb, puppetdb/instance_spec.rb - spec/unit/shell/powershell/ specs Extended existing specs: - analytics_spec.rb: Client#event custom dims, #submit, #finish - executor_spec.rb: #unsubscribe, download_file EEXIST - outputter/rainbow_spec.rb: #start_spin, #colorize - outputter/json_spec.rb: print_plan_info built-in module - resource_instance_spec.rb: _pcore_type, from_asserted_hash, to_json - result_spec.rb: #error, for_lookup, for_task edge cases - util_spec.rb: deep_clone Struct, exec_podman - Various puppetdb, module, task, plan_future specs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Auto-correct Style/SymbolArray, Style/WordArray, Layout/LineLength, Style/SafeNavigation, Style/SymbolProc, Lint/UselessAssignment offenses in new spec files - Fix _pcore_type test: with Puppet fully loaded CI returns a PObjectType, not the Ruby class, so check non-nil instead Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Style/SafeNavigation: thread&.kill in rainbow_spec.rb - Style/SymbolProc: use &:error_hash in logger_spec.rb - Lint/HashCompareByIdentity: suppress cop where object_id keys are required by the deep_clone implementation being tested Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add empty line after include RSpec::LoggingHelper (Layout/EmptyLinesAfterModuleInclusion)
- Convert each_with_object({}) to to_h {} (Style/ReduceToHash) at three sites in executor_spec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move simplecov after rubocop-rake to maintain alphabetical order within the test group as required by Bundler/OrderedGems. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update rubocop from ~> 1.72.2 to ~> 1.91.0 to match what CI installs via rubocop-rake, then fix all violations detected by the newer version: - Auto-correct Style/DirectiveScope, Style/ReduceToHash, Style/SelectByKind, Style/RedundantParentheses, Style/RedundantInterpolationUnfreeze, Style/TimeNow, Style/HashAsLastArrayItem, Style/RedundantRegexpEscape, Layout/EmptyLinesAfterModuleInclusion, Layout/MultilineOperationIndentation, Layout/BeginEndAlignment, Layout/ExtraSpacing, Lint/UselessOr - Add Naming/PredicateMethod and Style/FileOpen to .rubocop_todo.yml for methods that would require API-breaking renames Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This reverts commit 9861a9d.
The previous lint workflow installed rubocop 1.9.1 then rubocop-rake (no version pin), which caused rubocop-rake to pull in rubocop 1.91.0 as a dependency and override the intended version. Switch to bundle exec rubocop so CI uses the same rubocop version as local development (pinned in the Gemfile), and use Ruby 3.1 to match other CI jobs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- rerun_spec: mock File.write to raise instead of using a Unix-only non-writable path (/nonexistent/path/ is writable on Windows) - file_cache_spec: close Tempfile before FileUtils.mv since Windows cannot rename open files (unlike Linux) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gavindidrichsen
marked this pull request as draft
September 11, 2026 12:59
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.
Adds new spec files and extends existing ones to increase test coverage from ~89.73% to 90.00% (9343/10380 lines). Changes include:
New spec files:
Extended existing specs: