testcontainers / testcontainers/testcontainers-python

Allow option to keep the containers alive

オープン
#109 コメント 18 件 リアクション 23 件 担当者 0 名 GitHub で見る

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

🐣 good first issue 🤝 contributions are welcome 🛟 help wanted
主要言語
Python
スター
2.3k
フォーク
386
平均マージ
4時間 40分
マージ済み PR(30日)
1

説明

It would be nice to keep the docker containers alive for speeding up the test runs. Now, in every test run containers are re-created and can't keep them alive since this block

  def __del__(self):
        """
        Try to remove the container in all circumstances
        """
        if self._container is not None:
            try:
                self.stop()
            except:  # noqa: E722
                pass

removes containers when the instance variable is deleted (when the program terminates) and I cannot override it because this also runs without using with as block.

I don't want my Mysql container to be recreated everytime. I am running tests very frequently and I am waiting couple seconds everytime. Pretty annoying.

I can make a small PR if that makes sense?

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

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

はじめの一歩

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

調査の方向性

まず del メソッド周辺の testcontainers/core/container.py を読み、with ブロックの外での使用も含めて、テスト実行の終了時にコンテナがどのように停止されるかを追跡します。コンテキスト管理されるコンテナと直接作成されるコンテナの両方について、オプションのライフサイクル動作を定義します。完了の条件は、呼び出し側が自動クリーンアップなしで実行間に MySQL コンテナを存続させられることです。

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

評価

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

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

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