Files
scylladb/test/cql-pytest/run
Nadav Har'El ef45fccdae test/cql-pytest: make test run code more general
Change the cql-pytest-specific run_cql_pytest() function to a more
general function to run pytest in any directory. Will be useful for
reusing the same code for other test runners (e.g., Alternator), and
is also clearer.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
2021-06-03 11:22:36 +03:00

22 lines
610 B
Python
Executable File

#!/usr/bin/env python3
import sys
import run # run.py in this directory
print('Scylla is: ' + run.scylla + '.')
pid = run.run_with_temporary_dir(run.run_scylla_cmd)
ip = run.pid_to_ip(pid)
run.wait_for_cql(pid, ip)
success = run.run_pytest(sys.path[0], ['--host', ip] + sys.argv[1:])
run.summary = 'Scylla tests pass' if success else 'Scylla tests failure'
exit(0 if success else 1)
# Note that the run.cleanup_all() function runs now, just like on any exit
# for any reason in this script. It will delete the temporary files and
# announce the failure or success of the test (printing run.summary).