dmaicher / doctrine-test-bundle

Symfony bundle to isolate your app's doctrine database tests and improve the test performance
MIT License
1.08k stars 61 forks source link

Extra databases not created #304

Closed greggailly closed 2 months ago

greggailly commented 2 months ago

Hi, I'm using this bundle with three doctrine connections configured as so:

doctrine:
    dbal:
        connections:
            default:
                url: '%env(resolve:DATABASE_URL)%'
                profiling_collect_backtrace: '%kernel.debug%'
                use_savepoints: true
            dwh:
                url: '%env(resolve:DATABASE_DWH_URL)%'
                use_savepoints: true
            ods:
                url: '%env(resolve:DATABASE_ODS_URL)%'
                use_savepoints: true

dama_doctrine_test_bundle looks like so:

when@test:
    dama_doctrine_test:
        enable_static_connection: true
        enable_static_meta_data_cache: true
        enable_static_query_cache: true

The default connection database is correctly create with all tables etc.. but not the other databases which results in SQL error during tests. Should my config be different to make this work ?

If I create and update the schemas by hand (or via symfony console) correctly the tests suit runs without issues afterwards but it would be nice not to have to do this.

Thanks !