testcontainers / testcontainers/testcontainers-python

Feature: mongodb as replica set (single node)

Aperta
#640 6 commenti 8 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

🤝 contributions are welcome 🚀 enhancement
Lingua principale
Python
Stelle
2.3k
Fork
386
Merge medio
4h 40m
PR unite (30g)
1

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con l'attuale MongoDbContainer e la configurazione predefinita del container MongoDB. Verifica come configurare un replica set a nodo singolo per i test basati su container, quindi verifica che le transazioni MongoDB possano essere eseguite tramite il container risultante. Il lavoro è completato quando gli utenti possono usare il container per testare le funzionalità delle transazioni senza configurare un replica set esterno.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, mongodb, python
Ambito
database, testing
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.