mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-19 16:15:07 +00:00
Most of the tests are fast and they cover most of the functionality. The slow minority of tests takes significantly more time to run. Developers should run tests frequently in order to get feedback on correctness of their changes. The test runner distinguishes now between fast and slow tests. When given '--fast' switch it skips tests marked as slow. $ time ./test.py [8/8] PASSED tests/memcache/test.py --mode release OK. real 0m33.084s user 0m0.501s sys 0m0.271s $ time ./test.py --fast [8/8] PASSED tests/memcache/test.py --mode release --fast OK. real 0m1.012s user 0m0.464s sys 0m0.247s
31 lines
913 B
Python
Executable File
31 lines
913 B
Python
Executable File
#!/usr/bin/env python3
|
|
import time
|
|
import sys
|
|
import os
|
|
import argparse
|
|
import subprocess
|
|
|
|
|
|
def run(args, cmd):
|
|
mc = subprocess.Popen([os.path.join('build', args.mode, 'apps', 'memcache', 'memcache'), '--smp', '1'])
|
|
print('Memcache started.')
|
|
try:
|
|
time.sleep(0.1)
|
|
cmdline = ['tests/memcache/test_memcache.py'] + cmd
|
|
if args.fast:
|
|
cmdline.append('--fast')
|
|
print('Running: ' + ' '.join(cmdline))
|
|
subprocess.check_call(cmdline)
|
|
finally:
|
|
print('Killing memcache...')
|
|
mc.kill()
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser(description="Seastar test runner")
|
|
parser.add_argument('--fast', action="store_true", help="Run only fast tests")
|
|
parser.add_argument('--mode', action="store", help="Test app in given mode", default='release')
|
|
args = parser.parse_args()
|
|
|
|
run(args, [])
|
|
run(args, ['-U'])
|