[Db] Change to disconnect on initialise breaks tests where Db is used in _beforeSuite
まだ誰も着手していません。
評価
調査の方向性
まず、Db モジュールの接続初期化と、_beforeSuite で SQL を実行するヘルパーコードを調べ、示されている reconnect 設定を使って失敗を再現します。reconnect が有効な場合でも、スイートのセットアップが接続を終了させずに制御行の SQL を実行できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What are you trying to achieve?
A helper runs code to modify the database in _beforeSuite in order to add control rows before any tests are run.
What do you get instead?
The code crashes upon trying to run SQL as the connection has been terminated. This was new behaviour added by https://github.com/Codeception/Codeception/commit/5e2c999df9eae7ff4f802eb801940f87088f0fc7
Easiest fix would be to create a public method on Db to ensure that the connection is open before running code if config has reconnect. The quickest route would just be to make connect() public.
Details
- Codeception version: 2.2.11
- PHP Version: 7.0.19
- Operating System: Ubuntu 16.04 LTS
- Installation type: Composer
- List of installed packages (
composer show) not relevant - Suite configuration:
config:
Db:
dsn: 'mysql:host=localhost;dbname=XXXX;charset=utf8'
user: 'root'
password: ''
dump: 'tests/_data/schema.sql'
populate: true
cleanup: false
reconnect: true
- 主要言語
- PHP
- スター
- 23
- フォーク
- 31
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/module-db のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
Codeception/module-db#87 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
Codeception/module-db#85 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-db#68 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Codeception/module-db#67 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
Codeception/module-db#58 ·
Codeception/module-db の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
hector-jewell/food-delivery-system-for-restaurant-using-php#1311 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Sylius/SyliusGridBundle#501 ·