Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
33f79ce
Introduces test matrix based on Redis versions [8.0-M1, 7.4.1, 7.2.6,…
ggivo Nov 10, 2024
8c43145
Fix GeoXXX tests
ggivo Nov 10, 2024
788f3cb
REDIS_VERSION env var for setting test container version
ggivo Nov 11, 2024
ed13876
Remove accidentally submitted conf directive
ggivo Nov 11, 2024
d076edc
Revert changes in integration action
ggivo Nov 11, 2024
834a1b3
EnabledOnCommandRule get info only for requested command
ggivo Nov 11, 2024
8543deb
Remove accidentally added SinceRedisVersion 7.0.0 for ControlCommands…
ggivo Nov 11, 2024
b0f1ac0
Found issue with CommandInfo command
ggivo Nov 11, 2024
7ed5de2
Use SinceRedisVersion instead of "EnableOnCmmand" because of https://…
ggivo Nov 11, 2024
4c999bb
Use SinceRedisVersion instead of "EnableOnCommand" because of https:/…
ggivo Nov 11, 2024
ea57770
switch default TEST_ENV_PROVIDER
ggivo Nov 11, 2024
594c4da
Use CommandInfo for subcommand
sazzad16 Nov 12, 2024
cce4b19
Get Iterable from Map
sazzad16 Nov 12, 2024
b8e7c05
Use client-libs-test image based on redis-server-stack
ggivo Nov 12, 2024
4bce8ad
Fix: command and subcommand are concatenated with a pipe
sazzad16 Nov 12, 2024
90335d1
Remove commented out code
ggivo Nov 13, 2024
538e3c2
Revert "Use client-libs-test image based on redis-server-stack"
ggivo Nov 14, 2024
c008010
Use native redis TLS support
ggivo Nov 19, 2024
303f152
Introduce forceRedisServerVersion into test
ggivo Nov 19, 2024
73366a2
Fix accidently removed default for 6.2.16 version
ggivo Nov 19, 2024
3e33d07
Generate .key from private.pem
ggivo Nov 19, 2024
41aadde
add ::1 to expected local ip's in the test
ggivo Nov 19, 2024
30cf4e1
add ::1 to expected local ip's in the test
ggivo Nov 19, 2024
a8f5e20
Switch ctest env setup default from 'local' to 'docker'
ggivo Nov 19, 2024
a1e05a5
Mark SSL & ACL test's since 7.0
ggivo Nov 19, 2024
8e9f4b3
Mark SSL & ACL test's since 7.0
ggivo Nov 19, 2024
a2e77ca
Fix NPE in test clean up
ggivo Nov 19, 2024
42a5531
Add how to bootstrap test env with Docker
ggivo Nov 20, 2024
ea7e2c3
Add make target to start containerised test env.
ggivo Nov 23, 2024
a5a9ca2
use dedicate .env file for 6.2.16
ggivo Nov 23, 2024
109d3b6
Apply review comments
ggivo Nov 25, 2024
a8b48b4
re-enable commandInfoWithSubcommands()
ggivo Nov 26, 2024
123d01d
re-enable commandInfoWithSubcommands()
ggivo Nov 26, 2024
d233a22
remove duplicated test
ggivo Nov 26, 2024
ff2a3b6
Code clean up
ggivo Nov 26, 2024
4a22633
Update ControlCommandsTest.java
sazzad16 Nov 27, 2024
b6cee30
Apply suggestions from code review
ggivo Nov 29, 2024
ab91c93
Addressing review comments
ggivo Nov 29, 2024
5d60f37
Update src/test/java/redis/clients/jedis/commands/jedis/AllKindOfValu…
ggivo Nov 29, 2024
eab7696
Undo JedisCommandsTestBase.java formatting only changes
sazzad16 Dec 1, 2024
c7a123f
Apply suggestions from code review
sazzad16 Dec 1, 2024
58de742
Addressing review comments
ggivo Dec 2, 2024
501cc80
Update src/test/java/redis/clients/jedis/commands/commandobjects/Comm…
ggivo Dec 2, 2024
5eb177b
Update src/test/java/redis/clients/jedis/EndpointConfig.java
ggivo Dec 4, 2024
bf837ff
Fix compilation errors after rebase
ggivo Jan 6, 2025
7bde644
rebase on master to accommodate "Add SslOptions #3980"
ggivo Jan 6, 2025
9269e0e
fix
ggivo Jan 6, 2025
33c7545
preserve logs on failure
ggivo Jan 6, 2025
b456013
fix
ggivo Jan 6, 2025
9ee95fd
Fix tests
ggivo Jan 7, 2025
ad49109
Address review comments.
ggivo Jan 7, 2025
10f7dc8
Apply suggestions from code review
ggivo Jan 7, 2025
f6689b4
Address review comments.
ggivo Jan 7, 2025
e9aaf8a
Apply suggestions from code review
ggivo Jan 7, 2025
419350d
Update src/test/java/redis/clients/jedis/commands/jedis/ClusterComman…
ggivo Jan 7, 2025
5a37acc
formating
ggivo Jan 7, 2025
31f0b5f
formating
ggivo Jan 7, 2025
96c8c61
Apply suggestions from code review
ggivo Jan 8, 2025
9a7a061
undo formatting-only changes; reformat imports; etc
sazzad16 Jan 8, 2025
0aa6dca
undo formatting-only changes; reformat imports; etc
sazzad16 Jan 8, 2025
beb0ec5
undo formatting-only changes; reformat imports; etc
sazzad16 Jan 8, 2025
2523857
Attempt to address codescanning error
ggivo Jan 9, 2025
32a1348
Fix GeoPipelineCommandsTest
ggivo Jan 9, 2025
0f884c6
Fix SSLOptionsJedisClusterTest.testSSLWithoutPortMap
ggivo Jan 9, 2025
5684066
Mark SSLJedisClusterTest to be executed on Redis 7.x+
ggivo Jan 10, 2025
1b27308
Replaces "environment" with "certificateLocation" in EndpointConfig.
ggivo Jan 10, 2025
da8bd38
making private
sazzad16 Jan 12, 2025
bd0a353
undo some renames about Geo matcher
sazzad16 Jan 13, 2025
e106f0b
check member in GeoRadiusResponseMatcher
sazzad16 Jan 13, 2025
f33e418
rename static method in GeoRadiusResponseMatcher
sazzad16 Jan 13, 2025
dbb3f72
use 8.0-M02
sazzad16 Jan 13, 2025
8644777
remove repeated 8.0-M02 from docker compose default value
sazzad16 Jan 13, 2025
428585c
Use Redis CE for 8.x redis stack related tests
ggivo Jan 14, 2025
f3e0b7a
Revisit module tests to run on 7.2 and mark where needed required sin…
ggivo Jan 14, 2025
122a58f
Fix in 7.4
ggivo Jan 14, 2025
c400da8
modify SearchWithParamsTest fixes
sazzad16 Jan 14, 2025
49dcf4d
Disable testing against 6.2.16 till module test's are migrated to sup…
ggivo Jan 14, 2025
174b933
Merge branch 'master' into migrate_to_clients_test_image
sazzad16 Jan 14, 2025
bb5b434
Temporary disable restoreParams() tests because of regression in 8.0…
ggivo Jan 14, 2025
dd316bd
Try to print current surefire jvm settings
ggivo Jan 14, 2025
71a30fd
Revert : Try to print current surefire jvm settings
ggivo Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,53 @@ 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. **Start the test environment** by running the following command (examples below).
- For instance, to start the environment with Redis 8.0-M02, use `make start-test-env`.
2. **Run tests** through your IDE, Maven, or other testing tools as needed.
3. **Stop the test environment** by running the following command:
- `make stop-test-env`
- This will stop and tear down the Docker containers running the Redis service

# Start the Test Environment Using Docker

You can bootstrap the test environment for supported versions of Redis using the provided `make` targets.

## Option 1: Using `make` Targets
To bring up the test environment for a specific Redis version (8.0-M02, 7.4.1, 7.2.6, or 6.2.16), use the following command:
```bash
make start-test-env version=8.0-M02 # Replace with desired version
```
To stop test environment:
```bash
make stop-test-env
```
To run tests using dockerized environment:
```bash
make test-on-docker
```

## Option 2: Using docker compose commands directly
Docker compose file can be found in `src/test/resources/env` folder.
- **Redis 8.0-M02**
```bash
rm -rf /tmp/redis-env-work
export REDIS_VERSION=8.0-M02
docker compose up
```
- **Redis 7.4.1, 7.2.6, 6.2.16,**
```bash
rm -rf /tmp/redis-env-work
export REDIS_VERSION=6.2.16
docker compose --env-file .env --env-file .env.v6.2.16 up
```


# Some rules of Jedis source code

## Code Convention
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
mvn javadoc:jar
- name: Run tests
run: |
export TEST_ENV_PROVIDER=local
make test
env:
JVM_OPTS: -Xmx3200m
Expand Down
124 changes: 124 additions & 0 deletions .github/workflows/test-on-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---

name: Build and Test using containerized environment

on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
- '**/*.rst'
branches:
- master
- '[0-9].*'
pull_request:
branches:
- master
- '[0-9].*'
schedule:
- cron: '0 1 * * *' # nightly build
workflow_dispatch:
inputs:
specific_test:
description: 'Run specific test(s) (optional)'
required: false
default: ''
jobs:

build:
name: Build and Test
runs-on: ubuntu-latest
env:
REDIS_ENV_WORK_DIR: ${{ github.workspace }}/redis-env-work
REDIS_ENV_CONF_DIR: ${{ github.workspace }}/src/test/resources/env
CLIENT_LIBS_IMAGE_PREFIX: "redislabs/client-libs-test"
strategy:
fail-fast: false
matrix:
redis_version:
- "8.0-M02"
- "7.4.1"
- "7.2.6"
# - "6.2.16"
steps:
- uses: actions/checkout@v2
- name: Set up publishing to maven central
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'
- name: System setup
run: |
sudo apt update
sudo apt install -y make
make compile-module
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.m2/repository
/var/cache/apt
key: jedis-${{hashFiles('**/pom.xml')}}
# Set up Docker Compose environment
- name: Set up Docker Compose environment
run: |
mkdir -m 777 $REDIS_ENV_WORK_DIR
export REDIS_VERSION="${{ matrix.redis_version }}"
make start-test-env version=$REDIS_VERSION
- name: Maven offline
run: |
mvn -q dependency:go-offline
- name: Build docs
run: |
mvn javadoc:jar
# Run Tests
- name: Run Maven tests
run: |
export TEST_ENV_PROVIDER=docker
export TEST_WORK_FOLDER=$REDIS_ENV_WORK_DIR
echo $TEST_WORK_FOLDER
if [ -z "$TESTS" ]; then
mvn clean compile test
else
mvn -Dtest=$TESTS clean compile test
fi
env:
TESTS: ${{ github.event.inputs.specific_test || '' }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
target/surefire-reports/**/*.xml
# Collect logs on failure
- name: Collect logs on failure
if: failure() # This runs only if the previous steps failed
run: |
echo "Collecting logs from $WORK_DIR..."
ls -la $REDIS_ENV_WORK_DIR
# Upload logs as artifacts
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: redis-env-work-logs-${{ matrix.redis_version }}
path: ${{ env.REDIS_ENV_WORK_DIR }}
# Bring down the Docker Compose test environment
- name: Tear down Docker Compose environment
if: always()
run: |
docker compose $COMPOSE_ENV_FILES -f src/test/resources/env/docker-compose.yml down
continue-on-error: true
# Upload code coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ github.event_name == 'schedule' || (github.event_name == 'push') || github.event_name == 'workflow_dispatch'}}
uses: codecov/test-results-action@v1
with:
fail_ci_if_error: false
files: ./target/surefire-reports/TEST*
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ build/
bin/
tags
.idea
.run
*.aof
*.rdb
redis-git
appendonlydir/
.DS_Store
Loading
Loading