testcontainers / testcontainers/testcontainers-java
Implement withDatabase() in MSSQLServerContainer
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
説明
Hello,
First of all, thanks for your great work!
I have a requirement to set READ_COMMITED_SNAPSHOT ON in the MSSQLServer database, and due to a MSSQLServer limitation that can't be applied to the default master database:
ALTER DATABASE master SET READ_COMMITTED_SNAPSHOT ON
throws
SQL Error [5058] [S0002]: Option 'READ_COMMITTED_SNAPSHOT' cannot be set in database 'master'.
This setting prevents read locks from being created and is the default setting in AzureSQL DB - in my case with testContainers my integration tests intermittently fail with CouldNotAquireLockException because of that.
For this to work OOTB for me I think the MSSQLServerContainer class would have to have the withDatabaseName() method implemented, and add the logic for creating the database before letting the application code connect to it.
I managed to get by by subclassing the MSSQLServerContainer, but it would be great to have it OOTB.
I can provide a PR if that's helpful.
Thanks!
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず MSSQLServerContainer を読み、既存のデータベース名設定パターンを探します。アプリケーション接続の前にコンテナがどのように初期化されるかを追跡し、関連する統合テストを実行します。withDatabaseName() が master ではないデータベースを作成して使用し、要求された設定を利用できるようになれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, java
- 領域
- databases, testing
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100