LiipFunctionalTestBundle icon indicating copy to clipboard operation
LiipFunctionalTestBundle copied to clipboard

Use cache_db with paratest or fastest?

Open lpassini-mz opened this issue 6 years ago • 3 comments

Is it possible to do it? I tried without adding the path to the sqlite database but it didn't work as expected:

SQLSTATE[HY000]: General error: 11 database disk image is malformed"). (500 Internal Server Error)

Maybe it's related to my other issue about cache_db and memory filesystem?

Thanks.

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

Nevermind I got it working with fastest:

parameters:
    doctrine.dbal.connection_factory.class: Liuggio\Fastest\Doctrine\DBAL\ConnectionFactory

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
                path:     "%kernel.cache_dir%/__DBNAME__.db"

With this command: find tests -name "*Test.php" | ./vendor/liuggio/fastest/fastest "./vendor/bin/simple-phpunit {};"


Paratest has the following problems:

  1. compatibility error
PHP Fatal error:  Declaration of Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time): void must be compatible with PHPUnit\Framework\TestListener::addError(PHPUnit\Framework\Test $test, Exception $e, $time) in /mysite/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerForV7.php on line 27
  1. The paratest:run doesn't run in test env, I had to specify it and it just generates a bunch of db without running the suite:
sf paratest:run --env=test 
Cleaning old dbs in /mysite/var/cache/test ...
Creating Schema in /mysite/var/cache/test ...

 !                                                                                 
 ! [CAUTION] This operation should not be executed in a production environment!    
 !                                                                                 

 Creating database schema...

                                                                                   
 [OK] Database schema created successfully!                                        
                                                                                   

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

Hello! Any news on this matter? Unfortunately it's impossible to get paratest working. This is my command:

./vendor/bin/paratest -p8 --functional --phpunit='./vendor/bin/simple-phpunit' (Symfony 3.4)

Thanks!

lukepass avatar Jun 06 '19 15:06 lukepass

We dropped the support of paratest in #560

alexislefebvre avatar Feb 19 '21 11:02 alexislefebvre