Skip to content

Commit ec3f182

Browse files
committed
docs(README): update testing section
1 parent c14645c commit ec3f182

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

README.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -296,39 +296,9 @@ vals, err := rdb.Eval(ctx, "return {KEYS[1],ARGV[1]}", []string{"key"}, "hello")
296296
res, err := rdb.Do(ctx, "set", "key", "value").Result()
297297
```
298298
299-
## Run the test
299+
## Testing
300300
301-
go-redis will start a redis-server and run the test cases.
302-
303-
The paths of redis-server bin file and redis config file are defined in `main_test.go`:
304-
305-
```go
306-
var (
307-
redisServerBin, _ = filepath.Abs(filepath.Join("testdata", "redis", "src", "redis-server"))
308-
redisServerConf, _ = filepath.Abs(filepath.Join("testdata", "redis", "redis.conf"))
309-
)
310-
```
311-
312-
For local testing, you can change the variables to refer to your local files, or create a soft link
313-
to the corresponding folder for redis-server and copy the config file to `testdata/redis/`:
314-
315-
```shell
316-
ln -s /usr/bin/redis-server ./go-redis/testdata/redis/src
317-
cp ./go-redis/testdata/redis.conf ./go-redis/testdata/redis/
318-
```
319-
320-
Lastly, run:
321-
322-
```shell
323-
go test
324-
```
325-
326-
Another option is to run your specific tests with an already running redis. The example below, tests
327-
against a redis running on port 9999.:
328-
329-
```shell
330-
REDIS_PORT=9999 go test <your options>
331-
```
301+
The project includes comprehensive test coverage and follows best practices for testing Redis operations. Tests are run using Ginkgo and Gomega for behavior-driven development. For detailed information about running tests, writing tests, and test coverage, please refer to the [Testing Guide](./docs/redis_testing.md). The testing documentation covers test environment setup, common test patterns, and best practices for writing effective tests.
332302
333303
## See also
334304

0 commit comments

Comments
 (0)