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

hey everyone, I am currently switching an older Spryker project from a self-built docker base to be

Options
U010DNAA3QW
U010DNAA3QW Posts: 55 🧑🏻‍🚀 - Cadet
edited October 2020 in Docker

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)?

Comments

  • U010DNAA3QW
    U010DNAA3QW Posts: 55 🧑🏻‍🚀 - Cadet
    Options

    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

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    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.

  • U010DNAA3QW
    U010DNAA3QW Posts: 55 🧑🏻‍🚀 - Cadet
    Options

    hey @ULYHPR789 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...

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    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.