hey everyone, I am currently switching an older Sp...
# docker
w
hey everyone, I am currently switching an older Spryker project from a self-built docker base to be using the official docker/sdk from Spryker. I have now some problems understanding how docker/sdk handles the
testing
environment... In our existing codebase, we switched APPLICATION_ENV between
development
(for development) and
devtest
(for running unit + integration tests), this included letting the
devtest
run on a different database, queue virtual host, etc... As far as I can see, docker/sdk keeps the environment to e.g.
docker.dev
and just enabled some kind of "testing" mode when running
docker/sdk testing
... how exactly is that working, how can I import testdata there and isolate this from the normal docker.dev env (database content, etc)?
maybe I just misunderstand this
docker/sdk testing
, what is the purpose of it? I think I maybe just misunderstand it, and should be using a separate deploy.devtest.yml to run my tests
h
Hello Rene, If you want to use isolated env for testing, you can use different environment and different deploy.yml for sure. However you can configure an environment that can be used for dev and testing at the same time. But all the data will be shared as you assumed. It would work if you have all tests isolated (or based on random, or cleanup after execution) and can be run multiple times in the same database.
docker/sdk testing
or
docker/sdk run -t
just runs webdriver and restart all apps with
SPRYKER_TESTING_ENABLE=1
env variable that you can use in configuration.
w
hey @high-pencil-62400 thank you very much for the info! Unfortunately, with our current setup, it is not possible to run the tests on the development database, as our tests assume a clean database, and for easy development we need an anonymized production-db copy. Is there any other solution you could think of, besides using a different deploy.yml for testing? Because doing this would mean I would have to completely shutdown the environment, bootstrap it on the deploy.testing.yml file from new, start it, run the tests, and afterwards destroy it again... mhmm...
h
You can go alternative way if it is possible to use SPRYKER_TESTING_ENABLE and switch database/queue/redis database names. However in this case you must create databases by additional scripts.