-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functional testing in modular application is not possible #469
Comments
This doesn't happen when modules are defined using closures. |
We are aware of this thanks :) Someone else reported this I don't remember where really. I am in the process of rewriting the suite to cater for micro, simple and multi module applications as far as functional tests are concerned. The first step was to change every test (of the new suite) to take into account namespaces. There is a bit of work to be done still but I should have something out pretty soon. |
Was there any progress with this issute? |
@piteer1 Sorry about that. I will be working on this this weekend so hopefully I will have a strategy for you pretty soon. |
@niden I saw this feature is already in a next milestone. Thanks! |
Hi, any updates on this? |
@Plaputta As I saw in version 1.2 this still doesn't work. I was able at the end to run such tests without Process Isolation, but it required from me simulationg module loading from PHP (I was loading a Module class using |
@niden I saw there's a version 1.2.1, will any fix for test be released with current version? Best regards |
Hello @sjinks Not sure if this is related to this fix (because I've also upgraded from Phalcon 1.2.0 beta2 to Phalcon 1.2.1) but now I'm getting segfaults. I will try to test this fix on clean app.
|
Ok, so as I've checked using separate unittest and it's working now. I will look more into the segfault issue and open separate one if I'll be able to find what's exactly the cause. |
You will probably need to rebuild phalcon from scratch because the layout of internal data structures has changed. |
I found the reason. There's a bug with memory management with phalcon
|
Please do rebuild Phalcon first.
Memleaks are caused by |
@sjinks Sorry for delay. Yes all written tests are fine, but probably, because PHP's garbage collection doesn't start. If I run the tests without the one that I've written all tests are working fine and there's no segfault. Here's a gist for a test which will fail: I've added just one method to a ConfigTest: public function testConfigWithMergeAndGarbageCollection()
{
$config = new Phalcon\Config(array('test1' => 1, 'test2' => 2));
$config->merge(new Phalcon\Config(array('test2')));
gc_collect_cycles();
} Here's an output from valgrind
Please try to run this test in your environment also. I'm using
and Phalcon 1.2.1 |
OK, let me try it |
@piteer1 Could you please test with the latest 1.2.2 branch? |
@sjinks After first check it looks like it works completely fine now. |
Hi all, I have same problem in phalcon 2.0.9. Unitest testing with codeception in modular application is not possible. My module class: |
@hunggau Create please separated issue |
Ohhh sorry I posted in a wrong thread, |
Hello,
There's a problem when putting more than one unittest in a row which initialize application and register modules. Even if the Phalcon\Mvc\Application object is recreated test will fail because it does the cache somewhere modules/classes definitions. It's easy to reproduce this using unittest class from cphalcon repository:
https://github.com/phalcon/cphalcon/blob/1.0.0/unit-tests/ApplicationMvcTest.php
I've added method there and just called different test (results will be exaclty the same if copy&paste
testApplicationModulesDefinition()
into following method's body):Running then a phpunit:
Will generate a fatal error (Cannot redeclare Frontend\Module..). This makes Phalcon modular application impossible to unittest.
The text was updated successfully, but these errors were encountered: