don't print a traceback but do a proper return code for "cmdeploy test"

This commit is contained in:
holger krekel
2023-12-10 18:24:08 +01:00
parent bf8a99d844
commit 73d8e01452

View File

@@ -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)