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

Rework storage to an interface; add tests for jmm models #7

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

amisevsk
Copy link
Contributor

@amisevsk amisevsk commented Feb 9, 2024

  • Move Store to its own package, introduce an interface to allow subbing out in tests
  • Add testing implementation of Store to pkg/lib/testing
  • Rework jmm models slightly to allow testing
  • Add tests for listModels and coverage for models.go

* Rework the artifact.Store struct into an interface with struct
  LocalStore implementing it to allow substitution during testing where
  I/O would be a hinderance
* Hide the underlying storage from the struct, and force all
  interactions to go through the interface methods (i.e. no more
  store.Storage.Fetch()
Test that listing models works as expected and that bytes -> human
readable format conversion produces expected results.
@amisevsk amisevsk requested a review from gorkem February 9, 2024 18:48
Copy link
Contributor

@gorkem gorkem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@amisevsk amisevsk merged commit 7848141 into main Feb 9, 2024
1 check passed
@amisevsk amisevsk deleted the storage-refactor branch February 9, 2024 19:54
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