| Page 1 of 1 | [ 6 posts ] |
|
Hi reid/all,
I was just wondering if anyone has a working ant task that runs yeti? I'm using one similar to what is suggested in the "Maintanable Javascript" book, but am still getting errors. The ant target I'm using is pretty simple: Code: <!-- yeti --> <target name="yeti"> <apply executable="yeti" failonerror="true" parallel="true"> <fileset dir="." includes="**/*-test.html" /> <srcfile/> </apply> </target> But when executing this task I get the following error: Code: yeti: [apply] Yeti v0.2.5 (Node.js v0.6.15) Error: Unable to connect to Hub or start an interactive session. [apply] Report this bug at http://yuilibrary.com/projects/yeti/report Running the yeti command directly from the command line works just fine though, just not from ant. I've also tried starting a server locally and running the same ant task, hoping it would pick up the hub, but no such luck. Any help would be appreciated on this one! Olan |
|
Olan,
The reason why you'll see "Unable to connect to Hub or start an interactive session" is because you would need to connect browsers before running tests. Yeti needs to know when you have finished connecting browsers. If you're not connecting to a Hub, one will be created at http://localhost:9000. At that point, no browsers are connected, so Yeti waits for you to go and connect some. After that, you'd press Enter to begin testing. But if you're using Yeti inside of a build system, there isn't an interactive terminal present and it would just wait forever. There is a solution: simply create a Yeti Hub with `yeti --server` and connect your browsers before your Ant task. When you run `yeti` again with your tests, it will begin testing immediately on all browsers connected to that Hub. Reid |
|
Reid,
Thanks for your reply. I attempted this yesterday without fully understanding the in's and out's and didn't get it working, so I gave it another go after reading your post. I can start a yeti server fine locally and connect browsers to it using: Code: yeti --server At this point I connected my browser to http://localhost:9000. I'm not sure if the server is supposed to alert me when agents are connected (as it does when not using the --server arg) but it doesn't. Anyway, from the command line running yeti normally does pick up the local hub OK, however it doesn't run them automatically as you mentioned. When I start the test it still waits for me to press enter before proceeding with the tests: Code: Connected to http://localhost:9000 Waiting for agents to connect at http://localhost:9000. When ready, press Enter to begin testing. ✔ Testing started! ✔ Allowance Test Suite on Chrome (19.0.1084.56) / Linux ✔ Agent completed: Chrome (19.0.1084.56) / Linux Running the ant task then gives the same error as before, as I guess it cannot start an interactive shell to wait for the enter keypress. Code: yeti: [apply] Yeti v0.2.5 (Node.js v0.6.15) Error: Unable to connect to Hub or start an interactive session. [apply] Report this bug at http://yuilibrary.com/projects/yeti/report So I guess what I'm asking is, is this expected behaviour? Is there a method to automatically execute the tests without entering an interactive session? FYI: Code: Ubuntu 12.04 LTS Node v0.6.15 Yeti 0.2.5 Apache Ant(TM) 1.8.2 |
|
No, that's not expected. I made a change to Yeti for starting tests right away if browsers are already connected to a Hub.
You can try it out by installing Yeti from the latest source, which is a one-line affair: Code: npm install -g http://latest.yeti.cx |
|
Hey reid,
Thanks for that, works like you mentioned now.. but still not from ant unfortunately! It seems the isTTY check is failing, and given the recent changes you submitted, I wonder if it is still necessary? I commented out the following block in yeti/lib/cli.js and, with the change, it works fine from ant: Code: 204 /*if (!isTTY) { 205 // TODO Only throw this error if no agents are immediately available. 206 // stderr is not a terminal, we are likely being ran by another program. 207 // Fail quickly instead of waiting for browsers. 208 throw "Unable to connect to Hub or start an interactive session."; 209 // TODO: Allow waiting X seconds for browsers. 210 // "Try running with --wait 30 to wait 30 seconds for browsers to connect."; 211 }*/ As I mentioned I was finally able to get the desired output: Code: yeti: [apply] Connected to http://localhost:9000 [apply] Agent connected: Chrome (19.0.1084.56) / Linux [apply] ✔ Testing started! [apply] ✔ Edit Panel Suite on Chrome (19.0.1084.56) / Linux [apply] ✔ Allowance Test Suite on Chrome (19.0.1084.56) / Linux [apply] ✔ Agent completed: Chrome (19.0.1084.56) / Linux [apply] 20 tests passed! (1180ms) I haven't looked at the code enough to know if this has knock on effects or not. I can fork my own version if these changes aren't suitable for the master branch. Thanks, Olan |
|
Hey Olan,
Thank you for your post; I apologize that my response was so delayed. I have incorporated your feedback by removing that code. You can get the latest Yeti as always by: Code: npm install -g http://latest.yeti.cx Reid |
| Page 1 of 1 | [ 6 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group