What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi all... Topic: Demo-shop b2b testing database When i start to test functions connecting to the d

U0432RV4J8P
U0432RV4J8P Posts: 12 πŸ§‘πŸ»β€πŸš€ - Cadet
edited November 2022 in Help

Hi all...

Topic: Demo-shop b2b testing database

When i start to test functions connecting to the database is refused.
What is totally clear, cause testing environment credentials are used.
But the database trying to reach is not created yet.
When is the "testing" databse created or how could i create the testing database?

Thx in advance, Oli

Comments

  • U031G802S74
    U031G802S74 Posts: 29 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UP951K4L9 Someone who has the same problem like us!

  • U031G802S74
    U031G802S74 Posts: 29 πŸ§‘πŸ»β€πŸš€ - Cadet

    I know only to rebuild the project for test environment. i really hate that approach because maybe you need the automated test while developing and dont want to wait 20minutes for the project to rebuild overtime.

  • U0432RV4J8P
    U0432RV4J8P Posts: 12 πŸ§‘πŸ»β€πŸš€ - Cadet

    I am already starting my containers in testing mode. But no testing database is created

  • U03TREBSX44
    U03TREBSX44 Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    I’m having the same issue, any help would be appreciated. seems like there should be a step or console command somewhere to populate the test database?

  • U0432RV4J8P
    U0432RV4J8P Posts: 12 πŸ§‘πŸ»β€πŸš€ - Cadet

    At least some documentation or advice in the docs how to accomplish that, at the best some console command.

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    got the same problem
    did you find out anything?
    also read up the documentation in testing mode and so on, but didn't find any hint on how the test database is created

    how to you rebuild the test env? bootstrap from which deploy.yml? or do you use the install with testing.yml?!

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    docker/sdk cli -t vendor/bin/install --recipe=testing

    this aborts because it cannot reach the db...

  • U03SN9552JC
    U03SN9552JC Posts: 78 πŸ§‘πŸ»β€πŸš€ - Cadet

    For the purpose of anybody who sees this, try

    docker/sdk console -x -t 
    codecept run -g MyModuleTestGroup
    
  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    I don't get it, how will this install the testing db?

  • U03SN9552JC
    U03SN9552JC Posts: 78 πŸ§‘πŸ»β€πŸš€ - Cadet

    For testing with sprykers b2c DB or one that you have spun up?

  • U03SN9552JC
    U03SN9552JC Posts: 78 πŸ§‘πŸ»β€πŸš€ - Cadet

    If you want to use another DB to test with you can just use

          - Db:
             dsn: 'mysql:host=localhost;dbname=testdb'
             user: 'root'
             password: ''
    
  • U03SN9552JC
    U03SN9552JC Posts: 78 πŸ§‘πŸ»β€πŸš€ - Cadet

    Inside the codeception.yml

  • U03SN9552JC
    U03SN9552JC Posts: 78 πŸ§‘πŸ»β€πŸš€ - Cadet

    But there's some kind of issue using the -c variable in the command. And it has to be run via the cli

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    the testing db is never created within testing mode without creating a separate project

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    but testing mode tries to connect to a testing db which is not there

  • U03SN9552JC
    U03SN9552JC Posts: 78 πŸ§‘πŸ»β€πŸš€ - Cadet

    Is there an error message I can look at?

  • U03SN9552JC
    U03SN9552JC Posts: 78 πŸ§‘πŸ»β€πŸš€ - Cadet

    I'm not sure Ive seen this example although I've so far ran into many more

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    sorry I am working with a different project now that does not use the sdk

  • U03SN9552JC
    U03SN9552JC Posts: 78 πŸ§‘πŸ»β€πŸš€ - Cadet

    Awesome hope its going well!