Skip to content

Commit

Permalink
Update Factory To Use New Reader Wrapper
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 committed Dec 6, 2024
1 parent 424d845 commit 9ce6576
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion storage_v2/factoryadapter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,9 @@ func (f *Factory) CreateTraceWriter() (tracestore.Writer, error) {

// CreateDependencyReader implements depstore.Factory.
func (f *Factory) CreateDependencyReader() (depstore.Reader, error) {
return f.ss.CreateDependencyReader()
dr, err := f.ss.CreateDependencyReader()
if err != nil {
return nil, err
}
return NewDependencyReader(dr), nil
}
3 changes: 2 additions & 1 deletion storage_v2/factoryadapter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func TestAdapterCreateDependencyReaderError(t *testing.T) {
f1.On("CreateDependencyReader").Return(nil, testErr)

f := NewFactory(f1)
_, err := f.CreateDependencyReader()
r, err := f.CreateDependencyReader()
require.ErrorIs(t, err, testErr)
require.Nil(t, r)
}

0 comments on commit 9ce6576

Please sign in to comment.