LiipTestFixturesBundle icon indicating copy to clipboard operation
LiipTestFixturesBundle copied to clipboard

Option memory of SQLite not working

Open lukepass opened this issue 6 years ago • 4 comments

Hello, in Symfony 3.4, I tried using the memory option in order to make my tests faster but an error occurred:

1) Tests\AppBundle\Controller\DefaultControllerTest::testIndex
copy(mydb): failed to open stream: No such file or directory

My test config is the following:

imports:
    - { resource: config_dev.yml }

framework:
    test: ~
    session:
        storage_id: session.storage.mock_file
        name: MOCKSESSION
    profiler:
        collect: false

web_profiler:
    toolbar: false
    intercept_redirects: false

swiftmailer:
    disable_delivery: true

liip_functional_test:
    cache_db:
        sqlite: liip_functional_test.services_database_backup.sqlite

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   pdo_sqlite
                memory:   true
security:
    firewalls:
        main:
            http_basic: ~

Thank you.

lukepass avatar Jan 10 '19 11:01 lukepass

Can you remove sqlite: liip_functional_test.services_database_backup.sqlite and try again? I don't know if backups and memory: true are compatible.

alexislefebvre avatar Jan 10 '19 12:01 alexislefebvre

I would like to keep the cached version because it's handy to just replace the database with all the fixtures.

lukepass avatar Jan 10 '19 16:01 lukepass

Is there a way to make this work manually? Thanks.

lpassini-mz avatar Jan 16 '19 14:01 lpassini-mz

This issue could be related to this one:

https://github.com/doctrine/dbal/issues/2901

Maybe if the option was added it could work?

lukepass avatar Jul 23 '19 10:07 lukepass