diff --git a/commands_test.go b/commands_test.go index 829a94b65..ff48cfce5 100644 --- a/commands_test.go +++ b/commands_test.go @@ -532,6 +532,59 @@ var _ = Describe("Commands", func() { Expect(info.Val()).To(HaveLen(1)) }) + It("should Info Modules", Label("redis.info"), func() { + SkipBeforeRedisMajor(8, "modules are included in info for Redis Version >= 8") + info := client.Info(ctx) + Expect(info.Err()).NotTo(HaveOccurred()) + Expect(info.Val()).NotTo(BeNil()) + + info = client.Info(ctx, "search") + Expect(info.Err()).NotTo(HaveOccurred()) + Expect(info.Val()).To(ContainSubstring("search")) + + info = client.Info(ctx, "modules") + Expect(info.Err()).NotTo(HaveOccurred()) + Expect(info.Val()).To(ContainSubstring("search")) + Expect(info.Val()).To(ContainSubstring("ReJSON")) + Expect(info.Val()).To(ContainSubstring("timeseries")) + Expect(info.Val()).To(ContainSubstring("bf")) + + info = client.Info(ctx, "everything") + Expect(info.Err()).NotTo(HaveOccurred()) + Expect(info.Val()).To(ContainSubstring("search")) + Expect(info.Val()).To(ContainSubstring("ReJSON")) + Expect(info.Val()).To(ContainSubstring("timeseries")) + Expect(info.Val()).To(ContainSubstring("bf")) + }) + + It("should InfoMap Modules", Label("redis.info"), func() { + SkipBeforeRedisMajor(8, "modules are included in info for Redis Version >= 8") + info := client.InfoMap(ctx) + Expect(info.Err()).NotTo(HaveOccurred()) + Expect(info.Val()).NotTo(BeNil()) + + info = client.InfoMap(ctx, "search") + Expect(info.Err()).NotTo(HaveOccurred()) + Expect(len(info.Val())).To(BeNumerically(">=", 2)) + Expect(info.Val()["search_version"]).ToNot(BeNil()) + + info = client.InfoMap(ctx, "modules") + Expect(info.Err()).NotTo(HaveOccurred()) + val := info.Val() + modules, ok := val["Modules"] + Expect(ok).To(BeTrue()) + Expect(len(val)).To(BeNumerically(">=", 2)) + Expect(val["search_version"]).ToNot(BeNil()) + Expect(modules["search"]).ToNot(BeNil()) + Expect(modules["ReJSON"]).ToNot(BeNil()) + Expect(modules["timeseries"]).ToNot(BeNil()) + Expect(modules["bf"]).ToNot(BeNil()) + + info = client.InfoMap(ctx, "everything") + Expect(info.Err()).NotTo(HaveOccurred()) + Expect(len(info.Val())).To(BeNumerically(">=", 10)) + }) + It("should Info cpu", func() { info := client.Info(ctx, "cpu") Expect(info.Err()).NotTo(HaveOccurred())