Skip to content

Commit b04e7ba

Browse files
authored
Merge branch 'master' into jatin/add-custom-attrs
2 parents dffbe61 + 91dddc2 commit b04e7ba

6 files changed

+75
-5
lines changed

.github/workflows/build.yml

+45-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,50 @@ jobs:
3939
run: make test
4040

4141
- name: Upload to Codecov
42-
uses: codecov/codecov-action@v4
42+
uses: codecov/codecov-action@v5
4343
with:
4444
files: coverage.txt
45-
token: ${{ secrets.CODECOV_TOKEN }}
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
47+
test-redis-ce:
48+
name: test-redis-ce
49+
runs-on: ubuntu-latest
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
redis_version:
54+
- "8.0-M01"
55+
- "7.4.1"
56+
- "7.2.6"
57+
- "6.2.16"
58+
go-version:
59+
- "1.19.x"
60+
- "1.20.x"
61+
- "1.21.x"
62+
63+
steps:
64+
- name: Set up ${{ matrix.go-version }}
65+
uses: actions/setup-go@v5
66+
with:
67+
go-version: ${{ matrix.go-version }}
68+
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
72+
# Set up Docker Compose environment
73+
- name: Set up Docker Compose environment
74+
run: |
75+
docker compose --profile all up -d
76+
77+
- name: Run tests
78+
env:
79+
USE_CONTAINERIZED_REDIS: "true"
80+
RE_CLUSTER: "true"
81+
run: |
82+
go test \
83+
--ginkgo.skip-file="ring_test.go" \
84+
--ginkgo.skip-file="sentinel_test.go" \
85+
--ginkgo.skip-file="osscluster_test.go" \
86+
--ginkgo.skip-file="pubsub_test.go" \
87+
--ginkgo.skip-file="gears_commands_test.go" \
88+
--ginkgo.label-filter='!NonRedisEnterprise'

.github/workflows/test-redis-enterprise.yml

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- name: Test
4848
env:
4949
RE_CLUSTER: "1"
50+
USE_CONTAINERIZED_REDIS: "1"
5051
run: |
5152
go test \
5253
--ginkgo.skip-file="ring_test.go" \

docker-compose.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
3+
services:
4+
5+
redis-stanalone:
6+
image: redislabs/client-libs-test:8.0-M02
7+
container_name: redis-standalone
8+
environment:
9+
- REDIS_CLUSTER=no
10+
- PORT=6379
11+
- TLS_PORT=6666
12+
command: --loadmodule /usr/local/lib/redis/modules/redisbloom.so --loadmodule /usr/local/lib/redis/modules/redisearch.so --loadmodule /usr/local/lib/redis/modules/redistimeseries.so --loadmodule /usr/local/lib/redis/modules/rejson.so
13+
ports:
14+
- 6379:6379
15+
- 6380:6379
16+
- 6666:6666 # TLS port
17+
volumes:
18+
- "./dockers/redis-standalone:/redis/work"
19+
profiles:
20+
- standalone
21+
- all

main_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ var cluster = &clusterScenario{
6666
}
6767

6868
var RECluster = false
69+
var USE_CONTAINERIZED_REDIS = false
6970

7071
func registerProcess(port string, p *redisProcess) {
7172
if processes == nil {
@@ -82,8 +83,8 @@ var _ = BeforeSuite(func() {
8283
}
8384
var err error
8485
RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER"))
85-
86-
if !RECluster {
86+
USE_CONTAINERIZED_REDIS, _ = strconv.ParseBool(os.Getenv("USE_CONTAINERIZED_REDIS"))
87+
if !RECluster || !USE_CONTAINERIZED_REDIS {
8788

8889
redisMain, err = startRedis(redisPort)
8990
Expect(err).NotTo(HaveOccurred())

search_commands.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ func FTSearchQuery(query string, options *FTSearchOptions) SearchQuery {
17751775
}
17761776
}
17771777
if options.SortByWithCount {
1778-
queryArgs = append(queryArgs, "WITHCOUT")
1778+
queryArgs = append(queryArgs, "WITHCOUNT")
17791779
}
17801780
}
17811781
if options.LimitOffset >= 0 && options.Limit > 0 {

search_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
125125
Expect(res2.Docs[1].ID).To(BeEquivalentTo("doc2"))
126126
Expect(res2.Docs[0].ID).To(BeEquivalentTo("doc3"))
127127

128+
res3, err := client.FTSearchWithArgs(ctx, "num", "foo", &redis.FTSearchOptions{NoContent: true, SortBy: []redis.FTSearchSortBy{sortBy2}, SortByWithCount: true}).Result()
129+
Expect(err).NotTo(HaveOccurred())
130+
Expect(res3.Total).To(BeEquivalentTo(int64(0)))
131+
128132
})
129133

130134
It("should FTCreate and FTSearch example", Label("search", "ftcreate", "ftsearch"), func() {

0 commit comments

Comments
 (0)