Skip to content

Commit 587de7c

Browse files
authored
Merge branch 'master' into master
2 parents 8a2dfe6 + 30e7388 commit 587de7c

File tree

39 files changed

+1465
-161
lines changed

39 files changed

+1465
-161
lines changed

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Checkout
99
uses: actions/checkout@v4
1010
- name: Check Spelling
11-
uses: rojopolis/spellcheck-github-actions@0.46.0
11+
uses: rojopolis/spellcheck-github-actions@0.47.0
1212
with:
1313
config_path: .github/spellcheck-settings.yml
1414
task_name: Markdown

.golangci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
run:
2-
concurrency: 8
3-
deadline: 5m
2+
timeout: 5m
43
tests: false

command.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5492,8 +5492,6 @@ func (cmd *InfoCmd) readReply(rd *proto.Reader) error {
54925492

54935493
section := ""
54945494
scanner := bufio.NewScanner(strings.NewReader(val))
5495-
moduleRe := regexp.MustCompile(`module:name=(.+?),(.+)$`)
5496-
54975495
for scanner.Scan() {
54985496
line := scanner.Text()
54995497
if strings.HasPrefix(line, "#") {
@@ -5504,6 +5502,7 @@ func (cmd *InfoCmd) readReply(rd *proto.Reader) error {
55045502
cmd.val[section] = make(map[string]string)
55055503
} else if line != "" {
55065504
if section == "Modules" {
5505+
moduleRe := regexp.MustCompile(`module:name=(.+?),(.+)$`)
55075506
kv := moduleRe.FindStringSubmatch(line)
55085507
if len(kv) == 3 {
55095508
cmd.val[section][kv[1]] = kv[2]

commands_test.go

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,59 @@ var _ = Describe("Commands", func() {
532532
Expect(info.Val()).To(HaveLen(1))
533533
})
534534

535+
It("should Info Modules", Label("redis.info"), func() {
536+
SkipBeforeRedisMajor(8, "modules are included in info for Redis Version >= 8")
537+
info := client.Info(ctx)
538+
Expect(info.Err()).NotTo(HaveOccurred())
539+
Expect(info.Val()).NotTo(BeNil())
540+
541+
info = client.Info(ctx, "search")
542+
Expect(info.Err()).NotTo(HaveOccurred())
543+
Expect(info.Val()).To(ContainSubstring("search"))
544+
545+
info = client.Info(ctx, "modules")
546+
Expect(info.Err()).NotTo(HaveOccurred())
547+
Expect(info.Val()).To(ContainSubstring("search"))
548+
Expect(info.Val()).To(ContainSubstring("ReJSON"))
549+
Expect(info.Val()).To(ContainSubstring("timeseries"))
550+
Expect(info.Val()).To(ContainSubstring("bf"))
551+
552+
info = client.Info(ctx, "everything")
553+
Expect(info.Err()).NotTo(HaveOccurred())
554+
Expect(info.Val()).To(ContainSubstring("search"))
555+
Expect(info.Val()).To(ContainSubstring("ReJSON"))
556+
Expect(info.Val()).To(ContainSubstring("timeseries"))
557+
Expect(info.Val()).To(ContainSubstring("bf"))
558+
})
559+
560+
It("should InfoMap Modules", Label("redis.info"), func() {
561+
SkipBeforeRedisMajor(8, "modules are included in info for Redis Version >= 8")
562+
info := client.InfoMap(ctx)
563+
Expect(info.Err()).NotTo(HaveOccurred())
564+
Expect(info.Val()).NotTo(BeNil())
565+
566+
info = client.InfoMap(ctx, "search")
567+
Expect(info.Err()).NotTo(HaveOccurred())
568+
Expect(len(info.Val())).To(BeNumerically(">=", 2))
569+
Expect(info.Val()["search_version"]).ToNot(BeNil())
570+
571+
info = client.InfoMap(ctx, "modules")
572+
Expect(info.Err()).NotTo(HaveOccurred())
573+
val := info.Val()
574+
modules, ok := val["Modules"]
575+
Expect(ok).To(BeTrue())
576+
Expect(len(val)).To(BeNumerically(">=", 2))
577+
Expect(val["search_version"]).ToNot(BeNil())
578+
Expect(modules["search"]).ToNot(BeNil())
579+
Expect(modules["ReJSON"]).ToNot(BeNil())
580+
Expect(modules["timeseries"]).ToNot(BeNil())
581+
Expect(modules["bf"]).ToNot(BeNil())
582+
583+
info = client.InfoMap(ctx, "everything")
584+
Expect(info.Err()).NotTo(HaveOccurred())
585+
Expect(len(info.Val())).To(BeNumerically(">=", 10))
586+
})
587+
535588
It("should Info cpu", func() {
536589
info := client.Info(ctx, "cpu")
537590
Expect(info.Err()).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)