testcontainers / testcontainers/testcontainers-python

Feature: mongodb as replica set (single node)

オープン
#640 コメント 6 件 リアクション 8 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

🤝 contributions are welcome 🚀 enhancement
主要言語
Python
スター
2.3k
フォーク
386
平均マージ
4時間 40分
マージ済み PR(30日)
1

説明

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?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

現在の MongoDbContainer とデフォルトの MongoDB コンテナー設定から始めます。コンテナーベースのテスト用に単一ノードの replica set を構成する方法を確認し、その結果得られるコンテナーを通じて MongoDB トランザクションを実行できることを検証します。ユーザーが外部の replica set を構成せずに、トランザクション機能のテストにコンテナーを使用できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
docker, mongodb, python
領域
database, testing
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。