Skip to content

Improve coverage for file operations#7

Merged
soulteary merged 1 commit intomainfrom
codex/new-task
Nov 6, 2025
Merged

Improve coverage for file operations#7
soulteary merged 1 commit intomainfrom
codex/new-task

Conversation

@soulteary
Copy link
Owner

@soulteary soulteary commented Nov 6, 2025

Summary

  • allow overriding filesystem helpers in fn package to make error paths testable
  • add targeted tests for file handling and directory preparation edge cases
  • ensure GetPathContent, Save, and ensureDirectory reach 100% coverage

Testing

  • go test ./...
  • go test ./internal/fn -cover

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


Note

Make filesystem helpers overridable and add targeted tests for failure paths in GetPathContent, Save, and ensureDirectory.

  • fn package:
    • Introduce overridable filesystem helpers: readFile, writeFile, stat, mkdirAll.
    • Replace direct os calls with helpers in GetPathContent, Save, and ensureDirectory.
  • Tests:
    • Add internal/fn/fn_errors_test.go covering:
      • Read failure in GetPathContent.
      • Save failures: stat error, writeFile error.
      • ensureDirectory edge cases: existing file (not dir), parent not a dir, mkdirAll error, unexpected stat error.

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

@soulteary soulteary merged commit 77f598d into main Nov 6, 2025
2 checks passed
@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 (b04ac66) to head (8b55829).
⚠️ Report is 5 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
+ Coverage   96.63%   98.99%   +2.35%     
==========================================
  Files          11       11              
  Lines         595      595              
==========================================
+ Hits          575      589      +14     
+ Misses         10        3       -7     
+ Partials       10        3       -7     

☔ 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.

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