-
Notifications
You must be signed in to change notification settings - Fork 54
Update embedfs implementation #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
pjbgf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@this-kirke thanks for proposing these changes. Please take a look at the feedback below.
0f56f9c to
6ad6516
Compare
|
Hi Paulo! Thank you for the review. I've updated with requested changes; all tests pass. |
pjbgf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@this-kirke Thanks for the follow up. I just did a full review now, there are a few tests that are redundant which we can remove. But otherwise it LGTM.
Please squash your commits once you are done with the changes below.
|
Thank you for the detailed review! I agree on all points. I think everything should be resolved now; please let me know if there's anything else you notice. We can squash on complete. |
5cb6e4d to
b89ce64
Compare
- Fix path normalization to support billy's absolute path convention ("/")
- Implement missing Lstat method (was returning ErrNotSupported)
- Add proper embed.FS to billy path conversion throughout all methods
Additional test coverage:
- Add dedicated test files for different functionality areas
- Test File interface methods including ReadAt, Close, Lock/Unlock
- Add path normalization and edge case testing
- Test empty file handling and boundary conditions
- Verify proper error handling for read-only operations
Test infrastructure:
- Create embedfs_testdata package for reusable test data
- Resolve import cycles with clean provider pattern
- Add test data including nested directories and various file types
- Organize tests by functionality (fs, dir, file operations)
The embedfs implementation now provides billy.Filesystem compliance
for read-only embedded filesystems.
- Remove memfs dependency and use local sorting for ReadDir - Implement chroot support by wrapping embedfs with chroot.New() in New() - Add comprehensive chroot tests covering read-only operations - Follow same pattern as memfs and osfs for consistent API - Maintain read-only behavior - write operations still return ErrReadOnly This enables embedfs to work with filesystem abstractions that require chroot support for path isolation.
- Move embedfs_testdata directory to embedfs/internal/testdata
- Change package name from embedfs_testdata to testdata
- Update all import paths in test files to use new location
- Update function calls from embedfs_testdata.GetTestData() to testdata.GetTestData()
- Fix test expectations for ReadDir("") to match actual billy filesystem behavior
- Fix file name assertion to match embedded filesystem path structure
- Add missing newlines to end of test files
Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
b89ce64 to
7774d7e
Compare
|
Quite a few suggestions I made were marked as resolved without them being acted upon. I added some of them on the last commit, but don't really have the time atm to review everything that was incorrectly marked as resolved. |
Fixes to embedfs implementation:
Additional test coverage:
Test infrastructure:
The embedfs implementation now provides billy.Filesystem compliance for read-only embedded filesystems.