Skip to content

Commit 99c8145

Browse files
committed
fixes 13
1 parent 0bce6e6 commit 99c8145

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

tests/pytest/common.py

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
from contextlib import contextmanager
33
from includes import *
44

5+
SANITIZER = os.getenv('SANITIZER', '') # typically 'address' or 'memory'
6+
VALGRIND = os.getenv('VALGRIND', '0') == '1'
7+
CODE_COVERAGE = os.getenv('CODE_COVERAGE', '0') == '1'
8+
59
MEMINFO = os.getenv('MEMINFO', '0') == '1'
610
SERDE_JSON = os.getenv('SERDE_JSON', '0') == '1'
711

tests/pytest/test_mem.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __del__(self):
3030
def testKeys(self):
3131
env = self.env
3232
env.skipOnCluster()
33-
if env.useAof or env.useSlaves:
33+
if env.useAof or env.useSlaves or SANITIZER != '':
3434
env.skip()
3535

3636
def add_and_check(title):
@@ -60,7 +60,7 @@ def delete():
6060
def testFields(self):
6161
env = self.env
6262
env.skipOnCluster()
63-
if env.useAof or env.useSlaves:
63+
if env.useAof or env.useSlaves or SANITIZER != '':
6464
env.skip()
6565

6666
def add_and_check(title):

tests/pytest/tests.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ install_git_lfs() {
5454

5555
setup_redis_server() {
5656
if [[ -n $SAN ]]; then
57-
if [[ $SAN == addr || $SAN == address ]]; then
57+
if [[ $SAN == address ]]; then
5858
REDIS_SERVER=${REDIS_SERVER:-redis-server-asan-6.2}
5959
if ! command -v $REDIS_SERVER > /dev/null; then
6060
echo Building Redis for clang-asan ...
@@ -64,7 +64,7 @@ setup_redis_server() {
6464
export ASAN_OPTIONS=detect_odr_violation=0
6565
# :detect_leaks=0
6666

67-
elif [[ $SAN == mem || $SAN == memory ]]; then
67+
elif [[ $SAN == memory ]]; then
6868
REDIS_SERVER=${REDIS_SERVER:-redis-server-msan-6.2}
6969
if ! command -v $REDIS_SERVER > /dev/null; then
7070
echo Building Redis for clang-msan ...
@@ -92,6 +92,8 @@ setup_redis_server() {
9292
#----------------------------------------------------------------------------------------------
9393

9494
valgrind_config() {
95+
export VALGRIND=1 # for RLTest
96+
9597
export VG_OPTIONS="
9698
-q \
9799
--leak-check=full \
@@ -245,6 +247,11 @@ fi
245247

246248
export OS=$($READIES/bin/platform --os)
247249

250+
if [[ -n $SAN ]]; then
251+
# for RLTest
252+
export SANITIZER="$SAN"
253+
fi
254+
248255
#----------------------------------------------------------------------------------------------
249256

250257
cd $ROOT/tests/pytest

0 commit comments

Comments
 (0)