Skip to content

Feature: add MosquittoContainer (mqtt) #568

Closed

Description

@f18m

What are you trying to do?

I'm writing integration tests for a Python project (https://github.com/f18m/ha-alarm-raspy2mqtt) that publishes messages to an MQTT broker.
I would like to use testcontainers to create the integration tests and noticed that there is no specialization available for MQTT and for its most-used broker which is Mosquitto.
So I'd like to propose the addition of a MosquittoContainer class to testcontainers-python.

Why should it be done this way?

There are a number of helpers that could be provided out of the box to ease integration testing of MQTT applications.

I can provide a PR to add my own MosquittoContainer implementation if there is interest by the project maintainers...

Activity

  1. alexanderankin commented on May 11, 2024

    @alexanderankin
    Member

    sure, i cant promise it will be a priority but we've been merging a bunch of these. the hivemq seems to be king in the enterprise world with this so id say if we do merge a mqtt one it has to be this one:

    https://java.testcontainers.org/modules/hivemq/

  2. f18m commented on May 11, 2024

    @f18m
    ContributorAuthor

    hi @alexanderankin ,
    thanks for the reply. Actually I've been developing the specialization of DockerContainer for the Mosquitto broker (https://mosquitto.org/) which is a very popular choice at least in home automation environment... I could contribute that if there's interest...

  3. alexanderankin commented on May 14, 2024

    @alexanderankin
    Member

    hm, i suppose we could have a module with multiple classes in it

  4. f18m commented on Jun 5, 2024

    @f18m
    ContributorAuthor

    hi @alexanderankin ,
    I opened PR #599 to propose my implementation of a MosquittoContainer class.
    Several usage examples can be found at https://github.com/f18m/rpi2home-assistant/blob/main/tests/test_integration.py

  5. changed the title [-]Feature: add MosquittoContainer[/-] [+]Feature: add MosquittoContainer (mqtt)[/+] on Jul 4, 2024
  6. f18m commented on Jan 21, 2025

    @f18m
    ContributorAuthor

    Closing this ticket as MosquittoContainer has been integrated as part of PR #599 since version 4.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions