Skip to content

Commit 11b9610

Browse files
committed
test: package integration as python package
Ticket: QA-1170 Changelog: Packaged integration test suite as a python package, so it can be imported in other Mender client related tests. Signed-off-by: Dusan Haustein <dusan.haustein@northern.tech>
1 parent 1c90df4 commit 11b9610

3 files changed

Lines changed: 66 additions & 2 deletions

File tree

backend-tests/docker/docker-compose.backend-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- /var/run/docker.sock:/var/run/docker.sock
1111
command: ${PYTEST_ARGS}
1212
environment:
13-
PYTHONPATH: "/testutils"
13+
PYTHONPATH: "/"
1414
PYTHONDONTWRITEBYTECODE: 1
1515
TESTS_IN_PARALLEL: ${TESTS_IN_PARALLEL}
1616
TENANTADM_STRIPE_API_KEY: ${STRIPE_API_KEY}

pyproject.toml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
1+
[build-system]
2+
requires = ["setuptools>=80.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "mender-integration"
7+
version = "0.1.0"
8+
description = "Mender Integration Tests Suite"
9+
readme = "README.md"
10+
license = { text = "Apache-2.0" }
11+
12+
requires-python = ">=3.12"
13+
14+
classifiers = [
15+
"Programming Language :: Python :: 3",
16+
"License :: OSI Approved :: Apache Software License",
17+
"Operating System :: OS Independent",
18+
]
19+
20+
dependencies = [
21+
"cryptography==45.0.7",
22+
"docker==7.1.0",
23+
"filelock==3.19.1",
24+
"kubernetes==33.1.0",
25+
"msgpack==1.1.1",
26+
"py3dns==4.0.2",
27+
"pymongo==4.14.1",
28+
"pytest==8.4.1",
29+
"pytest-html==4.1.1",
30+
"pytest-metadata==3.1.1",
31+
"pytest-timeout==2.4.0",
32+
"pytest-xdist==3.8.0",
33+
"redo==3.0.0",
34+
"requests==2.32.5",
35+
"urllib3==1.26.20",
36+
"websockets==15.0.1",
37+
"flaky==3.8.1",
38+
"stripe==12.5.0",
39+
"aiosmtpd==1.4.6",
40+
]
41+
42+
[tool.setuptools]
43+
packages = ["tests", "testutils"]
44+
45+
# include compose files so they can be used downstream
46+
[tool.setuptools.package-data]
47+
"*" = ["docker-compose*.yml", "other-components*.yml"]
148

249
[tool.black]
3-
target-version = ['py38']
50+
target-version = ['py312']
451
include = '''
552
(
653
/(

tests/conftest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,20 @@ def version_is_minimum(version, min_version):
465465
return True
466466

467467
return version_parsed >= packaging.version.Version(min_version)
468+
469+
470+
@pytest.fixture(scope="session")
471+
def docker_compose_demo_server(request):
472+
"""
473+
Start demo server using docker compose files from integration package
474+
"""
475+
from testutils.infra.container_manager import factory
476+
from MenderAPI import reset_mender_api
477+
478+
container_factory = factory.get_factory()
479+
env = container_factory.get_standard_setup(num_clients=0) # just the demo server with no clients
480+
request.addfinalizer(env.teardown)
481+
482+
env.setup()
483+
reset_mender_api(env)
484+
yield env

0 commit comments

Comments
 (0)