Skip to content

Commit

Permalink
fix the nil pointer in the integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Oct 2, 2024
1 parent 66ec3ce commit 6fc44cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkg/storage/utils/decomposedfs/decomposedfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1284,9 +1284,14 @@ func (fs *Decomposedfs) refFromNode(ctx context.Context, n *node.Node, storageId

func (fs *Decomposedfs) publishEvent(ctx context.Context, evf func() (any, error)) {
log := appctx.GetLogger(ctx)
if fs.stream == nil {
log.Error().Msg("Failed to publish event, stream is undefined")
return
}
ev, err := evf()
if err != nil {
if err != nil || ev == nil {
log.Error().Err(err).Msg("Failed to crete the event")
return
}
if err := events.Publish(ctx, fs.stream, ev); err != nil {
log.Error().Err(err).Msg("Failed to publish event")
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/grpc/storageprovider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,9 @@ var _ = Describe("storage providers", func() {

targetRef := &storagep.Reference{ResourceId: subdirRef.ResourceId, Path: "/new_subdir"}
res, err := providerClient.Move(ctx, &storagep.MoveRequest{Source: subdirRef, Destination: targetRef})
Expect(res.Status.Code).To(Equal(rpcv1beta1.Code_CODE_OK))

Expect(err).ToNot(HaveOccurred())
Expect(res.GetStatus().GetCode()).To(Equal(rpcv1beta1.Code_CODE_OK))

statRes, err = providerClient.Stat(ctx, &storagep.StatRequest{Ref: subdirRef})
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 6fc44cf

Please sign in to comment.