liip / liip/LiipTestFixturesBundle

[Bug]: keep_database_and_schema config is ignored it is always false with SQL Server

Open
#235 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
178
Forks
48
PR merge metrics
No merged PRs in 30d

Description

Preconditions
-------------------- --------------------------------- 
  Symfony                                               
-------------------- --------------------------------- 
  Version              6.3.1                            
  Long-Term Support    No                               
  End of maintenance   01/2024 (in +195 days)           
  End of life          01/2024 (in +195 days)           
-------------------- --------------------------------- 
  Kernel                                                
-------------------- --------------------------------- 
  Type                 App\Kernel                       
  Environment          dev                              
  Debug                true                             
  Charset              UTF-8                            
  Cache directory      ./var/cache/dev (7.7 MiB)        
  Build directory      ./var/cache/dev (7.7 MiB)        
  Log directory        ./var/log (535 KiB)              
-------------------- --------------------------------- 
  PHP                                                   
-------------------- --------------------------------- 
  Version              8.2.7                            
  Architecture         64 bits                          
  Intl locale          n/a                              
  Timezone             UTC (2023-07-20T09:00:53+00:00)  
  OPcache              false                            
  APCu                 false                            
  Xdebug               false                            
-------------------- --------------------------------- 
  LiipTestFixturesBundle
-------------------- --------------------------------- 
  Version 2.6.0
Steps to reproduce

Creating config file for liip.

# config/packages/test/liip_fixtures.yaml
liip_test_fixtures:
  keep_database_and_schema: true
Expected result

When I run the debug command it should say true. And when I run my test the bundle should not try to create the table and schemas.

php bin/console debug:config LiipTestFixturesBundle keep_database_and_schema

Current configuration for "liip_test_fixtures.keep_database_and_schema"
=======================================================================

true
Actual result

When I run my test LiipTestFixtureBundle try always to create the Table and Schema and Ignores my config.
I also run the command

php bin/console debug:config LiipTestFixturesBundle keep_database_and_schema

Current configuration for "liip_test_fixtures.keep_database_and_schema"
=======================================================================

false

Thes are my logs from the tests.

php -d memory_limit=4G vendor/bin/phpunit
-------------------- --------------------------------- 
Logs
-------------------- --------------------------------- 
PDOException: SQLSTATE[42000]: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Object is invalid. Extended properties are not permitted on 'dbo.[user].roles', or the object does not exist.

/var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:32
/var/www/html/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:46
/var/www/html/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:46
/var/www/html/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:46
/var/www/html/vendor/doctrine/dbal/src/Logging/Connection.php:50
/var/www/html/vendor/doctrine/dbal/src/Driver/Middleware/AbstractConnectionMiddleware.php:46
/var/www/html/vendor/symfony/doctrine-bridge/Middleware/Debug/Connection.php:74
/var/www/html/vendor/doctrine/dbal/src/Connection.php:1204
/var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php:106
/var/www/html/vendor/liip/test-fixtures-bundle/src/Services/DatabaseTools/ORMDatabaseTool.php:113

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the keep_database_and_schema value reported by debug:config, then inspect vendor/liip/test-fixtures-bundle/src/Services/DatabaseTools/ORMDatabaseTool.php around line 113 and reproduce with PHPUnit. Done means the configured value remains true and the fixture bundle does not recreate the SQL Server tables or schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, symfony
Domain
database, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.