Skip to content

Commit

Permalink
updated current unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Dec 22, 2024
1 parent c77b58b commit a4061e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/grpcfactory/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/prometheus/client_golang/prometheus"
"github.com/scality/cosi-driver/pkg/grpcfactory"
cosi "sigs.k8s.io/container-object-storage-interface-spec"
)
Expand Down Expand Up @@ -59,7 +60,7 @@ var _ = Describe("gRPC Factory Server", Ordered, func() {
Expect(server).NotTo(BeNil())

go func() {
err := server.Run(ctx)
err := server.Run(ctx, prometheus.NewRegistry())
if errors.Is(err, context.Canceled) {
return // Expected when the context is canceled
}
Expand All @@ -81,7 +82,7 @@ var _ = Describe("gRPC Factory Server", Ordered, func() {
Expect(server2).NotTo(BeNil())

// Run the second server and expect it to fail
err = server2.Run(ctx)
err = server2.Run(ctx, prometheus.NewRegistry())
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("address already in use"))
}, SpecTimeout(1*time.Second))
Expand All @@ -94,7 +95,7 @@ var _ = Describe("gRPC Factory Server", Ordered, func() {
Expect(server).NotTo(BeNil())

// Wait for server.Run to return an error
err = server.Run(ctx)
err = server.Run(ctx, prometheus.NewRegistry())
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("unsupported scheme: expected 'unix'"))
}, SpecTimeout(1*time.Second))
Expand Down

0 comments on commit a4061e7

Please sign in to comment.