Skip to content

Commit 92b2861

Browse files
authored
Merge branch 'master' into ndyakov/CAE-1088-resp3-notification-handlers
2 parents 25bde87 + 3c85d09 commit 92b2861

File tree

10 files changed

+906
-46
lines changed

10 files changed

+906
-46
lines changed

.github/actions/run-tests/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ runs:
2525
2626
# Mapping of redis version to redis testing containers
2727
declare -A redis_version_mapping=(
28-
["8.2.x"]="8.2-M01-pre"
28+
["8.2.x"]="8.2-rc2-pre"
2929
["8.0.x"]="8.0.2"
3030
["7.4.x"]="rs-7.4.0-v5"
3131
["7.2.x"]="rs-7.2.0-v17"

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Go
22

33
on:
44
push:
5-
branches: [master, v9, v9.7, v9.8]
5+
branches: [master, v9, v9.7, v9.8, 'ndyakov/*', 'ofekshenawa/*', 'htemelski-redis/*', 'ce/*']
66
pull_request:
7-
branches: [master, v9, v9.7, v9.8]
7+
branches: [master, v9, v9.7, v9.8, 'ndyakov/*', 'ofekshenawa/*', 'htemelski-redis/*', 'ce/*']
88

99
permissions:
1010
contents: read
@@ -44,7 +44,7 @@ jobs:
4444
4545
# Mapping of redis version to redis testing containers
4646
declare -A redis_version_mapping=(
47-
["8.2.x"]="8.2-M01-pre"
47+
["8.2.x"]="8.2-rc2-pre"
4848
["8.0.x"]="8.0.2"
4949
["7.4.x"]="rs-7.4.0-v5"
5050
)

commands_test.go

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6170,6 +6170,34 @@ var _ = Describe("Commands", func() {
61706170
Expect(n).To(Equal(int64(3)))
61716171
})
61726172

6173+
It("should XTrimMaxLenMode", func() {
6174+
SkipBeforeRedisVersion(8.2, "doesn't work with older redis stack images")
6175+
n, err := client.XTrimMaxLenMode(ctx, "stream", 0, "KEEPREF").Result()
6176+
Expect(err).NotTo(HaveOccurred())
6177+
Expect(n).To(BeNumerically(">=", 0))
6178+
})
6179+
6180+
It("should XTrimMaxLenApproxMode", func() {
6181+
SkipBeforeRedisVersion(8.2, "doesn't work with older redis stack images")
6182+
n, err := client.XTrimMaxLenApproxMode(ctx, "stream", 0, 0, "KEEPREF").Result()
6183+
Expect(err).NotTo(HaveOccurred())
6184+
Expect(n).To(BeNumerically(">=", 0))
6185+
})
6186+
6187+
It("should XTrimMinIDMode", func() {
6188+
SkipBeforeRedisVersion(8.2, "doesn't work with older redis stack images")
6189+
n, err := client.XTrimMinIDMode(ctx, "stream", "4-0", "KEEPREF").Result()
6190+
Expect(err).NotTo(HaveOccurred())
6191+
Expect(n).To(BeNumerically(">=", 0))
6192+
})
6193+
6194+
It("should XTrimMinIDApproxMode", func() {
6195+
SkipBeforeRedisVersion(8.2, "doesn't work with older redis stack images")
6196+
n, err := client.XTrimMinIDApproxMode(ctx, "stream", "4-0", 0, "KEEPREF").Result()
6197+
Expect(err).NotTo(HaveOccurred())
6198+
Expect(n).To(BeNumerically(">=", 0))
6199+
})
6200+
61736201
It("should XAdd", func() {
61746202
id, err := client.XAdd(ctx, &redis.XAddArgs{
61756203
Stream: "stream",
@@ -6223,6 +6251,37 @@ var _ = Describe("Commands", func() {
62236251
Expect(n).To(Equal(int64(3)))
62246252
})
62256253

6254+
It("should XAckDel", func() {
6255+
SkipBeforeRedisVersion(8.2, "doesn't work with older redis stack images")
6256+
// First, create a consumer group
6257+
err := client.XGroupCreate(ctx, "stream", "testgroup", "0").Err()
6258+
Expect(err).NotTo(HaveOccurred())
6259+
6260+
// Read messages to create pending entries
6261+
_, err = client.XReadGroup(ctx, &redis.XReadGroupArgs{
6262+
Group: "testgroup",
6263+
Consumer: "testconsumer",
6264+
Streams: []string{"stream", ">"},
6265+
}).Result()
6266+
Expect(err).NotTo(HaveOccurred())
6267+
6268+
// Test XAckDel with KEEPREF mode
6269+
n, err := client.XAckDel(ctx, "stream", "testgroup", "KEEPREF", "1-0", "2-0").Result()
6270+
Expect(err).NotTo(HaveOccurred())
6271+
Expect(n).To(HaveLen(2))
6272+
6273+
// Clean up
6274+
client.XGroupDestroy(ctx, "stream", "testgroup")
6275+
})
6276+
6277+
It("should XDelEx", func() {
6278+
SkipBeforeRedisVersion(8.2, "doesn't work with older redis stack images")
6279+
// Test XDelEx with KEEPREF mode
6280+
n, err := client.XDelEx(ctx, "stream", "KEEPREF", "1-0", "2-0").Result()
6281+
Expect(err).NotTo(HaveOccurred())
6282+
Expect(n).To(HaveLen(2))
6283+
})
6284+
62266285
It("should XLen", func() {
62276286
n, err := client.XLen(ctx, "stream").Result()
62286287
Expect(err).NotTo(HaveOccurred())

doctests/geo_index_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ func ExampleClient_geoindex() {
199199
// OK
200200
// OK
201201
// OK
202-
// {1 [{product:46885 <nil> <nil> <nil> map[$:{"city":"Denver","description":"Navy Blue Slippers","location":"-104.991531, 39.742043","price":45.99}]}]}
202+
// {1 [{product:46885 <nil> <nil> <nil> map[$:{"city":"Denver","description":"Navy Blue Slippers","location":"-104.991531, 39.742043","price":45.99}] <nil>}]}
203203
// OK
204204
// OK
205205
// OK
206206
// OK
207207
// OK
208-
// {1 [{shape:4 <nil> <nil> <nil> map[$:[{"geom":"POINT (2 2)","name":"Purple Point"}]]}]}
208+
// {1 [{shape:4 <nil> <nil> <nil> map[$:[{"geom":"POINT (2 2)","name":"Purple Point"}]] <nil>}]}
209209
}

doctests/home_json_example_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func ExampleClient_search_json() {
219219
// STEP_END
220220

221221
// Output:
222-
// {1 [{user:3 <nil> <nil> <nil> map[$:{"age":35,"city":"Tel Aviv","email":"[email protected]","name":"Paul Zamir"}]}]}
222+
// {1 [{user:3 <nil> <nil> <nil> map[$:{"age":35,"city":"Tel Aviv","email":"[email protected]","name":"Paul Zamir"}] <nil>}]}
223223
// London
224224
// Tel Aviv
225225
// 0
@@ -329,5 +329,5 @@ func ExampleClient_search_hash() {
329329
// STEP_END
330330

331331
// Output:
332-
// {1 [{huser:3 <nil> <nil> <nil> map[age:35 city:Tel Aviv email:[email protected] name:Paul Zamir]}]}
332+
// {1 [{huser:3 <nil> <nil> <nil> map[age:35 city:Tel Aviv email:[email protected] name:Paul Zamir] <nil>}]}
333333
}

doctests/search_quickstart_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,6 @@ func ExampleClient_search_qs() {
257257

258258
// Output:
259259
// Documents found: 10
260-
// {1 [{bicycle:0 <nil> <nil> <nil> map[$:{"brand":"Velorim","condition":"new","description":"Small and powerful, the Jigger is the best ride for the smallest of tikes! This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger is the vehicle of choice for the rare tenacious little rider raring to go.","model":"Jigger","price":270}]}]}
261-
// {1 [{bicycle:4 <nil> <nil> <nil> map[$:{"brand":"Noka Bikes","condition":"used","description":"Whether you want to try your hand at XC racing or are looking for a lively trail bike that's just as inspiring on the climbs as it is over rougher ground, the Wilder is one heck of a bike built specifically for short women. Both the frames and components have been tweaked to include a women’s saddle, different bars and unique colourway.","model":"Kahuna","price":3200}]}]}
260+
// {1 [{bicycle:0 <nil> <nil> <nil> map[$:{"brand":"Velorim","condition":"new","description":"Small and powerful, the Jigger is the best ride for the smallest of tikes! This is the tiniest kids’ pedal bike on the market available without a coaster brake, the Jigger is the vehicle of choice for the rare tenacious little rider raring to go.","model":"Jigger","price":270}] <nil>}]}
261+
// {1 [{bicycle:4 <nil> <nil> <nil> map[$:{"brand":"Noka Bikes","condition":"used","description":"Whether you want to try your hand at XC racing or are looking for a lively trail bike that's just as inspiring on the climbs as it is over rougher ground, the Wilder is one heck of a bike built specifically for short women. Both the frames and components have been tweaked to include a women’s saddle, different bars and unique colourway.","model":"Kahuna","price":3200}] <nil>}]}
262262
}

0 commit comments

Comments
 (0)