Skip to content
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

Atoum support #198

Closed
Pierozi opened this issue May 28, 2015 · 4 comments
Closed

Atoum support #198

Pierozi opened this issue May 28, 2015 · 4 comments
Labels

Comments

@Pierozi
Copy link

Pierozi commented May 28, 2015

Hello,

I've noticed PsySh don't work during Atoum execution.
It's a crime for TDD 😢

Someone know why is not working ?
Ctrl+D seems to be a good start of reason.

=> Plab\Iced\Sdk\tests\units\Defer\Defer::testPromise() with exit code 0:
==> output(2228) "Psy Shell v0.4.4 (PHP 5.6.7 — cli) by Justin Hileman
==> >>> 
==> Exit:  Ctrl+D
==> O:26:"mageekguy\atoum\test\score":15:{s:32:"mageekguy\atoum\test\scorecase";N;s:38:"mageekguy\atoum\test\scoredataSetKey";N;s:43:"mageekguy\atoum\test\scoredataSetProvider";N;s:13:"*passNumber";i:2;s:17:"*failAssertions";a:0:{}s:13:"*exceptions";a:0:{}s:20:"*runtimeExceptions";a:0:{}s:9:"*errors";a:0:{}s:10:"*outputs";a:0:{}s:12:"*durations";a:1:{i:0;a:4:{s:5:"class";s:37:"Plab\Iced\Sdk\tests\units\Defer\Defer";s:6:"method";s:11:"testPromise";s:5:"value";d:0.041093111038208008;s:4:"path";s:36:"/app/src/tests/units/Defer/Defer.php";}}s:15:"*memoryUsages";a:1:{i:0;a:3:{s:5:"class";s:37:"Plab\Iced\Sdk\tests\units\Defer\Defer";s:6:"method";s:11:"testPromise";s:5:"value";i:262144;}}s:14:"*voidMethods";a:0:{}s:21:"*uncompletedMethods";a:0:{}s:17:"*skippedMethods";a:0:{}s:11:"*coverage";C:30:"mageekguy\atoum\score\coverage":1287:{a:7:{i:0;a:1:{s:25:"Plab\Iced\Sdk\Defer\Defer";s:24:"/app/src/Defer/Defer.php";}i:1;a:1:{s:25:"Plab\Iced\Sdk\Defer\Defer";a:12:{s:11:"__construct";a:7:{i:35;i:1;i:37;i:1;i:38;i:-1;i:39;i:-1;i:40;i:-2;i:42;i:-1;i:43;i:-1;}s:8:"addAgent";a:5:{i:48;i:-1;i:50;i:-1;i:51;i:-1;i:53;i:-1;i:54;i:-1;}s:8:"getAgent";a:5:{i:57;i:1;i:58;i:-1;i:59;i:-1;i:61;i:-1;i:62;i:-2;}s:14:"getMasterAgent";a:2:{i:66;i:-1;i:67;i:-2;}s:14:"getPromiseUuid";a:2:{i:71;i:-1;i:72;i:-2;}s:7:"promise";a:3:{i:76;i:1;i:77;i:1;i:78;i:-2;}s:4:"then";a:6:{i:82;i:-1;i:83;i:-1;i:84;i:-1;i:86;i:-1;i:88;i:-1;i:89;i:-2;}s:7:"resolve";a:22:{i:93;i:1;i:94;i:1;i:96;i:1;i:97;i:1;i:99;i:1;i:100;i:1;i:102;i:1;i:103;i:1;i:104;i:1;i:106;i:1;i:107;i:1;i:108;i:1;i:109;i:1;i:111;i:1;i:112;i:-1;i:113;i:-2;i:114;i:1;i:115;i:1;i:117;i:1;i:118;i:1;i:120;i:1;i:121;i:-2;}s:6:"reject";a:6:{i:125;i:-1;i:126;i:-1;i:128;i:-1;i:129;i:-1;i:131;i:-1;i:132;i:-2;}s:6:"notify";a:14:{i:136;i:-1;i:137;i:-1;i:139;i:-1;i:140;i:-1;i:142;i:-1;i:143;i:-1;i:145;i:-1;i:146;i:-1;i:148;i:-1;i:149;i:-1;i:151;i:-1;i:152;i:-1;i:154;i:-1;i:155;i:-2;}s:6:"nowait";a:8:{i:162;i:-1;i:163;i:-1;i:165;i:-1;i:167;i:-1;i:168;i:-1;i:170;i:-1;i:171;i:-1;i:172;i:-1;}s:10:"isRejected";a:2:{i:176;i:-1;i:177;i:-2;}}}i:2;a:0:{}i:3;a:0:{}i:4;a:0:{}i:5;a:0:{}i:6;a:0:{}}}}"
@bobthecow
Copy link
Owner

I'm not sure, as I've never tried using PsySH with Atoum, but there should be a way to get it to work… I won't be able to take a look until tonight or tomorrow, but in the meantime, try adding this to your psysh config:

'usePcntl' => false,

@Pierozi
Copy link
Author

Pierozi commented May 28, 2015

Thanks for your answer, and for PsySh, amazing tool.
I tested your suggestion, but result is same.

I write a lightest file if you want test yourself.
You have just to run atoum on this file https://gist.github.com/Pierozi/cc4cbce154a397f758ec

root@a158132b34bb:/app# php /app/vendor/bin/atoum /app/src/tests/scratch/psysh.php 
> PHP path: /usr/local/bin/php
> PHP version:
=> PHP 5.6.7 (cli) (built: Apr  7 2015 21:36:41)
=> Copyright (c) 1997-2015 The PHP Group
=> Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
=>     with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans
> Total test memory usage: 0.00 Mb.
> Running duration: 0.21 second.
Failure (1 test, 0/1 method, 0 void method, 0 skipped method, 1 uncompleted method, 0 failure, 0 error, 0 exception)!
> Total test duration: 0.00 second.
> There is 1 uncompleted method:
=> tests\units\Foo::testGet() with exit code 0:
==> output(1076) "Psy Shell v0.4.4 (PHP 5.6.7 — cli) by Justin Hileman
==> >>> 
==> Exit:  Ctrl+D
==> O:26:"mageekguy\atoum\test\score":15:{s:32:"mageekguy\atoum\test\scorecase";N;s:38:"mageekguy\atoum\test\scoredataSetKey";N;s:43:"mageekguy\atoum\test\scoredataSetProvider";N;s:13:"*passNumber";i:2;s:17:"*failAssertions";a:0:{}s:13:"*exceptions";a:0:{}s:20:"*runtimeExceptions";a:0:{}s:9:"*errors";a:0:{}s:10:"*outputs";a:0:{}s:12:"*durations";a:1:{i:0;a:4:{s:5:"class";s:15:"tests\units\Foo";s:6:"method";s:7:"testGet";s:5:"value";d:0.14648890495300293;s:4:"path";s:32:"/app/src/tests/scratch/psysh.php";}}s:15:"*memoryUsages";a:1:{i:0;a:3:{s:5:"class";s:15:"tests\units\Foo";s:6:"method";s:7:"testGet";s:5:"value";i:6553600;}}s:14:"*voidMethods";a:0:{}s:21:"*uncompletedMethods";a:0:{}s:17:"*skippedMethods";a:0:{}s:11:"*coverage";C:30:"mageekguy\atoum\score\coverage":194:{a:7:{i:0;a:1:{s:3:"Foo";s:32:"/app/src/tests/scratch/psysh.php";}i:1;a:1:{s:3:"Foo";a:1:{s:3:"get";a:4:{i:9;i:1;i:11;i:1;i:13;i:1;i:14;i:-2;}}}i:2;a:0:{}i:3;a:0:{}i:4;a:0:{}i:5;a:0:{}i:6;a:0:{}}}}"

@Pierozi
Copy link
Author

Pierozi commented Feb 26, 2016

Hello there,

Actually problem was under the way of Atoum execute each test.
Atoum have different engine for increase test performance and isolation.

The default engine are concurent, but you can change by inline for execute test in same process.
in this mode, PsySh are able to run interactive shell.

http://docs.atoum.org/en/latest/written_help.html?highlight=engine#execution-engine

    /**
     * Class Foo
     * @engine inline
     * @package tests\units
     */
    class Foo extends \atoum
    {

Thanks a lot to Hywan and Jubianchi from Atoum team for there help.

@bobthecow
Copy link
Owner

Oh, yeah, that makes total sense. I didn't realize they were running in concurrent subprocesses by default. That would definitely mess with PsySH :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants