Hello All! I am trying to run docker testing: ```...
# docker
s
Hello All! I am trying to run docker testing:
Copy code
docker/sdk testing codecept run -c tests/PyzTest/Zed/Tax/codeception.yml
and I get these errors:
Copy code
Notice: Undefined index: ZED_DB_ENGINE in /data/config/Shared/config_propel.php on line 14
Notice: Undefined index: ZED_DB_HOST in /data/config/Shared/config_propel.php on line 15
Notice: Undefined index: ZED_DB_PORT in /data/config/Shared/config_propel.php on line 16
Notice: Undefined index: ZED_DB_DATABASE in /data/config/Shared/config_propel.php on line 17
Notice: Undefined index: ZED_DB_USERNAME in /data/config/Shared/config_propel.php on line 39
Notice: Undefined index: ZED_DB_PASSWORD in /data/config/Shared/config_propel.php on line 40
Notice: Undefined index: ZED_DB_USERNAME in /data/config/Shared/config_propel.php on line 47
Notice: Undefined index: ZED_DB_PASSWORD in /data/config/Shared/config_propel.php on line 48
Notice: Undefined index: ZED_DB_ENGINE in /data/config/Shared/config_propel.php on line 85
Notice: Undefined index: ZED_DB_ENGINE in /data/config/Shared/config_propel.php on line 90
Notice: Undefined index:  in /data/config/Shared/config_propel.php on line 91
Notice: Undefined index:  in /data/config/Shared/config_propel.php on line 92

PyzTest\Zed\Tax.Presentation Tests (5) ---------------------------------------------------------------------------------------------------------------
E TaxRateCreateCest: Test create valid tax rate should show success message 
------------------------------------------------------------------------------------------------------------------------------------------------------

Fatal error: Uncaught Error: Call to a member function closeConnections() on null in /data/vendor/propel/propel/src/Propel/Runtime/Propel.php:190
Stack trace:
#0 /data/vendor/spryker/propel/tests/SprykerTest/Shared/Propel/_support/Helper/ConnectionHelper.php(55): Propel\Runtime\Propel::closeConnections()
#1 /data/vendor/codeception/codeception/src/Codeception/Subscriber/Module.php(66): SprykerTest\Shared\Propel\Helper\ConnectionHelper->_after(Object(Codeception\Test\Cest))
#2 /data/vendor/symfony/event-dispatcher/EventDispatcher.php(264): Codeception\Subscriber\Module->after(Object(Codeception\Event\TestEvent), 'test.after', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#3 /data/vendor/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'test.after', Object(Codeception\Event\TestEvent))
#4 /data/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'test.after', Object in /data/vendor/propel/propel/src/Propel/Runtime/Propel.php on line 190
I do not understand why the properties in config_propel.php are not set? What can be the reason? Posted in #general
p
I think it doesn't do the full bootstrapping when running single tests. Does it work if you run all tests?
Copy code
docker/sdk testing codecept run
s
I have these errors:
p
These values are populated by other config_default...php files. Seems that it doesn't happen in your case. What's your APPLICATION_ENV when tests are executed?
It will execute config_default-[APPLICATION_ENV].php on startup. Once you know what APPLICATION_ENV you're on, you can check if the propel config values are set inside this file.
s
APPLICATION_ENV is docker.test and the file config_deafult-docker.test.php does not exist. Is there a sample config file for testing?
p
Please check config_default.php. It should be loaded before any other config files.
s
I have config from config_default-docker.php and this call works now
docker/sdk testing codecept run -c tests/PyzTest/Zed/Product/codeception.yml
But this one does not
docker/sdk testing codecept run
Error:
In ErrorHandler.php line 83:
session_set_save_handler(): Cannot change save handler when headers already sent
p
That sounds familiar somehow... Go to tests/_bootstrap.php and add this to the very end of the file.
Copy code
ob_start();
Let's see if it helps.
🙏 1
s
I have this error: „Deprecated: The resolvable class cache is enabled but was not generated. in /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/ClassResolver/ResolvableCache/CacheReader/CacheReaderPhp.php on line 33" That’s why this error is displayed: “session_set_save_handler(): Cannot change save handler when headers already sent”.
p
We had that, too, but I don't remember anymore. Please check your config files. In my project, I'm having
Copy code
$config[KernelConstants::RESOLVABLE_CLASS_NAMES_CACHE_ENABLED] = false;
in config_default-devtest.php. Hoping that this will fix it.
s
Thanks, the tests are now running, but many are failing. I think it may still be problems in the config.
p
Might be, I'm sure you'll find out. 👍
s
Just appending here to say that adding
ob_start
to
tests/_bootstrap.php
resolved my issues as well. So it might be useful to either fix the underlying issue or at least add this small tip in the spryker documentation (maybe not everyone experiences that bug). So its easier for people that are not in this slack server to start testing. Also thanks @polite-lunch-97479 🙂