Before this patch, all scripts which use test/cql-pytest/run.py looked for the Scylla executable as their first step. This is usually the right thing to do, except in two cases where Scylla is *not* needed: 1. The script test/cql-pytest/run-cassandra. 2. The script test/alternator/run with the "--aws" option. So in this patch we change run.py to only look for Scylla when actually needed (the find_scylla() function is called). In both cases mentioned above, find_scylla() will never get called and the script can work even if Scylla was never built. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Closes #13010
36 lines
909 B
Python
Executable File
36 lines
909 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
|
|
# Use the run.py library from ../cql-pytest:
|
|
sys.path.insert(1, sys.path[0] + '/../cql-pytest')
|
|
import run
|
|
|
|
print('Scylla is: ' + run.find_scylla() + '.')
|
|
|
|
ssl = '--ssl' in sys.argv
|
|
if ssl:
|
|
cmd = run.run_scylla_ssl_cql_cmd
|
|
check_cql = run.check_ssl_cql
|
|
else:
|
|
cmd = run.run_scylla_cmd
|
|
check_cql = run.check_cql
|
|
|
|
pid = run.run_with_temporary_dir(cmd)
|
|
ip = run.pid_to_ip(pid)
|
|
|
|
run.wait_for_services(pid, [
|
|
lambda: run.check_rest_api(ip),
|
|
lambda: check_cql(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).
|