Db module not loads dump correctly #3867

Open
ashgaliyev opened this Issue Dec 22, 2016 · 2 comments

Projects

None yet

3 participants

@ashgaliyev
ashgaliyev commented Dec 22, 2016 edited

What are you trying to achieve?

I try to load sql dump (5 mb), created by mysqldump command

What do you get instead?

Db module loads not all tables

Details

  • Codeception version: 2.2.7
  • PHP Version: PHP 7.0.14-2+deb.sury.org~trusty+1
  • Operating System: Linux vagrant-ubuntu-trusty-64 3.13.0-91-generic #
  • Installation type: Phar
class_name: AcceptanceTester
modules:
    enabled:
        - PhpBrowser:
            url: http://ts.vglocal/
        - \Helper\Acceptance
        - Db:
           dsn: 'mysql:host=localhost;dbname=ts_test'
           user: 'root'
           password: 'root'
           dump: tests/ts_test.sql
           populate: true

When I try to load by hands (populate: false) it works normally.

Maybe should add some extra option for Db module (e.g. unsafe: true) to load dump line by line how it presented here http://stackoverflow.com/questions/19751354/how-to-import-sql-file-in-mysql-database-using-php ?

@Naktibalda
Contributor

Please provide relevant parts of SQL dump - a table which is missing and surrounding tables (one before and one after missing table)

@davidjeddy
Contributor
davidjeddy commented Dec 22, 2016 edited

@ashgaliyev IIRC the CodeCeption SQL dump importer (that runs before each test to reset the DB) has a size limit. Over that limit the DB logic is not able to execute fast enough in preparation for the test execution.

Recommend using the SQL import for the DB structure and breaking the data into fixtures specific to each test / test group.

Could also try this when using large SQL dump files: http://codeceptionbdd.blogspot.com/2014/10/repopulation-of-database-using-mysql.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment