Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions .github/search-test/changes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/tests/pytests/common.py b/tests/pytests/common.py
index 059b637c7..88b5a7351 100644
--- a/tests/pytests/common.py
+++ b/tests/pytests/common.py
@@ -210,15 +210,16 @@ def server_version_less_than(env: Env, ver):
return not server_version_at_least(env, ver)

def server_version_is_at_least(ver):
- global server_ver
- if server_ver is None:
- import subprocess
- # Expecting something like "Redis server v=7.2.3 sha=******** malloc=jemalloc-5.3.0 bits=64 build=***************"
- v = subprocess.run([Defaults.binary, '--version'], stdout=subprocess.PIPE).stdout.decode().split()[2].split('=')[1]
- server_ver = version.parse(v)
- if not isinstance(ver, version.Version):
- ver = version.parse(ver)
- return server_ver >= ver
+ return True
+ #global server_ver
+ #if server_ver is None:
+ # import subprocess
+ # # Expecting something like "Redis server v=7.2.3 sha=******** malloc=jemalloc-5.3.0 bits=64 build=***************"
+ # v = subprocess.run([Defaults.binary, '--version'], stdout=subprocess.PIPE).stdout.decode().split()[2].split('=')[1]
+ # server_ver = version.parse(v)
+ #if not isinstance(ver, version.Version):
+ # ver = version.parse(ver)
+ #return server_ver >= ver

def server_version_is_less_than(ver):
return not server_version_is_at_least(ver)
10 changes: 10 additions & 0 deletions .github/search-test/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
packaging <= 24.2
gevent <= 24.11.1
deepdiff <= 8.3.0
redis >= 5.2.1
git+https://github.com/dragonflydb/RLTest.git@DF
numpy <= 2.2.4
scipy <= 1.15.2
faker <= 37.1.0
distro <= 1.9.0
orderly-set <= 5.3.0
113 changes: 113 additions & 0 deletions .github/workflows/search-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
name: Test Dragonfly/Search

on:
push:
branches:
- bobik/search_tests_github_action

permissions:
contents: read

concurrency:
group: search-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
container:
image: ghcr.io/romange/ubuntu-dev:22
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
strategy:
fail-fast: false
name: "Run Search tests with Dragonfly"
permissions:
pull-requests: write
checks: read

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install dependencies
shell: bash
run: |
pip uninstall -y RLTest || true
pip install -r .github/search-test/requirements.txt

- name: Configure CMake
run: |
cmake -B ${GITHUB_WORKSPACE}/build \
-DCMAKE_BUILD_TYPE=Debug -DWITH_AWS:BOOL=OFF \
-GNinja -L
cd ${GITHUB_WORKSPACE}/build && pwd

- name: Build Dragonfly
run: |
cd ${GITHUB_WORKSPACE}/build
ninja dragonfly
echo "-----------------------------"

- name: Clone RediSearch repository
run: |
git clone https://github.com/RediSearch/RediSearch.git
cd RediSearch
git checkout c1a282c3325eb212bb1966c087f6ec213e89282e

- name: Apply patch to RediSearch
run: |
cd RediSearch
patch -p1 < ../.github/search-test/changes.patch

- name: Run tests with standard mode
run: |
# Run Dragonfly in standard mode
./build/dragonfly --dbfilename= --logtostderr 1> /tmp/dragonfly_standard.log 2>&1 &
sleep 5 # Give time for Dragonfly to start

# Check if Dragonfly started
redis-cli ping || exit 1

# Run tests
cd RediSearch/tests/pytests
RLTest --no-progress --env existing-env --existing-env-addr 127.0.0.1:6379 || true

# Stop Dragonfly
pkill -f dragonfly

- name: Run tests with cluster mode
run: |
# Run Dragonfly in cluster mode
./build/dragonfly --dbfilename= --logtostderr --cluster_mode=emulated 1> /tmp/dragonfly_cluster.log 2>&1 &
sleep 5 # Give time for Dragonfly to start

# Check if Dragonfly started
redis-cli ping || exit 1

# Run tests
cd RediSearch/tests/pytests
RLTest --no-progress --env existing-env --existing-env-addr 127.0.0.1:6379 || true

# Stop Dragonfly
pkill -f dragonfly

- name: Show Dragonfly stats (standard mode)
if: always()
run: |
cat /tmp/dragonfly_standard.log

- name: Show Dragonfly stats (cluster mode)
if: always()
run: |
cat /tmp/dragonfly_cluster.log

- name: Upload Dragonfly logs
if: always()
uses: actions/upload-artifact@v4
with:
name: dragonfly-logs
path: |
/tmp/dragonfly_standard.log
/tmp/dragonfly_cluster.log
Loading