Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cache_db with paratest or fastest? #576

Open
lpassini-mz opened this issue Jan 16, 2019 · 3 comments
Open

Use cache_db with paratest or fastest? #576

lpassini-mz opened this issue Jan 16, 2019 · 3 comments

Comments

@lpassini-mz
Copy link

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
Copy link
Author

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!                                        
                                                                                   

@lukepass
Copy link

lukepass commented Jun 6, 2019

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!

@alexislefebvre alexislefebvre transferred this issue from liip/LiipFunctionalTestBundle Jan 13, 2021
@alexislefebvre alexislefebvre transferred this issue from liip/LiipTestFixturesBundle Jan 13, 2021
@alexislefebvre
Copy link
Collaborator

We dropped the support of paratest in #560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants