Skip to content

Commit 83cf38d

Browse files
committed
Add how to bootstrap test env with Docker
1 parent 1698b76 commit 83cf38d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/CONTRIBUTING.md

+41
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,47 @@ Jedis unit tests use many Redis instances, so we use a ```Makefile``` to prepare
2525
Start unit tests with ```make test```.
2626
Set up test environments with ```make start```, tear down those environments with ```make stop``` and clean up the environment files with ```make cleanup```.
2727

28+
29+
# Jedis Test Environment Using Docker
30+
31+
This guide explains how to bootstrap and manage a test environment for Jedis using Docker Compose.
32+
33+
## Workflow Steps
34+
1. **Bring up the test environment** (examples provided below).
35+
2. **Run tests** (via IDE, Maven, etc.).
36+
3. **Destroy the test environment** using `docker compose down`.
37+
38+
### Important Note
39+
The default test environment uses the temporary work folder `./redis-env-work`.
40+
Some tests might leave Redis nodes in an inconsistent state, so this folder should be cleaned or removed before bootstrapping the environment again.
41+
42+
43+
## Bootstrap test env using Docker
44+
- **Redis 8.0-M01**
45+
```
46+
rm -rf ./redis-env-work
47+
export REDIS_VERSION=8.0-M01
48+
docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
49+
```
50+
- **Redis 7.4.1**
51+
```
52+
rm -rf ./redis-env-work
53+
export REDIS_VERSION=7.4.1
54+
docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
55+
```
56+
- **Redis 7.2.6**
57+
```
58+
rm -rf ./redis-env-work
59+
export REDIS_VERSION=7.2.6
60+
docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
61+
```
62+
- **Redis 6.2.16**
63+
- **NOTE :** 6.2.16 uses a dedicated .env.v6.12.16 file, since some of the redis configuration settings are not supported in 6.2.16
64+
```
65+
rm -rf ./redis-env-work
66+
docker compose --env-file src/test/resources/env/.env.v6.12.16 -f src/test/resources/env/docker-compose.yml up
67+
```
68+
2869
# Some rules of Jedis source code
2970

3071
## Code Convention

0 commit comments

Comments
 (0)