Skip to content

Commit bb94ac7

Browse files
authored
chore(readme): Update the introduction to running tests in README.md (#3495)
* update README.md Signed-off-by: Xiaolong Chen <fukua95@gmail.com> * update README.md Signed-off-by: Xiaolong Chen <fukua95@gmail.com> --------- Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
1 parent ff4d63e commit bb94ac7

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

README.md

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -432,36 +432,9 @@ 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-
456-
```shell
457-
go test
458-
```
459-
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-
435+
Recommended to use Docker, just need to run:
463436
```shell
464-
REDIS_PORT=9999 go test <your options>
437+
make test
465438
```
466439
467440
## See also

0 commit comments

Comments
 (0)