testcontainers / testcontainers/testcontainers-python

Feature: mongodb as replica set (single node)

Offen
#640 6 Kommentare 8 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

🤝 contributions are welcome 🚀 enhancement
Vorherrschende Sprache
Python
Sterne
2.3k
Forks
386
Ø Merge
4 Std. 40 Min.
Gemergte PRs (30 T.)
1

Beschreibung

What are you trying to do?

Unit testing of Mongodb transactions.

Why should it be done this way?

mongomock can often be used in unit testing of mongodb-related functionality. It's faster and easier than using docker containers for such tests. But perhaps one of the most important scenarios in which mongomock is not applicable is testing the functionality using MongoDB transactions. At the moment, transaction mocking is not implemented in mongomock. But even if support for this was implemented there, such sensitive functionality (using transactions) would like to be checked "naturally". But as you know, transactions are possible only for replica sets, which the default MongoDB container is not. It is possible to configure mongodb as a replicaset (although with one node, but I think this is not critical for testing).

If you find this functionality useful here in the public, I can provide a PR (either as a separate Mongodb container, or extend the current MongoDbContainer with configuration options). What do you think about it?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem aktuellen MongoDbContainer und der standardmäßigen MongoDB-Containerkonfiguration. Prüfe, wie ein einzelner Knoten als replica set für containerbasierte Tests konfiguriert werden kann, und verifiziere anschließend, dass MongoDB-Transaktionen über den resultierenden Container ausgeführt werden können. Als abgeschlossen gilt die Aufgabe, wenn Benutzer den Container zum Testen der Transaktionsfunktionalität verwenden können, ohne ein externes replica set zu konfigurieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, mongodb, python
Bereich
database, testing
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.