Skip to content

Increase scanner coverage to 100%#8

Merged
soulteary merged 2 commits intomainfrom
codex/increase-unit-test-coverage-to-100%
Nov 6, 2025
Merged

Increase scanner coverage to 100%#8
soulteary merged 2 commits intomainfrom
codex/increase-unit-test-coverage-to-100%

Conversation

@soulteary
Copy link
Owner

@soulteary soulteary commented Nov 6, 2025

Summary

  • add targeted tests to cover unreadable directories, unreadable files, and walk errors when loading SSH configs
  • extend scanner error tests (both external and internal) to ensure bufio.Scanner failures return nil
  • refactor ReadSingleConfig to store scanner errors in a local variable for clarity

Testing

  • go test ./...
  • go test -count=1 ./internal/fn -coverprofile=coverage.out

https://chatgpt.com/codex/tasks/task_e_690ccd29b56c83279634e7e3a10e3e0a


Note

Adds comprehensive tests for walk/permission/error scenarios and scanner failures, plus a minor refactor to handle scanner errors via a local variable.

  • Tests:
    • internal/fn/scanner_test.go:
      • Add walk error coverage: inaccessible directories, unreadable files, and error propagation during filepath.Walk (including concurrent deletion).
      • Strengthen scanner error test to ensure overlong lines trigger bufio.Scanner failure and return nil.
    • internal/fn/scanner_internal_test.go:
      • New internal test validating ReadSingleConfig returns nil on scanner errors.
  • Refactor:
    • internal/fn/scanner.go: Store scanner.Err() in local scanErr before returning, clarifying error handling in ReadSingleConfig.

Written by Cursor Bugbot for commit 73db837. This will update automatically on new commits. Configure here.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.99%. Comparing base (77f598d) to head (73db837).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #8   +/-   ##
=======================================
  Coverage   98.99%   98.99%           
=======================================
  Files          11       11           
  Lines         595      596    +1     
=======================================
+ Hits          589      590    +1     
  Misses          3        3           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@soulteary soulteary merged commit fb5d751 into main Nov 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants