Calling Developers!
We are reenergizing our code contribution process! Learn More

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

Options
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
    Options

    @UP951K4L9 Someone who has the same problem like us!

  • U031G802S74
    U031G802S74 Posts: 29 🧑🏻‍🚀 - Cadet
    Options

    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
    Options

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

  • U03TREBSX44
    U03TREBSX44 Posts: 9 🧑🏻‍🚀 - Cadet
    Options

    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
    Options

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

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 🧑🏻‍🚀 - Cadet
    Options

    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
    Options

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

    this aborts because it cannot reach the db...

  • U03SN9552JC
    U03SN9552JC Posts: 78 🧑🏻‍🚀 - Cadet
    Options

    For the purpose of anybody who sees this, try

    docker/sdk console -x -t 
    codecept run -g MyModuleTestGroup
    
  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 🧑🏻‍🚀 - Cadet
    Options

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

  • U03SN9552JC
    U03SN9552JC Posts: 78 🧑🏻‍🚀 - Cadet
    Options

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

  • U03SN9552JC
    U03SN9552JC Posts: 78 🧑🏻‍🚀 - Cadet
    Options

    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
    Options

    Inside the codeception.yml

  • U03SN9552JC
    U03SN9552JC Posts: 78 🧑🏻‍🚀 - Cadet
    Options

    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
    Options

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

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 🧑🏻‍🚀 - Cadet
    Options

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

  • U03SN9552JC
    U03SN9552JC Posts: 78 🧑🏻‍🚀 - Cadet
    Options

    Is there an error message I can look at?

  • U03SN9552JC
    U03SN9552JC Posts: 78 🧑🏻‍🚀 - Cadet
    Options

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

  • U01LLUGR1F0
    U01LLUGR1F0 Posts: 60 🧑🏻‍🚀 - Cadet
    Options

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

  • U03SN9552JC
    U03SN9552JC Posts: 78 🧑🏻‍🚀 - Cadet
    Options

    Awesome hope its going well!