Closed stewartmacgregor closed 9 years ago
na
Ah, gotcha, I must've misunderstood the request.
https://github.com/modeset/teaspoon/blob/master/lib/teaspoon/drivers/phantomjs_driver.rb#L33
I'd probably try adding some rescue statements there, and add some recursion. That would at least fire up phantomjs again -- all speculation of course.
That might keep things contained within one "run", but the problem is really that it doesn't know where you left off, since the "browser" crashed. You'd probably have to add some way to track the last spec run, and then somehow add the concept of "run everything after this spec" to each of the frameworks (e.g. jasmine, mocha, qunit -- or just the one that you're using). Hope that helps.
na
No worries, sorry it doesn't really handle what you're looking for. Hopefully it's easy for you to sort out -- these things can be a bear.
In thinking through my theoretical solution, it won't really work.. when you load the "browser" up again, all your coverage information would be gone. There's really no way to keep that between runs -- it's a large amount of data, and so teaspoon doesn't report it until the end of the run. It would have to be sent along with each spec, and then stored on the ruby level and then somehow merged together when restarting the "browser" and getting more of them.
na
An alternative to 2 is to fork the repo and implement what you're looking for. This is definitely outside the scope of teaspoon, and I've not heard of the issue before, but it seems reasonable to assume that it's a memory leak and phantom failing. The amount of time that we have as a team to dedicate to a memory leak problem in your application is minimal, though if you can track it down to something in teaspoon we'd definitely take a look!