iamchrismiller / grunt-casper

Run CasperJS Scripts/Functional Tests
Other
69 stars 38 forks source link

Does grunt-casper run asynchronsouly? #26

Closed tysonnero closed 10 years ago

tysonnero commented 10 years ago

I'm not too familiar with how Grunt runs tasks. I thought it would be in a synchronous fashion. However, it seems like we have a situation where grunt-casper starts but doesn't finish until grunt has already exited. This is happening on our build server where we are logging console output and performing other commands after Grunt runs. We are getting console output for Casper several seconds after Grunt exits which ultimately causes our test run to fail b/c it relies on a server that grunt turns on and off. Not only that, but the Casper test cases that do run are mixed with console output from other Grunt tasks. Note: Casper takes about 8 secs to execute all the tests.

Would you have any clue to why this would be happening?

iamchrismiller commented 10 years ago

Grunt is indeed synchronous unless you use some sort of concurrency. The tests shouldn't bleed over. There is a parallel task within grunt-casper but it should still have hold of the process until done() is called. I would like to see more of your setup and do you see this outside the build server?

iamchrismiller commented 10 years ago

@tysonnero check this out https://github.com/iamchrismiller/grunt-casper/issues/23#issuecomment-35094709 maybe it is related to your issue. Sounds like it could definitely be.