Skip to content

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