Skip to content

test: add test for INFO in RCE 8 #3269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: add test for info in RCE 8
  • Loading branch information
ndyakov committed Feb 7, 2025
commit a6af0cfdfe2e478ca4612e1847a9dcc4b9d006ee
53 changes: 53 additions & 0 deletions commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Loading