mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-09 00:13:31 +00:00
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>
22 lines
610 B
Python
Executable File
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).
|