blt icon indicating copy to clipboard operation
blt copied to clipboard

PHPUnit Env Variables of "blt tests:phpunit:run" Is Incorrectly Overridden In Command "blt tests"

Open yyss8 opened this issue 4 years ago • 0 comments

Describe the bug When running the command blt tests, the PHPunit env variable of blt tests:phpunit:run is being overridden by the other command tests:drupal:phpunit:run and thus preventing the custom env variables in the phpunit.xml file from being respected in the tests.

To Reproduce

  1. Create a phpunit.xml with custom environment variables, for example, use mysql database instead of sqlite.
  2. Run the command blt tests

Expected behavior The phpunit command should be clean without all the inline environment variables overrides. image

Detailed error output See incorrectly assigned inline variables on the screenshot. image I believe that's because of they are sharing the same command file.

Additional context We temporarily disabled the tests:drupal:phpunit:run command from being run in blt tests by adding

disable-targets:
  tests:
    drupal: true

in the blt.yml file.

Another solution would be to apply the following PR as patch to reset the env properties when running tests:phpunit:run command.

https://github.com/acquia/blt-drupal-test/pull/2

yyss8 avatar Feb 23 '21 18:02 yyss8