Skip to content

Commit

Permalink
Polishing (#3205)
Browse files Browse the repository at this point in the history
  • Loading branch information
tishun authored Mar 7, 2025
1 parent 4c088a3 commit 09a42b1
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Set up Docker Compose environment
run: |
mkdir -m 777 $REDIS_ENV_WORK_DIR
make docker-start
make start
env:
REDIS_ENV_WORK_DIR: ${{ github.workspace }}/work
- name: Maven offline
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@ jobs:
REDIS_ENV_WORK_DIR: ${{ github.workspace }}/work

steps:
- name: Test Redis Server Version
id: map-tags
run: |
# Map requested version to github or tag
case "${{ matrix.redis_version }}" in
"8.0") redis_branch="8.0" stack_version="8.0-M04-pre" redis_test_version="8.0-M04-pre";;
"7.4") redis_branch="7.4" stack_version="rs-7.4.0-v2" redis_test_version="7.4.2";;
"7.2") redis_branch="7.2" stack_version="rs-7.2.0-v14" redis_test_version="7.2.7";;
*) echo "Unsupported version: ${{ matrix.redis_version }}" && exit 1 ;;
esac
# Save them as outputs for later use
echo "redis_branch=$redis_branch" >> $GITHUB_OUTPUT
echo "redis_stack_version=$stack_version" >> $GITHUB_OUTPUT
echo "redis_test_version=$redis_test_version" >> $GITHUB_OUTPUT
- name: Checkout project
uses: actions/checkout@v4
- name: Set Java up in the runner
Expand All @@ -63,8 +49,7 @@ jobs:
- name: Set up Docker Compose environment
run: |
mkdir -m 777 $REDIS_ENV_WORK_DIR
export REDIS_VERSION="${{ steps.map-tags.outputs.redis_test_version }}"
make docker-start version=$REDIS_VERSION
make start version=${{ matrix.redis_version }}
- name: Maven offline
run: |
mvn -q dependency:go-offline
Expand All @@ -76,7 +61,6 @@ jobs:
ls -la $TEST_WORK_FOLDER
make test-coverage
env:
REDIS_STACK_VERSION: ${{ steps.map-tags.outputs.redis_stack_version }}
JVM_OPTS: -Xmx3200m
TERM: dumb
- name: Tear down Docker Compose environment
Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ SHELL := /bin/bash
PATH := ./work/redis-git/src:${PATH}
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PROFILE ?= ci
SUPPORTED_TEST_ENV_VERSIONS := 8.0-M04-pre 7.4.2 7.2.7
DEFAULT_TEST_ENV_VERSION := 8.0-M04-pre
SUPPORTED_TEST_ENV_VERSIONS := 8.0 7.4 7.2
DEFAULT_TEST_ENV_VERSION := 8.0
REDIS_ENV_WORK_DIR := $(or ${REDIS_ENV_WORK_DIR},$(ROOT_DIR)/work)

docker-start:
start:
@if [ -z "$(version)" ]; then \
version=$(arg); \
if [ -z "$$version" ]; then \
Expand All @@ -27,18 +27,17 @@ docker-start:
echo "Environment work directory: $(REDIS_ENV_WORK_DIR)"; \
rm -rf "$(REDIS_ENV_WORK_DIR)"; \
mkdir -p "$(REDIS_ENV_WORK_DIR)"; \
export REDIS_VERSION=$$version && \
docker compose $$env_files -f src/test/resources/docker-env/docker-compose.yml up -d; \
echo "Started test environment with Redis version $$version."


docker-test:
test:
mvn -DskipITs=false clean compile verify -P$(PROFILE)

test-coverage:
mvn -DskipITs=false clean compile verify jacoco:report -P$(PROFILE)

docker-stop:
stop:
docker compose --env-file src/test/resources/docker-env/.env -f src/test/resources/docker-env/docker-compose.yml down; \
rm -rf "$(REDIS_ENV_WORK_DIR)"

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ To build:
```
$ git clone https://github.com/redis/lettuce.git
$ cd lettuce/
$ make docker-start
$ make start
```

* Run the build: ```make docker-test```
* Start Redis (manually): ```make docker-start```
* Stop Redis (manually): ```make docker-stop```
* Run the build: ```make test```
* Start Redis (manually): ```make start```
* Stop Redis (manually): ```make stop```
* Clean up: ```make clean```

Bugs and Feedback
Expand Down
68 changes: 0 additions & 68 deletions src/test/java/io/lettuce/core/RedisContainerIntegrationTests.java

This file was deleted.

1 change: 1 addition & 0 deletions src/test/resources/docker-env/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REDIS_ENV_WORK_DIR=../../../../work/docker
REDIS_VERSION=8.0-M04-pre
REDIS_STACK_VERSION=8.0-M04-pre
3 changes: 3 additions & 0 deletions src/test/resources/docker-env/.env.v7.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REDIS_ENV_WORK_DIR=../../../../work/docker
REDIS_VERSION=7.2.7
REDIS_STACK_VERSION=rs-7.2.0-v14
3 changes: 3 additions & 0 deletions src/test/resources/docker-env/.env.v7.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REDIS_ENV_WORK_DIR=../../../../work/docker
REDIS_VERSION=7.4.2
REDIS_STACK_VERSION=rs-7.4.0-v2
21 changes: 0 additions & 21 deletions src/test/resources/docker/docker-compose.yml

This file was deleted.

0 comments on commit 09a42b1

Please sign in to comment.