-
Notifications
You must be signed in to change notification settings - Fork 82
test: package integration as python package #2789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
dhaustein
wants to merge
1
commit into
master
Choose a base branch
from
integration-python-pkg
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dhaustein
commented
Sep 8, 2025
Comment on lines
+20
to
+40
| dependencies = [ | ||
| "cryptography==45.0.7", | ||
| "docker==7.1.0", | ||
| "filelock==3.19.1", | ||
| "kubernetes==33.1.0", | ||
| "msgpack==1.1.1", | ||
| "py3dns==4.0.2", | ||
| "pymongo==4.14.1", | ||
| "pytest==8.4.1", | ||
| "pytest-html==4.1.1", | ||
| "pytest-metadata==3.1.1", | ||
| "pytest-timeout==2.4.0", | ||
| "pytest-xdist==3.8.0", | ||
| "redo==3.0.0", | ||
| "requests==2.32.5", | ||
| "urllib3==1.26.20", | ||
| "websockets==15.0.1", | ||
| "flaky==3.8.1", | ||
| "stripe==12.5.0", | ||
| "aiosmtpd==1.4.6", | ||
| ] |
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: not all of these are probably needed, will need to go through them and clean up
8801d7e to
11b9610
Compare
lluiscampos
reviewed
Sep 10, 2025
lluiscampos
reviewed
Sep 10, 2025
Member
lluiscampos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks promising! I drooped some comments 📝
ab31599 to
2d953da
Compare
pyproject.toml file has been updated to correctly define the package structure tests and testutils directories are now exposed as top-level packages named integration_tests and integration_testutils respectively sub-packages are now explicitly listed in pyproject.toml docker-compose*.yml files have been moved from the project root into a new tests/data/compose/ dir docker-compose*.yml files are now treated as package data and included in the integration_tests.data.compose package import statements within the integration_tests and integration_testutils directories have been updated code that previously loaded docker-compose files using relative file paths (e.g., in tests/conftest.py) has been refactored to use the compose files trough importlib.resources Ticket: QA-1170 Changelog: Refactored the integration testing suite into an actual, installable Python package named mender-integration Signed-off-by: Dusan Haustein <[email protected]>
9a0cc80 to
e0f4d52
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactors the structure of the integration test suite in an attempt to decouple it from its downstream consumers, such as
mender-orchestrator,mender-configure-module,mender-gateway, andmender-binary-deltaThe project is now configured as a Python package by adding a
pyproject.tomlfile. In it, two new packages are defined:integration_testsandintegration_testutilsas the two that will actually install.Renamed the top-level
testsdir tointegration_testsand thetestutilstointegration_testutils. This is to avoid potential conflicts (module shadowing) in projects that import these tow packages.Additionally, a
MANIFEST.infile ensures that non-Python files, such as the docker-compose YAML files, are included withintegration_testsunder a new sub/directory.Key changes
Project Structure Refactoring:
testshas been renamed tointegration_teststestutilshas been renamed tointegration_testutilsPython Package Conversion:
pyproject.tomlto define the project as an installable Python package named mender-integration. The top level project itself is not installable howerver, two sub-packagesintegration_testsandintegration_testutilswere defined as installable instead.MANIFEST.infile to ensure that *.yml compose files are included in theintegration_testspackage dataTest Asset Relocation:
integration_tests/data/compose/conftest.pyhas been updated to useimportlib.resourcesto locate these compose files within the packageintegration_tests/data/compose/common.ymlandintegration_tests/data/compose/docker-compose.gateway.ymlfrom elsewhere in theintegrationwere added to ensure they are included with the package data. This is a temporary solution and should be addressed in a cleaner way later. (I did this as a last ditch attempt at making downstream tests work, as they required compose files from all over the place.)New Test Fixture:
Ticket: QA-1170
Changelog: Packaged integration test suite as a python package, so it can be imported in other Mender client related tests.
How to test
See the description for https://github.com/mendersoftware/mender-orchestrator/pull/151