mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
Several fixes to the intergration tests
- Pass extra_link_args when using an installed libdeltachat - Allow setting the liveconfig by envvar - Show lifeconfig path in the pytest summary line - Pass required envvars through tox - Fix broken liveconfig passing in run-integration-test.sh
This commit is contained in:
@@ -30,6 +30,7 @@ def ffibuilder():
|
|||||||
libs = ['deltachat']
|
libs = ['deltachat']
|
||||||
objs = []
|
objs = []
|
||||||
incs = []
|
incs = []
|
||||||
|
extra_link_args = []
|
||||||
builder = cffi.FFI()
|
builder = cffi.FFI()
|
||||||
builder.set_source(
|
builder.set_source(
|
||||||
'deltachat.capi',
|
'deltachat.capi',
|
||||||
@@ -69,8 +70,8 @@ def ffibuilder():
|
|||||||
distutils.sysconfig.customize_compiler(cc)
|
distutils.sysconfig.customize_compiler(cc)
|
||||||
tmpdir = tempfile.mkdtemp()
|
tmpdir = tempfile.mkdtemp()
|
||||||
try:
|
try:
|
||||||
src_name = os.path.join(tmpdir, "prep.h")
|
src_name = os.path.join(tmpdir, "include.h")
|
||||||
dst_name = os.path.join(tmpdir, "prep2.c")
|
dst_name = os.path.join(tmpdir, "expanded.h")
|
||||||
with open(src_name, "w") as src_fp:
|
with open(src_name, "w") as src_fp:
|
||||||
src_fp.write('#include <deltachat.h>')
|
src_fp.write('#include <deltachat.h>')
|
||||||
cc.preprocess(source=src_name,
|
cc.preprocess(source=src_name,
|
||||||
|
|||||||
@@ -16,6 +16,14 @@ def pytest_addoption(parser):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def pytest_configure(config):
|
||||||
|
cfg = config.getoption('--liveconfig')
|
||||||
|
if not cfg:
|
||||||
|
cfg = os.getenv('DCC_PY_LIVECONFIG')
|
||||||
|
if cfg:
|
||||||
|
config.option.liveconfig = cfg
|
||||||
|
|
||||||
|
|
||||||
def pytest_report_header(config, startdir):
|
def pytest_report_header(config, startdir):
|
||||||
t = tempfile.mktemp()
|
t = tempfile.mktemp()
|
||||||
try:
|
try:
|
||||||
@@ -24,10 +32,14 @@ def pytest_report_header(config, startdir):
|
|||||||
del ac
|
del ac
|
||||||
finally:
|
finally:
|
||||||
os.remove(t)
|
os.remove(t)
|
||||||
return "Deltachat core={} sqlite={}".format(
|
summary = ['Deltachat core={} sqlite={}'.format(
|
||||||
info['deltachat_core_version'],
|
info['deltachat_core_version'],
|
||||||
info['sqlite_version'],
|
info['sqlite_version'],
|
||||||
)
|
)]
|
||||||
|
cfg = config.getoption('--liveconfig')
|
||||||
|
if cfg:
|
||||||
|
summary.append('Liveconfig: {}'.format(os.path.abspath(cfg)))
|
||||||
|
return summary
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
@@ -64,7 +76,7 @@ def acfactory(pytestconfig, tmpdir, request):
|
|||||||
def configlist(self):
|
def configlist(self):
|
||||||
configlist = []
|
configlist = []
|
||||||
for line in open(fn):
|
for line in open(fn):
|
||||||
if line.strip():
|
if line.strip() and not line.strip().startswith('#'):
|
||||||
d = {}
|
d = {}
|
||||||
for part in line.split():
|
for part in line.split():
|
||||||
name, value = part.split("=")
|
name, value = part.split("=")
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ commands =
|
|||||||
passenv =
|
passenv =
|
||||||
TRAVIS
|
TRAVIS
|
||||||
DCC_RS_DEV
|
DCC_RS_DEV
|
||||||
|
DCC_RS_TARGET
|
||||||
|
DCC_PY_LIVECONFIG
|
||||||
deps =
|
deps =
|
||||||
pytest
|
pytest
|
||||||
pytest-faulthandler
|
pytest-faulthandler
|
||||||
|
|||||||
@@ -23,11 +23,10 @@ if [ $? != 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
pushd python
|
pushd python
|
||||||
toxargs="$@"
|
if [ -e "./liveconfig" ]; then
|
||||||
if [ -e liveconfig ]; then
|
export DCC_PY_LIVECONFIG=liveconfig
|
||||||
toxargs="--liveconfig liveconfig $@"
|
|
||||||
fi
|
fi
|
||||||
tox $toxargs
|
tox "$@"
|
||||||
ret=$?
|
ret=$?
|
||||||
popd
|
popd
|
||||||
exit $ret
|
exit $ret
|
||||||
|
|||||||
Reference in New Issue
Block a user