From d71b18e2e63875fb244199e95d30b79b1a4261e3 Mon Sep 17 00:00:00 2001 From: Xiaolong Chen Date: Sat, 30 Aug 2025 23:50:02 +0800 Subject: [PATCH 1/2] update README.md Signed-off-by: Xiaolong Chen --- README.md | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3c6bf7434..794959888 100644 --- a/README.md +++ b/README.md @@ -432,34 +432,12 @@ res, err := rdb.Do(ctx, "set", "key", "value").Result() ## Run the test -go-redis will start a redis-server and run the test cases. - -The paths of redis-server bin file and redis config file are defined in `main_test.go`: - -```go -var ( - redisServerBin, _ = filepath.Abs(filepath.Join("testdata", "redis", "src", "redis-server")) - redisServerConf, _ = filepath.Abs(filepath.Join("testdata", "redis", "redis.conf")) -) -``` - -For local testing, you can change the variables to refer to your local files, or create a soft link -to the corresponding folder for redis-server and copy the config file to `testdata/redis/`: - -```shell -ln -s /usr/bin/redis-server ./go-redis/testdata/redis/src -cp ./go-redis/testdata/redis.conf ./go-redis/testdata/redis/ -``` - -Lastly, run: - +Start a Redis server, then run: ```shell -go test +go test ``` -Another option is to run your specific tests with an already running redis. The example below, tests -against a redis running on port 9999.: - +If the Redis server isn't running on port 6379, make sure to set the REDIS_PORT environment variable. For example, the test below runs against a Redis instance on port 9999.: ```shell REDIS_PORT=9999 go test ``` From 3305904fcd0727d24cd10005299c2027de58ed4c Mon Sep 17 00:00:00 2001 From: Xiaolong Chen Date: Sun, 31 Aug 2025 21:06:07 +0800 Subject: [PATCH 2/2] update README.md Signed-off-by: Xiaolong Chen --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 794959888..071640355 100644 --- a/README.md +++ b/README.md @@ -432,14 +432,9 @@ res, err := rdb.Do(ctx, "set", "key", "value").Result() ## Run the test -Start a Redis server, then run: +Recommended to use Docker, just need to run: ```shell -go test -``` - -If the Redis server isn't running on port 6379, make sure to set the REDIS_PORT environment variable. For example, the test below runs against a Redis instance on port 9999.: -```shell -REDIS_PORT=9999 go test +make test ``` ## See also