|
23 | 23 |
|
24 | 24 | import multiprocessing |
25 | 25 |
|
26 | | -# testutils comes from the mender-server submodule -- this repo no longer keeps a |
27 | | -# fork of it. Both of these have to happen before the first testutils import |
28 | | -# below: the path so it resolves at all, and the hostname because |
29 | | -# testutils.api.client reads it into a module-level constant at import time. |
30 | | -# |
31 | | -# Traefik's routers match on Host as well as path, and the tests address the |
32 | | -# ingress by container IP, so every request has to carry this. Upstream defaults |
33 | | -# it to "traefik", which is the name its own deployments answer to. |
34 | | -sys.path.insert( |
35 | | - 0, |
36 | | - os.path.join( |
37 | | - os.path.dirname(os.path.abspath(__file__)), "mender_server", "backend", "tests" |
38 | | - ), |
39 | | -) |
40 | | -os.environ.setdefault("GATEWAY_HOSTNAME", "docker.mender.io") |
41 | | - |
42 | 26 | import filelock |
43 | 27 | import pytest |
44 | 28 | from filelock import FileLock |
45 | | -from testutils.infra.container_manager.base import BaseContainerManagerNamespace |
46 | | -from testutils.infra.device import MenderDevice, MenderDeviceGroup |
| 29 | +from mender_testkit.compose import compose_dir |
| 30 | +from mender_testkit.testutils.infra.container_manager.base import ( |
| 31 | + BaseContainerManagerNamespace, |
| 32 | +) |
| 33 | +from mender_testkit.testutils.infra.device import MenderDevice, MenderDeviceGroup |
47 | 34 |
|
48 | 35 | from . import log |
49 | 36 | from .tests.mendertesting import MenderTesting |
50 | 37 |
|
51 | 38 | THIS_DIR = os.path.dirname(os.path.abspath(__file__)) |
52 | 39 | RELEASE_TOOL = os.path.join(THIS_DIR, "..", "extra", "release_tool.py") |
53 | 40 |
|
| 41 | +# mender-server's compose files now come from the mender-testkit package rather |
| 42 | +# than a submodule. They are written to the path the submodule used to occupy, so |
| 43 | +# that the include: directives in tests/compose/*.yml -- and the project_directory |
| 44 | +# they set, which is what makes the relative bind mounts resolve -- keep working |
| 45 | +# unchanged. Gitignored; regenerated on every run. |
| 46 | +compose_dir(dest=os.path.join(THIS_DIR, "mender_server")) |
| 47 | + |
54 | 48 | logging.getLogger("requests").setLevel(logging.CRITICAL) |
55 | 49 | logging.getLogger("paramiko").setLevel(logging.CRITICAL) |
56 | 50 | logging.getLogger("urllib3").setLevel(logging.CRITICAL) |
|
62 | 56 |
|
63 | 57 | machine_name = None |
64 | 58 |
|
65 | | -collect_ignore = ["mender_server"] |
| 59 | +collect_ignore = ["mender_server"] # the materialised compose tree, not test code |
66 | 60 |
|
67 | 61 |
|
68 | 62 | def pytest_addoption(parser): |
|
0 commit comments