1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

fix(tests): enable testing with Redis CE 8.0-M4 in CI (#3247)

* introduce github workflow for ci similar to the one in redis-py

use prerelease for 8.0-M4

* Enable osscluster tests in CI

* Add redis major version env

Enable filtering test per redis major version
Fix test for FT.SEARCH WITHSCORE, the default scorer
has changed.

fix Makefile syntax

remove filter from github action

fix makefile

use the container name in Makefile

* remove 1.20 from doctests

* self review, cleanup, add comments

* add comments, reorder prints, add default value for REDIS_MAJOR_VERSION
This commit is contained in:
Nedyalko Dyakov
2025-01-31 16:14:11 +02:00
committed by GitHub
parent 9f9fa221a8
commit 1139bc3aa9
16 changed files with 445 additions and 160 deletions

View File

@ -22,7 +22,7 @@ var _ = Describe("Monitor command", Label("monitor"), func() {
if os.Getenv("RUN_MONITOR_TEST") != "true" {
Skip("Skipping Monitor command test. Set RUN_MONITOR_TEST=true to run it.")
}
client = redis.NewClient(&redis.Options{Addr: ":6379"})
client = redis.NewClient(&redis.Options{Addr: redisPort})
Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred())
})
@ -33,7 +33,7 @@ var _ = Describe("Monitor command", Label("monitor"), func() {
It("should monitor", Label("monitor"), func() {
ress := make(chan string)
client1 := redis.NewClient(&redis.Options{Addr: rediStackAddr})
client1 := redis.NewClient(&redis.Options{Addr: redisPort})
mn := client1.Monitor(ctx, ress)
mn.Start()
// Wait for the Redis server to be in monitoring mode.
@ -61,7 +61,7 @@ func TestMonitorCommand(t *testing.T) {
}
ctx := context.TODO()
client := redis.NewClient(&redis.Options{Addr: ":6379"})
client := redis.NewClient(&redis.Options{Addr: redisPort})
if err := client.FlushDB(ctx).Err(); err != nil {
t.Fatalf("FlushDB failed: %v", err)
}
@ -72,8 +72,8 @@ func TestMonitorCommand(t *testing.T) {
}
}()
ress := make(chan string, 10) // Buffer to prevent blocking
client1 := redis.NewClient(&redis.Options{Addr: ":6379"}) // Adjust the Addr field as necessary
ress := make(chan string, 10) // Buffer to prevent blocking
client1 := redis.NewClient(&redis.Options{Addr: redisPort}) // Adjust the Addr field as necessary
mn := client1.Monitor(ctx, ress)
mn.Start()
// Wait for the Redis server to be in monitoring mode.