Hey, I am trying to add a testing database to my d...
# docker
h
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!
h
Do you want to create dedicated store for the testing?
h
Not neccessarily, I just want a seperate database for testing.
h
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.
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.
What is the reason you want separate database for testing?
h
Thanks! I just assumed that I need a seperate database since the devtest_DE config specifies a “DE_devtest_zed” database 😅
h
devtest_DE does not used in docker SDK at all. In docker setup only
config_docker
is used.
h
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
h
For running tests with Docker SDK you need:
docker/sdk testing
-> and then
codecept ...
Copy code
docker/sdk testing codecept run
h
Thats what I am doing, but when I change config values in devtest_DE, for example ZED_DB_DATABASE, it affects the tests.
I’ll try to setup a clean project using the latest release, maybe I just broke something
h
It should not get into devtest environment.
vendor/spryker/spryker/Bundles/Testify/tests/SprykerTest/Shared/Testify/_support/Helper/Environment.php Do you have the following code inside?
Copy code
if (getenv('SPRYKER_TESTING_ENABLED')) {
            return getenv('APPLICATION_ENV');
        }
h
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.
My colleague is also missing the directory in his b2b shop
h
it seems you need to update testify module to have possibility to run tests in docker. Use the last one please to check.
composer update spryker/testify
It seems that does not help. I need time to figure out why that code was missed.
Wait. I found the file: tests/SprykerTest/Shared/Testify/_support/Helper/Environment.php
And code is there. So just update testify
h
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! 😁
h
Thanks for feedback.