Skip to content

Commit

Permalink
Add how to bootstrap test env with Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ggivo committed Nov 20, 2024
1 parent 1698b76 commit 83cf38d
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,47 @@ Jedis unit tests use many Redis instances, so we use a ```Makefile``` to prepare
Start unit tests with ```make test```.
Set up test environments with ```make start```, tear down those environments with ```make stop``` and clean up the environment files with ```make cleanup```.


# Jedis Test Environment Using Docker

This guide explains how to bootstrap and manage a test environment for Jedis using Docker Compose.

## Workflow Steps
1. **Bring up the test environment** (examples provided below).
2. **Run tests** (via IDE, Maven, etc.).
3. **Destroy the test environment** using `docker compose down`.

### Important Note
The default test environment uses the temporary work folder `./redis-env-work`.
Some tests might leave Redis nodes in an inconsistent state, so this folder should be cleaned or removed before bootstrapping the environment again.


## Bootstrap test env using Docker
- **Redis 8.0-M01**
```
rm -rf ./redis-env-work
export REDIS_VERSION=8.0-M01
docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
```
- **Redis 7.4.1**
```
rm -rf ./redis-env-work
export REDIS_VERSION=7.4.1
docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
```
- **Redis 7.2.6**
```
rm -rf ./redis-env-work
export REDIS_VERSION=7.2.6
docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
```
- **Redis 6.2.16**
- **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
```
rm -rf ./redis-env-work
docker compose --env-file src/test/resources/env/.env.v6.12.16 -f src/test/resources/env/docker-compose.yml up
```

# Some rules of Jedis source code

## Code Convention
Expand Down

0 comments on commit 83cf38d

Please sign in to comment.