Unverified Commit fa46aa4d authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

Test infra adjustments for external CI runs (#13421)

- when uploading server logs, make sure they don't overwrite each other.
- sort the test units to get consistent order between them (following
#13220)
- backup and restore the entire server configuration, to protect one
unit from config changes another unit performs
parent 88af96c7
...@@ -42,7 +42,7 @@ jobs: ...@@ -42,7 +42,7 @@ jobs:
run: make REDIS_CFLAGS=-Werror run: make REDIS_CFLAGS=-Werror
- name: Start redis-server - name: Start redis-server
run: | run: |
./src/redis-server --cluster-enabled yes --daemonize yes --save "" --logfile external-redis.log \ ./src/redis-server --cluster-enabled yes --daemonize yes --save "" --logfile external-redis-cluster.log \
--enable-protected-configs yes --enable-debug-command yes --enable-module-command yes --enable-protected-configs yes --enable-debug-command yes --enable-module-command yes
- name: Create a single node cluster - name: Create a single node cluster
run: ./src/redis-cli cluster addslots $(for slot in {0..16383}; do echo $slot; done); sleep 5 run: ./src/redis-cli cluster addslots $(for slot in {0..16383}; do echo $slot; done); sleep 5
...@@ -58,7 +58,7 @@ jobs: ...@@ -58,7 +58,7 @@ jobs:
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: test-external-cluster-log name: test-external-cluster-log
path: external-redis.log path: external-redis-cluster.log
test-external-nodebug: test-external-nodebug:
runs-on: ubuntu-latest runs-on: ubuntu-latest
...@@ -70,7 +70,7 @@ jobs: ...@@ -70,7 +70,7 @@ jobs:
run: make REDIS_CFLAGS=-Werror run: make REDIS_CFLAGS=-Werror
- name: Start redis-server - name: Start redis-server
run: | run: |
./src/redis-server --daemonize yes --save "" --logfile external-redis.log ./src/redis-server --daemonize yes --save "" --logfile external-redis-nodebug.log
- name: Run external test - name: Run external test
run: | run: |
./runtest \ ./runtest \
...@@ -81,5 +81,5 @@ jobs: ...@@ -81,5 +81,5 @@ jobs:
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: test-external-redis-log name: test-external-redis-nodebug-log
path: external-redis.log path: external-redis-nodebug.log
...@@ -369,10 +369,14 @@ proc run_external_server_test {code overrides} { ...@@ -369,10 +369,14 @@ proc run_external_server_test {code overrides} {
r flushall r flushall
r function flush r function flush
# store overrides # store configs
set saved_config {} set saved_config {}
foreach {param val} [r config get *] {
dict set saved_config $param $val
}
# apply overrides
foreach {param val} $overrides { foreach {param val} $overrides {
dict set saved_config $param [lindex [r config get $param] 1]
r config set $param $val r config set $param $val
# If we enable appendonly, wait for for rewrite to complete. This is # If we enable appendonly, wait for for rewrite to complete. This is
...@@ -400,7 +404,8 @@ proc run_external_server_test {code overrides} { ...@@ -400,7 +404,8 @@ proc run_external_server_test {code overrides} {
# restore overrides # restore overrides
dict for {param val} $saved_config { dict for {param val} $saved_config {
r config set $param $val # some may fail, specifically immutable ones.
catch {r config set $param $val}
} }
set srv [lpop ::servers] set srv [lpop ::servers]
......
...@@ -30,7 +30,7 @@ set test_dirs { ...@@ -30,7 +30,7 @@ set test_dirs {
foreach test_dir $test_dirs { foreach test_dir $test_dirs {
set files [glob -nocomplain $dir/tests/$test_dir/*.tcl] set files [glob -nocomplain $dir/tests/$test_dir/*.tcl]
foreach file $files { foreach file [lsort $files] {
lappend ::all_tests $test_dir/[file root [file tail $file]] lappend ::all_tests $test_dir/[file root [file tail $file]]
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment