-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
@dataProvider using iterator_to_array() #2034
Comments
The current architecture of PHPUnit's instantiates all test objects ahead of time. So using |
Hmm, and I guess it'd be a superior amount of work to refactor it in a way to incrementally fetch tests? |
The count is obvious, of course. However, I fear that there are many hidden assumptions based on the current architecture. |
Don't know. One has to go ahead and see what breaks. |
I looked at PHPUnit 5.5 For example:
should be
And the return below needs to be a yield too.
Are a problem. But still solvable (wait for it). But the overall solution and shortest way will be using/adding a I had a huge amount of data and like to see the dots flow every 150ms. Hope to see that soon ;) Cheers! |
I invested an hour and came this far: https://github.com/sourcerer-mike/phpunit/commit/c2b8a0ae0377d3cb99e9eb147ea0961e6bc4022f There is a point in PHPUnit 5.5 I can imagine something like
and in
Which needs Hope you will continue from here and publish it as a patch or any other way very soon @sebastianbergmann ;) |
I think this is blocked by #10. |
I'm using a I would very much like if the failing entry would only fail one dataProvider, and let other pass. It would also be great to use a deubgger to run that. Of course I could And to acheive that, I would also need dataProvider to be run one after another. I can even supply an iterator or a callback, should you need to have these references earlier. Any way to do that would be great. |
Hello @bwoebi, @danon and everybody else still reading this: this will be solved by the improved data provider handling. @ScreamingDev exactly! You were looking in the right direction. Why did you stop, though?? I mean, it would only have been a few more weeks of work. ping @pcrov @mariofischer @jdufresne as you 👍'd this |
Superseded by #3736 |
@epdenouden you asked and answered it at once xD n1. |
So sad, I thought this one hour 'developer relations workshop' would teach me the tricks to get other devs to do all the work 😞 |
Can we please iterate one-by-one over an array?
In my concrete example, I have 288 testcases needing each 2-10MB of data. I'm
yield
ing them, one-by-one in my dataprovider, but phpunit is applyingiterator_to_array()
to it.What's happening? An out of memory (more than 1GB of memory is needed, not acceptable on many systems). ... I thought that were the precise point of using an iterator dataprovider in order to have them processed one-by-one?
The text was updated successfully, but these errors were encountered: