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

feat(tests): validate that ConfigSet and ConfigGet work with Modules (#3258)

* Add tests for unified config in Redis 8

* WIP: fix reading FT.CONFIG with RESP3

* add more tests

* use search-timeout

* move deprecated warnings on the bottom
This commit is contained in:
Nedyalko Dyakov
2025-02-03 19:10:54 +02:00
committed by GitHub
parent d0fb810b13
commit a39be37273
6 changed files with 274 additions and 34 deletions

View File

@ -73,7 +73,19 @@ var RCEDocker = false
// Notes the major version of redis we are executing tests.
// This can be used before we change the bsm fork of ginkgo for one,
// which have support for label sets, so we can filter tests per redis major version.
var REDIS_MAJOR_VERSION = 7
var RedisMajorVersion = 7
func SkipBeforeRedisMajor(version int, msg string) {
if RedisMajorVersion < version {
Skip(fmt.Sprintf("(redis major version < %d) %s", version, msg))
}
}
func SkipAfterRedisMajor(version int, msg string) {
if RedisMajorVersion > version {
Skip(fmt.Sprintf("(redis major version > %d) %s", version, msg))
}
}
func registerProcess(port string, p *redisProcess) {
if processes == nil {
@ -92,16 +104,20 @@ var _ = BeforeSuite(func() {
RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER"))
RCEDocker, _ = strconv.ParseBool(os.Getenv("RCE_DOCKER"))
REDIS_MAJOR_VERSION, _ = strconv.Atoi(os.Getenv("REDIS_MAJOR_VERSION"))
if REDIS_MAJOR_VERSION == 0 {
REDIS_MAJOR_VERSION = 7
RedisMajorVersion, _ = strconv.Atoi(os.Getenv("REDIS_MAJOR_VERSION"))
if RedisMajorVersion == 0 {
RedisMajorVersion = 7
}
Expect(REDIS_MAJOR_VERSION).To(BeNumerically(">=", 6))
Expect(REDIS_MAJOR_VERSION).To(BeNumerically("<=", 8))
fmt.Printf("RECluster: %v\n", RECluster)
fmt.Printf("RCEDocker: %v\n", RCEDocker)
fmt.Printf("REDIS_MAJOR_VERSION: %v\n", REDIS_MAJOR_VERSION)
fmt.Printf("REDIS_MAJOR_VERSION: %v\n", RedisMajorVersion)
if RedisMajorVersion < 6 || RedisMajorVersion > 8 {
panic("incorrect or not supported redis major version")
}
if !RECluster && !RCEDocker {
redisMain, err = startRedis(redisPort)