mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
make cmdeploy test work
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools>=45"]
|
requires = ["setuptools>=61", "setuptools_scm>=6.2"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
@@ -10,6 +10,12 @@ dependencies = [
|
|||||||
"iniconfig",
|
"iniconfig",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
include-package-data = true
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
where = ['src']
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
doveauth = "chatmaild.doveauth:main"
|
doveauth = "chatmaild.doveauth:main"
|
||||||
filtermail = "chatmaild.filtermail:main"
|
filtermail = "chatmaild.filtermail:main"
|
||||||
@@ -37,7 +43,6 @@ commands =
|
|||||||
ruff src/
|
ruff src/
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
passenv = CHATMAIL_DOMAIN
|
|
||||||
deps = pytest
|
deps = pytest
|
||||||
pdbpp
|
pdbpp
|
||||||
commands = pytest -v -rsXx {posargs: ../tests/chatmaild}
|
commands = pytest -v -rsXx {posargs: ../tests/chatmaild}
|
||||||
|
|||||||
@@ -2,14 +2,12 @@
|
|||||||
Provides the `cmdeploy` entry point function,
|
Provides the `cmdeploy` entry point function,
|
||||||
along with command line option and subcommand parsing.
|
along with command line option and subcommand parsing.
|
||||||
"""
|
"""
|
||||||
import importlib.resources
|
|
||||||
import argparse
|
import argparse
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import iniconfig
|
|
||||||
|
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
from chatmaild.config import read_config, write_initial_config
|
from chatmaild.config import read_config, write_initial_config
|
||||||
@@ -86,7 +84,6 @@ def get_parser():
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def init_cmd(args, out):
|
def init_cmd(args, out):
|
||||||
"""Initialize chatmail config file."""
|
"""Initialize chatmail config file."""
|
||||||
if args.chatmail_ini.exists():
|
if args.chatmail_ini.exists():
|
||||||
@@ -98,7 +95,6 @@ def init_cmd(args, out):
|
|||||||
|
|
||||||
def run_cmd(args, out):
|
def run_cmd(args, out):
|
||||||
"""Deploy chatmail services on the remote server."""
|
"""Deploy chatmail services on the remote server."""
|
||||||
import pyinfra
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
config = read_config(args.chatmail_ini)
|
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", "chatmaild"])
|
||||||
subprocess.check_call([tox, "-c", "deploy-chatmail"])
|
subprocess.check_call([tox, "-c", "deploy-chatmail"])
|
||||||
|
|
||||||
pytest_path = shutil.which("tox")
|
pytest_path = shutil.which("pytest")
|
||||||
subprocess.check_call([pytest_path, "tests/online", "-rs", "-x", "-vrx", "--durations=5"])
|
subprocess.check_call(
|
||||||
|
[pytest_path, "tests/online", "-rs", "-x", "-vrx", "--durations=5"]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main(args=None):
|
def main(args=None):
|
||||||
|
|||||||
@@ -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 $@
|
|
||||||
Reference in New Issue
Block a user