Skip to content
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

proposal for filesystem interface, sample implementation for record.go #178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KonstantinGasser
Copy link
Contributor

this is the start of the rolling PR for #121.

in timetrace.go I have defined three interfaces to interact with the filesystem.
ProjectFS, RecordFS and ReportFS. The code will compile but not work since the dependency injection is not yet done for the interfaces. In record.go I have changed all current interactions with the fs or the os/ioutil lib with the new recordFS interface.

I'd be happy for feedback on the interfaces and possible unclearness regarding decoupling the fs into multiple interfaces.

@KonstantinGasser
Copy link
Contributor Author

@dominikbraun one follow-up question I have; If the file-system is separated in multiple interfaces for each resource. What would you suggest could be a "best" way to test the separated components? In the background there still will be one Fs struct implementing all the resource interface. However, there could be separated tests each convening only one resource, was this what you mean by testing the components separately?

@dominikbraun dominikbraun self-requested a review September 7, 2021 11:01
@dominikbraun
Copy link
Owner

@dominikbraun one follow-up question I have; If the file-system is separated in multiple interfaces for each resource. What would you suggest could be a "best" way to test the separated components? In the background there still will be one Fs struct implementing all the resource interface. However, there could be separated tests each convening only one resource, was this what you mean by testing the components separately?

Yes, those tests for the Fs methods should be stateless tests where it doesn't make a difference whether it only implements one of those segregated interfaces or the current "big" Filesystem interface.

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.

2 participants