Closed f18m closed 1 month ago
interest is there, would merge a more generic and simpler/smaller version
ok thanks for the review! let me try to address the various points you raised
@alexanderankin please note that I also checked in the "integration-test-mosquitto.conf" that is bind-mounted in the init ctor. I'm not sure what's the best way to deliver this kind of resources (the conf file) inside the project... so I just dropped it in the same folder of the init.py file, which is what the init ctor uses for creating the bind-mount...
mounting files is probably the most straight forward way to do it but I would move it into the _configure
(or start
if you want ultimate backwards compatibility) method rather than the constructor. there is a concept of a transferable interface which can be implemented for strings and bytes/io but it is not merged, there is a couple commits here which should eventually make it into the project - https://github.com/testcontainers/testcontainers-python/compare/2bd20c6a9ab811343beee150a4816711848fb9ea...alexanderankin:testcontainers-python:TCP-393_transferable - the code in the kafka container which does the some thing is even more concise. i think there may be some chance that this transferable thing is going to make it into the project through one of the PR's that are doing database seeding (helpers around init-db.d
)
I misread. yes checking the files in the same directory is what i typically do also, and reference with relative path via:
from pathlib import Path
Path(__file__).parent / 'adjacent-folder' / 'the-file.ext'
All modified and coverable lines are covered by tests :white_check_mark:
Please upload report for BASE (
main@ec76df2
). Learn more about missing BASE report.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Path(__file__).parent
moved into start() the volume mapping bind!
@alexanderankin just take a look again when you have time, thanks
this is probably what id like to merge, lmk if this works for you:
https://github.com/testcontainers/testcontainers-python/compare/feature/mosquitto
this is probably what id like to merge, lmk if this works for you:
https://github.com/testcontainers/testcontainers-python/compare/feature/mosquitto
super! I see you added support also for Mosquitto 1.x, which is something I never used. I think it's good to have.
I think it's just good. Once merged I will rework my project to make use of the MosquittoContainer class and report back any possible issue. Thanks
if you want you can pip install into your project from the branch and do some testing before it is released as well
ok ill merge at some point today.
ok ill merge at some point today.
yeah I don't think I will manage to adapt my project that relies on MosquittoContainer fast enough. But next week I think I will have some time to do that and will report back
gonna merge because it modifies the poetry lock file and dont wanna have conflicts, still a chance to try it before it gets released
hi @alexanderankin , I'm trying to understand how to test an unreleased version of testcontainers-python. However I see that the CI/CD step 'Release Please / publish (push) ' is Skipped... are testcontainers-python artifacts published somewhere after every commit?
hi @alexanderankin , I'm trying to understand how to test an unreleased version of testcontainers-python. However I see that the CI/CD step 'Release Please / publish (push) ' is Skipped... are testcontainers-python artifacts published somewhere after every commit?
Never mind: I installed the main branch locally from git into my python path. So far so good. I have tested successfully the MosquittoContainer inside my pre-existing integration tests. I actually have a MosquittoContainerEnhanced class adding on top of MosquittoContainer the ability to 'watch' topics. All good so far! Watching for next release of testcontainers-python, thanks!
This PR is adding a new MosquittoContainer class that helps creating integration tests for MQTT clients. The MosquittoContainer class contains a bunch of methods to help with testing:
This PR lacks tests. I can add them if there is interest in this PR...