Skip to content

Commit 140b88d

Browse files
committed
wip
1 parent 4f410ad commit 140b88d

File tree

7 files changed

+6214
-15
lines changed

7 files changed

+6214
-15
lines changed

.github/workflows/doctests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
go-version: ["1.22", "1.23"]
28+
go-version: ["1.23"]
2929

3030
steps:
3131
- name: Set up ${{ matrix.go-version }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ testdata/*
55
*.tar.gz
66
*.dic
77
redis8tests.sh
8+
coverage.txt
9+
**/coverage.txt

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
2-
export REDIS_VERSION := "7.4"
32

43
docker.start:
54
docker compose --profile all up -d
@@ -17,8 +16,8 @@ test.ci:
1716
echo "go test in $${dir}"; \
1817
(cd "$${dir}" && \
1918
go mod tidy -compat=1.18 && \
20-
go test -coverprofile=coverage.txt -covermode=atomic ./... -race && \
21-
go vet); \
19+
go vet && \
20+
go test -coverprofile=coverage.txt -covermode=atomic ./... -race); \
2221
done
2322
cd internal/customvet && go build .
2423
go vet -vettool ./internal/customvet/customvet

coverage.txt

Lines changed: 6198 additions & 0 deletions
Large diffs are not rendered by default.

gears_commands_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var _ = Describe("RedisGears commands", Label("gears"), func() {
5050
})
5151

5252
It("should TFunctionLoad, TFunctionLoadArgs and TFunctionDelete ", Label("gears", "tfunctionload"), func() {
53-
SkipAfterRedisVersion(7.2, "gears are not working in later versions")
53+
SkipAfterRedisVersion(7.4, "gears are not working in later versions")
5454
resultAdd, err := client.TFunctionLoad(ctx, libCode("lib1")).Result()
5555
Expect(err).NotTo(HaveOccurred())
5656
Expect(resultAdd).To(BeEquivalentTo("OK"))
@@ -60,7 +60,7 @@ var _ = Describe("RedisGears commands", Label("gears"), func() {
6060
Expect(resultAdd).To(BeEquivalentTo("OK"))
6161
})
6262
It("should TFunctionList", Label("gears", "tfunctionlist"), func() {
63-
SkipAfterRedisVersion(7.2, "gears are not working in later versions")
63+
SkipAfterRedisVersion(7.4, "gears are not working in later versions")
6464
resultAdd, err := client.TFunctionLoad(ctx, libCode("lib1")).Result()
6565
Expect(err).NotTo(HaveOccurred())
6666
Expect(resultAdd).To(BeEquivalentTo("OK"))
@@ -74,7 +74,7 @@ var _ = Describe("RedisGears commands", Label("gears"), func() {
7474
})
7575

7676
It("should TFCall", Label("gears", "tfcall"), func() {
77-
SkipAfterRedisVersion(7.2, "gears are not working in later versions")
77+
SkipAfterRedisVersion(7.4, "gears are not working in later versions")
7878
var resultAdd interface{}
7979
resultAdd, err := client.TFunctionLoad(ctx, libCode("lib1")).Result()
8080
Expect(err).NotTo(HaveOccurred())
@@ -85,7 +85,7 @@ var _ = Describe("RedisGears commands", Label("gears"), func() {
8585
})
8686

8787
It("should TFCallArgs", Label("gears", "tfcallargs"), func() {
88-
SkipAfterRedisVersion(7.2, "gears are not working in later versions")
88+
SkipAfterRedisVersion(7.4, "gears are not working in later versions")
8989
var resultAdd interface{}
9090
resultAdd, err := client.TFunctionLoad(ctx, libCode("lib1")).Result()
9191
Expect(err).NotTo(HaveOccurred())
@@ -97,7 +97,7 @@ var _ = Describe("RedisGears commands", Label("gears"), func() {
9797
})
9898

9999
It("should TFCallASYNC", Label("gears", "TFCallASYNC"), func() {
100-
SkipAfterRedisVersion(7.2, "gears are not working in later versions")
100+
SkipAfterRedisVersion(7.4, "gears are not working in later versions")
101101
var resultAdd interface{}
102102
resultAdd, err := client.TFunctionLoad(ctx, libCode("lib1")).Result()
103103
Expect(err).NotTo(HaveOccurred())
@@ -108,7 +108,7 @@ var _ = Describe("RedisGears commands", Label("gears"), func() {
108108
})
109109

110110
It("should TFCallASYNCArgs", Label("gears", "TFCallASYNCargs"), func() {
111-
SkipAfterRedisVersion(7.2, "gears are not working in later versions")
111+
SkipAfterRedisVersion(7.4, "gears are not working in later versions")
112112
var resultAdd interface{}
113113
resultAdd, err := client.TFunctionLoad(ctx, libCode("lib1")).Result()
114114
Expect(err).NotTo(HaveOccurred())

main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ var _ = BeforeSuite(func() {
9393
RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER"))
9494
RCEDocker, _ = strconv.ParseBool(os.Getenv("RCE_DOCKER"))
9595

96-
RedisVersion, _ = strconv.ParseFloat(os.Getenv("REDIS_VERSION"), 64)
96+
RedisVersion, _ = strconv.ParseFloat(strings.Trim(os.Getenv("REDIS_VERSION"), "\""), 64)
9797

9898
if RedisVersion == 0 {
9999
RedisVersion = 7.2

search_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
379379
// up until redis 8 the default scorer was TFIDF, in redis 8 it is BM25
380380
// this test expect redis major version >= 8
381381
It("should FTSearch WithScores", Label("search", "ftsearch"), func() {
382-
SkipBeforeRedisVersion(8, "default scorer is not BM25")
382+
SkipBeforeRedisVersion(7.9, "default scorer is not BM25")
383383

384384
text1 := &redis.FieldSchema{FieldName: "description", FieldType: redis.SearchFieldTypeText}
385385
val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{}, text1).Result()
@@ -420,9 +420,9 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
420420
})
421421

422422
// up until redis 8 the default scorer was TFIDF, in redis 8 it is BM25
423-
// this test expect redis major version <=7
423+
// this test expect redis version < 8.0
424424
It("should FTSearch WithScores", Label("search", "ftsearch"), func() {
425-
SkipAfterRedisVersion(7, "default scorer is not TFIDF")
425+
SkipAfterRedisVersion(7.9, "default scorer is not TFIDF")
426426
text1 := &redis.FieldSchema{FieldName: "description", FieldType: redis.SearchFieldTypeText}
427427
val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{}, text1).Result()
428428
Expect(err).NotTo(HaveOccurred())
@@ -646,7 +646,7 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
646646
})
647647

648648
It("should FTAggregate with scorer and addscores", Label("search", "ftaggregate", "NonRedisEnterprise"), func() {
649-
SkipBeforeRedisVersion(8, "ADDSCORES is available in Redis CE 8")
649+
SkipBeforeRedisVersion(7.9, "ADDSCORES is available in Redis CE 8")
650650
title := &redis.FieldSchema{FieldName: "title", FieldType: redis.SearchFieldTypeText, Sortable: false}
651651
description := &redis.FieldSchema{FieldName: "description", FieldType: redis.SearchFieldTypeText, Sortable: false}
652652
val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{OnHash: true, Prefix: []interface{}{"product:"}}, title, description).Result()

0 commit comments

Comments
 (0)