Skip to content

Commit f0f34ff

Browse files
committed
fixes 8
1 parent 92b9cca commit f0f34ff

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

tests/pytest/test_mem.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66

77
CHECK_MEMRECLAIM = os.getenv('MEMRECLAIM', '0') == '1'
8+
SERDE_JSON = os.getenv('SERDE_JSON', '0') == '1'
89

910
JSON_FILES = [
1011
{'file': 'https://raw.githubusercontent.com/mloskot/json_benchmark/master/data/canada.json',
11-
'vsz': 2880000},
12+
'vsz': 2880000 if SERDE_JSON else 598000},
1213
{'file': 'https://raw.githubusercontent.com/RichardHightower/json-parsers-benchmark/master/data/citm_catalog.json',
13-
'vsz': 847000},
14+
'vsz': 847000 if SERDE_JSON else 200000},
1415
]
1516

1617

@@ -64,7 +65,7 @@ def delete():
6465
for i in range(0, 100):
6566
env.execute_command('json.del', 'json', f'json{i}')
6667
print(f"--- del: t={datetime.timedelta(seconds=time.monotonic() - t0)}")
67-
68+
6869
fi = 0
6970
for jfile in JSON_FILES:
7071
fi += 1

tests/pytest/tests.sh

+14-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ cd $HERE
1515
help() {
1616
cat <<-END
1717
Run Python tests
18-
18+
1919
[ARGVARS...] tests.sh [--help|help] [<module-so-path>]
20-
20+
2121
Argument variables:
2222
VERBOSE=1 Print commands
2323
IGNERR=1 Do not abort on error
@@ -29,7 +29,7 @@ help() {
2929
GEN=0|1 General tests
3030
AOF=0|1 Tests with --test-aof
3131
SLAVES=0|1 Tests with --test-slaves
32-
32+
3333
TEST=test Run specific test (e.g. test.py:test_name)
3434
LOG=0|1 Write to log
3535
VALGRIND|VD=1 Run with Valgrind
@@ -91,11 +91,20 @@ valgrind_summary() {
9191

9292
run_tests() {
9393
local title="$1"
94-
[[ ! -z $title ]] && { $ROOT/opt/readies/bin/sep -0; printf "Tests with $title:\n\n"; }
94+
if [[ -z $title ]]; then
95+
title="General tests"
96+
else
97+
title="Tests with $title"
98+
fi
99+
95100
cd $ROOT/tests/pytest
96101
[[ ! -z $TESTMOD ]] && RLTEST_ARGS+=--module $TESTMOD
97-
$OP python3 -m RLTest --clear-logs --module $MODULE --module-args "JSON_BACKEND SERDE_JSON" $RLTEST_ARGS
102+
103+
{ $READIES/bin/sep -0; printf "$title:\n\n"; }
98104
$OP python3 -m RLTest --clear-logs --module $MODULE $RLTEST_ARGS
105+
106+
{ $READIES/bin/sep -0; printf "$title (SERDE_JSON):\n\n"; }
107+
SERDE_JSON=1 $OP python3 -m RLTest --clear-logs --module $MODULE --module-args "JSON_BACKEND SERDE_JSON" $RLTEST_ARGS
99108
}
100109

101110
#----------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)