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

Hey, I am trying to add a testing database to my docker setup. What is the right way to do so? I tri

Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

Hey, I am trying to add a testing database to my docker setup. What is the right way to do so? I tried adding a new β€œtesting” region in the deploy file, but that doesn’t seem right and it doesn’t work anyway. Thanks!

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    Do you want to create dedicated store for the testing?

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

    Not neccessarily, I just want a seperate database for testing.

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited January 2020

    There are 2 possible options:
    1. Separate store. Should work OOTB. But it will need
    β€’ Changing deploy.yml file by adding region, group, endpoints. Also pointing right store in docker:testing:store:
    β€’ Copying demo data (in csv files)
    β€’ Adding store in config/Shared/stores.php
    2. Overriding database only for test mode. Not OOTB. But it can be done by managing of nginx and env files.

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    Also I see 3 option:
    separate deploy.yml file for testing. But it makes impossible to use testing and dev mode at the same time. So docker/sdk boot {file} && docker/sdk up each time you need to switch the mode.

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    What is the reason you want separate database for testing?

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

    Thanks! I just assumed that I need a seperate database since the devtest_DE config specifies a β€œDE_devtest_zed” database πŸ˜…

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    devtest_DE does not used in docker SDK at all. In docker setup only config_docker is used.

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

    Maybe it’s because I’m still on the 201907.0 b2c-demoshop, but the devtest-DE config seems to be read when running codeception commands inside the cli

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    For running tests with Docker SDK you need:

    docker/sdk testing -> and then codecept ...

    docker/sdk testing codecept run 
    
  • Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thats what I am doing, but when I change config values in devtest_DE, for example ZED_DB_DATABASE, it affects the tests.

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

    I’ll try to setup a clean project using the latest release, maybe I just broke something

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    It should not get into devtest environment.

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    vendor/spryker/spryker/Bundles/Testify/tests/SprykerTest/Shared/Testify/_support/Helper/Environment.php

    Do you have the following code inside?

            if (getenv('SPRYKER_TESTING_ENABLED')) {
                return getenv('APPLICATION_ENV');
            }
    
  • Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet

    I just installed the new release of the b2c-demoshop and both, my old and the new shop, are missing the entire vendor/spryker/spryker directory. However, I have a Environment.php in tests/PyzTest/Shared/Testify/_support/Helper/, but the code you mentioned is not present there.

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

    My colleague is also missing the directory in his b2b shop

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    it seems you need to update testify module to have possibility to run tests in docker.
    Use the last one please to check.

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    composer update spryker/testify

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    It seems that does not help. I need time to figure out why that code was missed.

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    Wait. I found the file:

    tests/SprykerTest/Shared/Testify/_support/Helper/Environment.php

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    And code is there. So just update testify

  • Posts: 15 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited January 2020

    Exactly, was just about to say that the file is just in another location now. But it wasn’t there before I updated testify, so thanks a lot! 😁

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thanks for feedback.

Welcome!

It looks like you're new here. Sign in or register to get started.