testcontainers / testcontainers/testcontainers-python
Feature: mongodb as replica set (single node)
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 2.3k
- Forks
- 386
- Merge medio
- 4 h 40 min
- PR fusionados (30 d)
- 1
Descripción
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?
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el MongoDbContainer actual y la configuración predeterminada del contenedor de MongoDB. Comprueba cómo se puede configurar un replica set de un solo nodo para pruebas basadas en contenedores y, después, verifica que las transacciones de MongoDB puedan ejecutarse mediante el contenedor resultante. Se considera terminado cuando los usuarios puedan utilizar el contenedor para probar la funcionalidad de transacciones sin configurar un replica set externo.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- docker, mongodb, python
- Área
- database, testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100