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

Support data providers #8

Open
Ocramius opened this issue Nov 8, 2014 · 6 comments
Open

Support data providers #8

Ocramius opened this issue Nov 8, 2014 · 6 comments

Comments

@Ocramius
Copy link

Ocramius commented Nov 8, 2014

Most of my slowest tests depend on dozens of test cases generated via data-providers: is there any way to reproduce those in some way when the data provider output is serializable?

@liuggio
Copy link
Owner

liuggio commented Nov 8, 2014

This could be an idea for the next version, having a deep phpunit integration,
but fastest now execute in processes in parallel.
In my team db fixtures are the slow part of the test, could you give an example how you use it?

@Ocramius
Copy link
Author

Ocramius commented Nov 8, 2014

I'll take a direct reference to a test here: https://github.com/Ocramius/ProxyManager/blob/ff246e7569744e4a15dc2b043777230d82813d2f/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php#L89

This test takes all defined classes and throws them at a separate test (much like .phpt test cases) so that if fatals occur, the test suite doesn't crash.

In order to do that, a new process has to be spawned, and that takes an incredible amount of time for engines that are slower at booting up (hhvm, for example).

@liuggio
Copy link
Owner

liuggio commented Nov 10, 2014

Ehm this is an edge case - but -
if you use fastest and you create a singular functional test fore ach classes https://github.com/Ocramius/ProxyManager/blob/ff246e7569744e4a15dc2b043777230d82813d2f/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php#L124

if a generator fails will broke only the process where that test run

@Ocramius
Copy link
Author

@liuggio that still forces me to write code where the same test case applies multiple times.

For instance, a parallelized test may be reading data from various .csv files, or trying different DB connections (connection name provided by the data-provider). I don't really want to code additional classes for something that is indeed a test parameter.

I see that it's indeed problematic to implement support for something like that, but it would really be awesome :-)

@liuggio
Copy link
Owner

liuggio commented Nov 10, 2014

That's the adding value of fastest,
for each test fastest provides env parameters like echo getevn('ENV_TEST_CHANNEL');
that contains a different value per processor :)
or echo getevn('ENV_TEST_INC_NUMBER') that is the incremental id of the test.

@liuggio
Copy link
Owner

liuggio commented Nov 10, 2014

But yes I think there's no clean way to do this...

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

No branches or pull requests

2 participants