[Db] Change to disconnect on initialise breaks tests where Db is used in _beforeSuite
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 38/100
Línea de trabajo
Empieza inspeccionando la inicialización de la conexión del módulo Db y el código auxiliar que ejecuta SQL en _beforeSuite, usando la configuración de reconnect mostrada para reproducir el fallo. Se considera terminado cuando la configuración de la suite puede ejecutar su SQL de la fila de control sin una conexión terminada cuando reconnect está habilitado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- PHP
- Estrellas
- 23
- Forks
- 31
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin 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.
Más de Codeception/module-db
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
Codeception/module-db#87 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Codeception/module-db#85 ·
-
Make optional the auto-erase of the records, added by `haveInDatabase()`Posiblemente ocupada @iliayatsenko la tomó hace 723 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Codeception/module-db#68 · 1 comentario ·
-
Fix a confusion between 'cleanup' and 'skip_cleanup_if_failed' configuration paramsPosiblemente ocupada @iliayatsenko la tomó hace 723 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Codeception/module-db#67 ·
-
inserting null on an autoincrement primary key prevents cleanupPosiblemente ocupada @jtopenpetition la tomó hace 1261 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
Codeception/module-db#58 ·
Todos los issues de Codeception/module-db
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
taskforcesh/bullmq#5238 ·
Los mantenedores suelen responder en 1 día
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itPosiblemente ocupada @bfs2021 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Automattic/jetpack#55517 ·
Los mantenedores suelen responder en 1 día
-
Address edit modal: what the customer types before the fields load is reset to the saved valueAbiertoMajor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
PrestaShop/ps_onepagecheckout#245 ·
Los mantenedores suelen responder en 1 día
-
wpvc
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
10up/ElasticPress#4420 ·
Los mantenedores suelen responder en 1 día