pim-community-dev icon indicating copy to clipboard operation
pim-community-dev copied to clipboard

Use APP_DEBUG env var for test Kernel

Open jmleroux opened this issue 2 years ago • 1 comments

This PR allows you to run integration tests without using the cache container. It can be useful when working on services DI definition by launching the integration test. Without this PR, you have to clear the cache each time you modify the DI, which is a real pain... :cry:

You can activate the debug several ways:

By adding the env var in the Docker command line:

APP_ENV=test docker-compose run --rm -e APP_DEBUG=1 php vendor/bin/phpunit src/Akeneo/..../MyTestIntegration.php

Or by adding the APP_DEBUG in a local test env file named .env.test.local

jmleroux avatar Sep 12 '22 08:09 jmleroux

  1. By activating this variable, a test suite will leak. At the end, you will have a memory limit issue. So, even if it's deactivated by default, I'm wondering if it worths the time saved. You can easily lose several hours on a memory leak due to the activation of this variable.

  2. You are not in the same condition as your CI, which was the original intent of our test DX.

  3. I'm afraid no people except you will use it, because it's complex to setup and not documented

  4. There are other test cases, meaning this is only partially implemented

ahocquard avatar Sep 12 '22 08:09 ahocquard