Redis Stream Coordinator
Design docs

테스트 가이드

테스트는 blast radius에 따라 나눈다. Contributor는 변경 범위에 맞는 테스트부터 실행하면 된다.

빠른 JVM 테스트

전체 JVM 테스트:

./gradlew test --no-daemon

Coordinator만:

./gradlew :coordinator-server:test --no-daemon

Starter만:

./gradlew :redisstream-spring-boot-starter:test --no-daemon

전체 로컬 검증

./gradlew test build --no-daemon
python3 .github/scripts/test_docker_distribution.py

Redis Integration Tests

Redis integration tests는 기본 비활성화되어 있다. 외부 Redis Cluster 정보를 먼저 설정한다.

export AWS_REDIS_CLUSTER_NODES=3.39.42.28:6379
export AWS_REDIS_PASSWORD='your-redis-password'

그 다음:

REDIS_COORDINATOR_INTEGRATION_TESTS=true ./gradlew :coordinator-server:test \
  --tests '*RedisCoordinatorStateStoreIntegrationTest' \
  --tests '*RedisStreamProvisioningIntegrationTest'

Docker Pod Smoke

외부 Redis Cluster를 바라보는 pod topology를 Docker로 실행:

export AWS_REDIS_CLUSTER_NODES=3.39.42.28:6379
export AWS_REDIS_PASSWORD='your-redis-password'
docker compose -f compose.pods.yaml -p rsc-pods up -d --build

Stack:

확인:

curl -u admin:password \
  http://localhost:8080/coord/v1/monitoring/streams/create-order/groups/demo-workers/assignments

curl http://localhost:18090/sample/status
curl http://localhost:18081/sample/events
curl http://localhost:18082/sample/events

Swagger UI:

중단:

docker compose -f compose.pods.yaml -p rsc-pods down

Test Naming

테스트 이름은 operator 또는 application developer 관점의 behavior를 설명해야 한다.

Examples:

큰 state-machine flow test, 작은 scenario test, validation/unit test를 분리해서 유지한다.