From 0885d8f72e55d1a399f0e977f5313ddb4930b9b0 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 16 Oct 2023 17:48:15 +0200 Subject: [PATCH] apply nami's suggestions (chatmail SSH env var, running --slow in test.sh) --- online-tests/conftest.py | 12 ++++++++++-- scripts/test.sh | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/online-tests/conftest.py b/online-tests/conftest.py index 907bd17a..7b3815ee 100644 --- a/online-tests/conftest.py +++ b/online-tests/conftest.py @@ -29,6 +29,14 @@ def maildomain(): return domain +@pytest.fixture +def chatmail_ssh(maildomain): + domain = os.environ.get("CHATMAIL_SSH") + if not domain: + domain = maildomain + return domain + + def pytest_report_header(): domain = os.environ.get("CHATMAIL_DOMAIN") if domain: @@ -150,10 +158,10 @@ def cmfactory(request, maildomain, gencreds, tmpdir, data): @pytest.fixture -def dovelogreader(maildomain): +def dovelogreader(chatmail_ssh): def remote_reader(): popen = subprocess.Popen( - ["ssh", f"root@{maildomain}", "journalctl -f -u dovecot"], + ["ssh", f"root@{chatmail_ssh}", "journalctl -f -u dovecot"], stdout=subprocess.PIPE, ) while 1: diff --git a/scripts/test.sh b/scripts/test.sh index 64e3bb74..5d89eaa6 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -4,4 +4,4 @@ pushd chatmaild/src/chatmaild ../../venv/bin/pytest popd -online-tests/venv/bin/pytest online-tests/ -vrx --durations=5 +online-tests/venv/bin/pytest online-tests/ -vrx --durations=5 --slow