Skip to content

test: expand coverage for git, filesystem, base_service, and http_client#10

Merged
ya-luotao merged 1 commit into
mainfrom
test/expand-coverage-services-git-filesystem
Jun 17, 2026
Merged

test: expand coverage for git, filesystem, base_service, and http_client#10
ya-luotao merged 1 commit into
mainfrom
test/expand-coverage-services-git-filesystem

Conversation

@ya-luotao

Copy link
Copy Markdown
Owner

Summary

Test-only change that fills coverage gaps in the units a baseline coverage run flagged as weakest — git.rb (60.1%), base_service.rb (52.4%), and filesystem.rb (48.2%) — plus quick wins in http_client.rb. No production code was touched.

What was added

  • git_specinit/remote_add/remote_get, branch ops, add/commit/reset/restore, push/pull with credentials (including restoring the original remote URL even when the push fails), config helpers, dangerously_authenticate, GitStatus predicates, and status parsing of rename/unmerged entries.
  • envd_http_client_spechandle_rpc_response Connect-envelope stream decoding (incl. multibyte UTF-8 and unparseable frames), with_retry idempotent/non-idempotent/abort branches, resolve_proxy, handle_response, normalize_path.
  • filesystem_specget_info/exists?/rename/make_dir/remove/write_files/aliases and the private extraction + upload-response parsing edge cases.
  • base_service_specenvd_client construction and no_proxy bypass.
  • http_client_specpost/put method bodies.

Results

Metric Before After
Examples 279 363
Line coverage 81.61% 89.15%
Branch coverage 60.48% 70.92%

git.rb reached 99.3% line coverage. Full rake spec is green (0 failures) and rubocop reports no offenses across all 61 files.

🤖 Generated with Claude Code

Fill coverage gaps in the weakest units identified by a baseline run
(git.rb 60%, base_service.rb 52%, filesystem.rb 48%):

- git_spec: init/remote_add/remote_get, branch ops, add/commit/reset/restore,
  push & pull with credentials (incl. URL restore on failure), config helpers,
  dangerously_authenticate, GitStatus predicates, rename/unmerged parsing
- envd_http_client_spec: handle_rpc_response envelope decoding, with_retry
  idempotent/non-idempotent/abort branches, resolve_proxy, handle_response,
  normalize_path
- filesystem_spec: get_info/exists?/rename/make_dir/remove/write_files/aliases
  plus private extraction and upload-response parsing edge cases
- base_service_spec: envd_client construction and no_proxy bypass
- http_client_spec: post/put method bodies

Suite: 279 -> 363 examples, 0 failures.
Line coverage 81.61% -> 89.15%; branch 60.48% -> 70.92%.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ya-luotao ya-luotao merged commit 8eb60a7 into main Jun 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant