mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
don't print a traceback but do a proper return code for "cmdeploy test"
This commit is contained in:
@@ -146,13 +146,16 @@ def test_cmd(args, out, config):
|
|||||||
"""Run local and online tests."""
|
"""Run local and online tests."""
|
||||||
|
|
||||||
tox = shutil.which("tox")
|
tox = shutil.which("tox")
|
||||||
subprocess.check_call([tox, "-c", "chatmaild"])
|
proc1 = subprocess.run([tox, "-c", "chatmaild"])
|
||||||
subprocess.check_call([tox, "-c", "deploy-chatmail"])
|
proc2 = subprocess.run([tox, "-c", "deploy-chatmail"])
|
||||||
|
|
||||||
pytest_path = shutil.which("pytest")
|
pytest_path = shutil.which("pytest")
|
||||||
subprocess.check_call(
|
proc3 = subprocess.run(
|
||||||
[pytest_path, "tests/online", "-rs", "-x", "-vrx", "--durations=5"]
|
[pytest_path, "tests/online", "-rs", "-x", "-vrx", "--durations=5"]
|
||||||
)
|
)
|
||||||
|
if any(x.returncode != 0 for x in (proc1, proc2, proc3)):
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def bench_cmd(args, out, config):
|
def bench_cmd(args, out, config):
|
||||||
@@ -220,7 +223,7 @@ def main(args=None):
|
|||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
args.func(args, out, **kwargs)
|
sys.exit(args.func(args, out, **kwargs))
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
out.red("KeyboardInterrupt")
|
out.red("KeyboardInterrupt")
|
||||||
sys.exit(130)
|
sys.exit(130)
|
||||||
|
|||||||
Reference in New Issue
Block a user