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

Populator dont work properly #4247

Closed
bIbI4k0 opened this Issue May 24, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@bIbI4k0

bIbI4k0 commented May 24, 2017

What are you trying to achieve?

Import data to database via populator dont work properly. If I set option dump: true with option populator: <command> in config, populator works properly.
I think problem is here:
vendor/codeception/codeception/src/Codeception/Lib/DbPopulator.php:84:

        if (!$this->config['dump']) { // want  'populator' key? 
            codecept_debug("[Db] No dump file found. Skip loading the dump using the populator command.");
            return false;
        }

What do you get instead?

Data not imported to db.

Provide console output if related. Use -vvv mode for more details.

...
  [Db] No dump file found. Skip loading the dump using the populator command.
...

Details

  • Codeception version: 2.3.1
  • PHP Version: 7
  • Operating System: ubuntu 17.04
  • Installation type: Composer
  • Suite configuration:
class_name: AcceptanceTester
modules:
    enabled:
        - PhpBrowser:
            url: http://localhost/
        - \Helper\Acceptance
        - REST:
            depends: PhpBrowser
            url: http:/localhost/rest/
        - Db:
            dsn: 'mysql:host=localhost;dbname=test'
            user: root
            password: root
            populate: true
            populator: 'CURDIR=`pwd` && cd ./_data/db/ && ./importer.py && cd "$CURDIR"'
            cleanup: true
            reconnect: false

@Naktibalda Naktibalda added the Db label May 24, 2017

@DavertMik

This comment has been minimized.

Show comment
Hide comment
Member

DavertMik commented May 24, 2017

@brutuscat hm...

@brutuscat

This comment has been minimized.

Show comment
Hide comment
@brutuscat

brutuscat May 24, 2017

Contributor

@DavertMik I was under the assumption that the dump file must be present in order to actually use the populator. Otherwise what would you populate?
Maybe we should enforce it if the populator option has been set?

Contributor

brutuscat commented May 24, 2017

@DavertMik I was under the assumption that the dump file must be present in order to actually use the populator. Otherwise what would you populate?
Maybe we should enforce it if the populator option has been set?

@brutuscat

This comment has been minimized.

Show comment
Hide comment
@brutuscat

brutuscat May 24, 2017

Contributor

Or the opposite :) I think that if u use a wrapper script, the dump file might not be as useful?

Anyway, I just tried to give this continuation (e.g. load or not load a dump file) but one never knows how real users would end up using it :)

Contributor

brutuscat commented May 24, 2017

Or the opposite :) I think that if u use a wrapper script, the dump file might not be as useful?

Anyway, I just tried to give this continuation (e.g. load or not load a dump file) but one never knows how real users would end up using it :)

@brutuscat

This comment has been minimized.

Show comment
Hide comment
@brutuscat

brutuscat May 24, 2017

Contributor

@bIbI4k0 could you for the time being configure a dumb dump file? Example:

dump: /does/not/exist

That should do the trick for now, but I defer the decision to make it required or not to @DavertMik

Contributor

brutuscat commented May 24, 2017

@bIbI4k0 could you for the time being configure a dumb dump file? Example:

dump: /does/not/exist

That should do the trick for now, but I defer the decision to make it required or not to @DavertMik

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik May 24, 2017

Member

Looks like @bIbI4k0 uses a custom script to populate the database so he don't need a dump in this case.
Also you can specify a database dump inside populator command without using dump config option

Member

DavertMik commented May 24, 2017

Looks like @bIbI4k0 uses a custom script to populate the database so he don't need a dump in this case.
Also you can specify a database dump inside populator command without using dump config option

@brutuscat

This comment has been minimized.

Show comment
Hide comment
@brutuscat

brutuscat May 24, 2017

Contributor

@DavertMik so we should "ignore" the dump option in the case that the populate and the populator are both set. Is that what you are implying?

Contributor

brutuscat commented May 24, 2017

@DavertMik so we should "ignore" the dump option in the case that the populate and the populator are both set. Is that what you are implying?

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik May 24, 2017

Member

Yes, If populator is set dump is optional...
Could you prepare a patch?

Member

DavertMik commented May 24, 2017

Yes, If populator is set dump is optional...
Could you prepare a patch?

DavertMik added a commit that referenced this issue May 25, 2017

@DavertMik DavertMik closed this in #4253 May 27, 2017

DavertMik added a commit that referenced this issue May 27, 2017

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