Add daily CI for vectorset (#14302)
Some checks failed
CI / test-ubuntu-latest (push) Has been cancelled
CI / test-sanitizer-address (push) Has been cancelled
CI / build-debian-old (push) Has been cancelled
CI / build-macos-latest (push) Has been cancelled
CI / build-32bit (push) Has been cancelled
CI / build-libc-malloc (push) Has been cancelled
CI / build-centos-jemalloc (push) Has been cancelled
CI / build-old-chain-jemalloc (push) Has been cancelled
Codecov / code-coverage (push) Has been cancelled
External Server Tests / test-external-standalone (push) Has been cancelled
External Server Tests / test-external-cluster (push) Has been cancelled
External Server Tests / test-external-nodebug (push) Has been cancelled
Spellcheck / Spellcheck (push) Has been cancelled

This commit is contained in:
debing.sun 2025-12-10 08:52:43 +08:00 committed by GitHub
parent 4499d68748
commit 679e009b73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 80 additions and 2 deletions

View file

@ -11,7 +11,7 @@ on:
inputs:
skipjobs:
description: 'jobs to skip (delete the ones you wanna keep, do not leave empty)'
default: 'valgrind,sanitizer,tls,freebsd,macos,alpine,32bit,iothreads,ubuntu,centos,malloc,specific,fortify,reply-schema,oldTC,defrag'
default: 'valgrind,sanitizer,tls,freebsd,macos,alpine,32bit,iothreads,ubuntu,centos,malloc,specific,fortify,reply-schema,oldTC,defrag,vectorset'
skiptests:
description: 'tests to skip (delete the ones you wanna keep, do not leave empty)'
default: 'redis,modules,sentinel,cluster,unittest'
@ -1251,3 +1251,33 @@ jobs:
- name: test
if: true && !contains(github.event.inputs.skiptests, 'redis')
run: ./runtest --debug-defrag --verbose --clients 1 ${{github.event.inputs.test_args}}
test-vectorset:
runs-on: ubuntu-latest
if: |
(github.event_name == 'workflow_dispatch' || (github.event_name != 'workflow_dispatch' && github.repository == 'redis/redis')) &&
!contains(github.event.inputs.skipjobs, 'vectorset')
timeout-minutes: 14400
steps:
- name: prep
if: github.event_name == 'workflow_dispatch'
run: |
echo "GITHUB_REPOSITORY=${{github.event.inputs.use_repo}}" >> $GITHUB_ENV
echo "GITHUB_HEAD_REF=${{github.event.inputs.use_git_ref}}" >> $GITHUB_ENV
echo "skipjobs: ${{github.event.inputs.skipjobs}}"
echo "skiptests: ${{github.event.inputs.skiptests}}"
echo "test_args: ${{github.event.inputs.test_args}}"
echo "cluster_test_args: ${{github.event.inputs.cluster_test_args}}"
- uses: actions/checkout@v4
with:
repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }}
- name: make
run: make REDIS_CFLAGS='-Werror -DREDIS_TEST'
- name: testprep
run: |
sudo apt-get install tcl8.6 tclx
sudo pip install redis
- name: test
if: true && !contains(github.event.inputs.skiptests, 'redis')
run: ./runtest --accurate --verbose --dump-logs --single vectorset/vectorset ${{github.event.inputs.test_args}}

View file

@ -174,7 +174,8 @@ class TestCase:
def find_test_classes(primary_port, replica_port):
test_classes = []
tests_dir = 'tests'
script_dir = os.path.dirname(os.path.abspath(__file__))
tests_dir = os.path.join(script_dir, 'tests')
if not os.path.exists(tests_dir):
return []
@ -285,6 +286,7 @@ def run_tests():
else:
if total-skipped-passed > 0:
print(colored(f"{total-skipped-passed} TESTS FAILED!", "red"))
sys.exit(1)
if skipped > 0:
print(colored(f"{skipped} TESTS SKIPPED!", "yellow"))

View file

@ -0,0 +1,46 @@
proc check_python_environment {} {
set ret [catch {exec sh -c "which python3 || which python" 2>@1} python_cmd]
if {$ret != 0} {
return ""
}
# Check if redis-py is installed
# Use a more robust way to check redis module
set ret [catch {exec $python_cmd -c "import redis" 2>@1} e]
if {$ret != 0} {
return ""
}
return $python_cmd
}
start_server {} {
set slave_port [srv 0 port]
start_server {} {
set master_port [srv 0 port]
test {Vector set Python test execution} {
set python_cmd [check_python_environment]
if {$python_cmd eq ""} {
puts "Python or redis-py module not found, skipping vectorset tests"
} else {
# Run the Python script with real-time output
puts "Running vectorset tests ..."
puts "Vectorset test output:"
set pipe [open "|$python_cmd modules/vector-sets/test.py --primary-port $master_port --replica-port $slave_port 2>@1" r]
# Read output line by line in real-time
while {[gets $pipe line] >= 0} {
puts $line
}
# Close pipe and check for errors
set result [catch {close $pipe} close_error]
if {$result != 0} {
fail "Vector set Python test failed: $close_error"
}
}
}
}
}