improvement on Acceptance Tests

vaisakhpc
vaisakhpc Senior Developer Posts: 3 🧑🏻‍🚀 - Cadet

Hello Spryker community,I'm working on acceptance tests for a Spryker project and I'm looking for ways to optimize the test setup and iteration process. Currently, we need to run the following commands before each test run:

docker/sdk boot deploy.ci.acceptance.mariadb.yml -v &&
docker/sdk up -t -v &&
docker/sdk testing codecept fixtures &&
docker/sdk testing console queue:worker:start --stop-when-empty &&
docker/sdk cli composer dump-autoload -o -a --apcu

Followed by:

docker/sdk testing codecept run

or

docker/sdk testing codecept run -c codeception.acceptance.yml

The initial setup commands are time-consuming as they involve starting the Docker environment and preparing the test fixtures. This becomes especially problematic when we need to make changes to a test and rerun it, as we have to go through the entire setup process again.My questions are:

  1. Are there any ways to update test code or other related code without having to rerun the entire block of setup commands?
  2. Can we optimize this process to reduce the time spent on each test iteration?
  3. Are there any best practices or tools within the Spryker ecosystem to make this process more efficient?

Any insights or suggestions would be greatly appreciated. Thank you!

Answers

  • profuel
    profuel SSA Sprykee Posts: 76 🪐 - Explorer

    Hi, @vaisakhpc !

    I'm not sure if I got your question right, so will elaborate.

    What you described is a perfect flow for CI environment, where you have to run always all tests

    Usually, each test prepares all data for it, and thus could be rerun multiple times as a single entity.

    If you have several dependent ones, then I highly recommend you grouping them in a Cest file and still making sure that the preparation is done for the whole set of tests.

    Some hints for running tests:

    • use @group tag for methods and -g to run only this group
    • remove not needed folders from the codeception.acceptance.yml or even specify a direct path to the required folder. Make sure it contains its own configuration file.