Skip to content

Commit d71b18e

Browse files
committed
update README.md
Signed-off-by: Xiaolong Chen <[email protected]>
1 parent ff4d63e commit d71b18e

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

README.md

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -432,34 +432,12 @@ res, err := rdb.Do(ctx, "set", "key", "value").Result()
432432
433433
## Run the test
434434
435-
go-redis will start a redis-server and run the test cases.
436-
437-
The paths of redis-server bin file and redis config file are defined in `main_test.go`:
438-
439-
```go
440-
var (
441-
redisServerBin, _ = filepath.Abs(filepath.Join("testdata", "redis", "src", "redis-server"))
442-
redisServerConf, _ = filepath.Abs(filepath.Join("testdata", "redis", "redis.conf"))
443-
)
444-
```
445-
446-
For local testing, you can change the variables to refer to your local files, or create a soft link
447-
to the corresponding folder for redis-server and copy the config file to `testdata/redis/`:
448-
449-
```shell
450-
ln -s /usr/bin/redis-server ./go-redis/testdata/redis/src
451-
cp ./go-redis/testdata/redis.conf ./go-redis/testdata/redis/
452-
```
453-
454-
Lastly, run:
455-
435+
Start a Redis server, then run:
456436
```shell
457-
go test
437+
go test <your options>
458438
```
459439
460-
Another option is to run your specific tests with an already running redis. The example below, tests
461-
against a redis running on port 9999.:
462-
440+
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.:
463441
```shell
464442
REDIS_PORT=9999 go test <your options>
465443
```

0 commit comments

Comments
 (0)