make cmdeploy test work

This commit is contained in:
holger krekel 2023-12-09 17:54:56 +01:00
parent d3ca037ebf
commit f388e86287
3 changed files with 11 additions and 12 deletions

View File

@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=45"]
requires = ["setuptools>=61", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"
[project]
@ -10,6 +10,12 @@ dependencies = [
"iniconfig",
]
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
where = ['src']
[project.scripts]
doveauth = "chatmaild.doveauth:main"
filtermail = "chatmaild.filtermail:main"
@ -37,7 +43,6 @@ commands =
ruff src/
[testenv]
passenv = CHATMAIL_DOMAIN
deps = pytest
pdbpp
commands = pytest -v -rsXx {posargs: ../tests/chatmaild}

View File

@ -2,14 +2,12 @@
Provides the `cmdeploy` entry point function,
along with command line option and subcommand parsing.
"""
import importlib.resources
import argparse
import shutil
import subprocess
import os
from pathlib import Path
import iniconfig
from termcolor import colored
from chatmaild.config import read_config, write_initial_config
@ -86,7 +84,6 @@ def get_parser():
return parser
def init_cmd(args, out):
"""Initialize chatmail config file."""
if args.chatmail_ini.exists():
@ -98,7 +95,6 @@ def init_cmd(args, out):
def run_cmd(args, out):
"""Deploy chatmail services on the remote server."""
import pyinfra
try:
config = read_config(args.chatmail_ini)
@ -132,8 +128,10 @@ def test_cmd(args, out):
subprocess.check_call([tox, "-c", "chatmaild"])
subprocess.check_call([tox, "-c", "deploy-chatmail"])
pytest_path = shutil.which("tox")
subprocess.check_call([pytest_path, "tests/online", "-rs", "-x", "-vrx", "--durations=5"])
pytest_path = shutil.which("pytest")
subprocess.check_call(
[pytest_path, "tests/online", "-rs", "-x", "-vrx", "--durations=5"]
)
def main(args=None):

View File

@ -1,4 +0,0 @@
#!/bin/bash
venv/bin/tox -c chatmaild
venv/bin/tox -c deploy-chatmail
venv/bin/pytest tests/online -rs -vrx --durations=5 $@