fix init.sh and test.sh

use tox for chatmaild non-online tests
This commit is contained in:
holger krekel
2023-10-21 12:10:13 +02:00
parent bada933fef
commit 3058ddc542
4 changed files with 28 additions and 13 deletions

View File

@@ -20,7 +20,7 @@ addopts = "-v -ra --strict-markers"
legacy_tox_ini = """
[tox]
isolated_build = true
envlist = lint
envlist = lint,py
[testenv:lint]
skipdist = True
@@ -31,4 +31,10 @@ deps =
commands =
black --quiet --check --diff src/
ruff src/
[testenv]
passenv = CHATMAIL_DOMAIN
deps = pytest
pdbpp
commands = pytest -v -rsXx {posargs: ../tests/chatmaild}
"""

View File

@@ -1,13 +1,8 @@
#!/bin/sh
set -e
python3 -m venv deploy-chatmail/venv
deploy-chatmail/venv/bin/pip install pyinfra pytest
deploy-chatmail/venv/bin/pip install -e deploy-chatmail
deploy-chatmail/venv/bin/pip install -e chatmaild
python3 -m venv venv
pip=venv/bin/pip
python3 -m venv chatmaild/venv
chatmaild/venv/bin/pip install --upgrade pytest build 'setuptools>=68'
chatmaild/venv/bin/pip install -e chatmaild
python3 -m venv online-tests/venv
online-tests/venv/bin/pip install pytest pytest-timeout pdbpp deltachat
$pip install pyinfra pytest build 'setuptools>=68' tox
$pip install -e deploy-chatmail
$pip install -e chatmaild

View File

@@ -1,3 +1,11 @@
#!/bin/bash
chatmaild/venv/bin/pytest chatmaild/ $@
online-tests/venv/bin/pytest online-tests/ -vrx --durations=5 $@
pushd chatmaild
tox
popd
pushd deploy-chatmail
tox
popd
venv/bin/pytest tests/online -vrx --durations=5 $@

View File

@@ -2,6 +2,12 @@ from chatmaild.filtermail import check_encrypted, check_DATA, SendRateLimiter
import pytest
@pytest.fixture
def maildomain():
# let's not depend on a real chatmail instance for the offline tests below
return "chatmail.example.org"
def test_reject_forged_from(maildata, gencreds):
class env:
mail_from = gencreds()[0]