Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
Signed-off-by: zwwhdls <zww@hdls.me>
  • Loading branch information
zwwhdls committed Dec 9, 2023
1 parent ed83334 commit b4105f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/apps/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package apps

import (
"context"
"fmt"

"github.com/spf13/cobra"

Expand All @@ -40,9 +41,10 @@ var IngestCmd = &cobra.Command{
}

func ingest(ps string) error {
err := friday.Fri.IngestFromOriginFile(context.TODO(), ps)
usage, err := friday.Fri.IngestFromOriginFile(context.TODO(), ps)
if err != nil {
return err
}
fmt.Printf("Usage: %v", usage)
return nil
}
3 changes: 2 additions & 1 deletion flow/operator/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ func (i *ingestOperator) Do(ctx context.Context, param *flow.Parameter) error {
Name: source,
Content: knowledge,
}
return friday.Fri.IngestFromFile(context.TODO(), doc)
_, err := friday.Fri.IngestFromFile(context.TODO(), doc)
return err
}
2 changes: 1 addition & 1 deletion pkg/friday/ingest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("TestIngest", func() {
Group: 0,
},
}
err := loFriday.Ingest(context.TODO(), elements)
_, err := loFriday.Ingest(context.TODO(), elements)
Expect(err).Should(BeNil())
})
})
Expand Down

0 comments on commit b4105f0

Please sign in to comment.