I'm still trying to get a handle on running tests,...
# docker
r
I'm still trying to get a handle on running tests, they kinda work with the deploy.ci.*.yml but they dont with dev profile. I can't figure out what flag I'm missing. Or even better get them working through PHPStorm
I'm trying to run a single suite and it fails:
Copy code
╭─/data | Store: FI | Env: docker.dev | Debug: (.) | Testing: (X)
╰─$ codecept run -c tests/PyzTest/Zed/Product
Codeception PHP Testing Framework v4.1.22
Powered by PHPUnit 9.5.9 by Sebastian Bergmann and contributors.

PyzTest\Zed\Product.Business Tests (6) ----------------------------------------------------------------------------------------------------------------------------------------------------
E ProductAbstractManagerTest: Create product abstract should create product abstract and trigger plugins 
E ProductAbstractManagerTest: Create product abstract should create product abstract and trigger plugins (0.11s)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In ConnectionFactory.php line 42:
                             
  Unable to open connection  
                             

In PdoAdapter.php line 82:
                                 
  Unable to open PDO connection  
                                 

In PdoConnection.php line 82:
                                             
  SQLSTATE[HY000] [2002] Connection refused
g
I get a similar error. it seems the db isn’t created for some reason. maybe I’m running the wrong command?
r
The group notation e.g.
codecept run -g Discount
does work 🤔
some configuration magic still missing to get the stuff working through PHPStorm. Looks like it doesn't see the environment variables hence the above errors
I got them running but it wasn't easy 😄 hopefully I'm just missing something. Simply running Codcept with the cli docker interpreter doesnt work because the envs are missing (I suppose the correct one are in
./docker/deployment/default/env/cli/*
). Adding them to the test execution run environment works, although you need to set the db host to something it can resolve (like 172.17.0.1) and tweak the SPRYKER_BROKER_CONNECTIONS variable to make sure it resolves codeception also supports reading env files directly, but sadly it does not support
getenv
which is used all over the place. This could be hacked to make work though.
🙌 1