GithubHelp home page GithubHelp logo

Server Test Timeout about laika HOT 12 CLOSED

arunoda avatar arunoda commented on July 20, 2024
Server Test Timeout

from laika.

Comments (12)

arunoda avatar arunoda commented on July 20, 2024

Okay you get a screenshot of the console?
Also is it possible to share the test code ?

from laika.

EricTheMagician avatar EricTheMagician commented on July 20, 2024

screen shot 2013-06-30 at 9 57 55 pm

Here you go. I attached a screenshot with the console and the code. Its really simple tests that I am trying to setup.

If make the test run on the server (ie replace client with server), the test runs.

I installed PhatomJS 1.9.1 through homebrew.

from laika.

arunoda avatar arunoda commented on July 20, 2024

Hmm, pretty weird.
I updated phantomjs and it works correctly.

Can ensure do you have laika version 0.2.2? (laika -v)
If not upgrade it.

Try to clone https://github.com/arunoda/laika and run tests on the locally.
you can do with npm test

Lets see if it gives an error?

On Mon, Jul 1, 2013 at 7:32 AM, thejinx0r [email protected] wrote:

[image: screen shot 2013-06-30 at 9 57 55 pm]https://f.cloud.github.com/assets/323436/728194/cacea36a-e1f1-11e2-9489-8e09d21740a6.png

Here you go. I attached a screenshot with the console and the code. Its
really simple tests that I am trying to setup.

If make the test run on the server (ie replace client with server), the
test runs.

I installed PhatomJS 1.9.1 through homebrew.


Reply to this email directly or view it on GitHubhttps://github.com//issues/25#issuecomment-20260108
.

Arunoda Susiripala

@arunoda http://twitter.com/arunoda
http://gplus.to/arunodahttps://github.com/arunoda
http://www.linkedin.com/in/arunoda

from laika.

EricTheMagician avatar EricTheMagician commented on July 20, 2024

I was running the latest laika version.

When I cloned the repo and ran the test, this is the error I got.

[email protected] test /Users/ericyen/git/laika
node_modules/.bin/mocha -u tdd -R spec -t 5000 --recursive test

sh: node_modules/.bin/mocha: No such file or directory
npm ERR! weird error 127
npm ERR! not ok code 0

I also made sure to reinstall mocha, but I still got the same error.

from laika.

arunoda avatar arunoda commented on July 20, 2024

You've to first install dependancies with npm install

Then try.

On Mon, Jul 1, 2013 at 8:13 AM, thejinx0r [email protected] wrote:

I was running the latest laika version.

When I cloned the repo and ran the test, this is the error I got.

[email protected] test /Users/ericyen/git/laika
node_modules/.bin/mocha -u tdd -R spec -t 5000 --recursive test

sh: node_modules/.bin/mocha: No such file or directory
npm ERR! weird error 127
npm ERR! not ok code 0


Reply to this email directly or view it on GitHubhttps://github.com//issues/25#issuecomment-20260931
.

Arunoda Susiripala

@arunoda http://twitter.com/arunoda
http://gplus.to/arunodahttps://github.com/arunoda
http://www.linkedin.com/in/arunoda

from laika.

EricTheMagician avatar EricTheMagician commented on July 20, 2024

I did that,
And all the tests are passing now.

from laika.

arunoda avatar arunoda commented on July 20, 2024

Hmm. I wonder what cause the issue.

Can you try evalSync instead sync -
http://arunoda.github.io/laika/syntax-suger.html ?

On Mon, Jul 1, 2013 at 8:22 AM, thejinx0r [email protected] wrote:

I did that,
And all the tests are passing now.


Reply to this email directly or view it on GitHubhttps://github.com//issues/25#issuecomment-20261116
.

Arunoda Susiripala

@arunoda http://twitter.com/arunoda
http://gplus.to/arunodahttps://github.com/arunoda
http://www.linkedin.com/in/arunoda

from laika.

EricTheMagician avatar EricTheMagician commented on July 20, 2024

I tried evalSync instead. Same error.
I wrapped the code in evalSync in a setTimeout. Same error.
I replaced client.evalSync with server.evalSync. Same error. ( replacing client with server was previously working)
I replaced server.evalSync with server.eval. it works again.

(Yes, I made sure to comment out the client/server.once call after he evalSync calls)

from laika.

EricTheMagician avatar EricTheMagician commented on July 20, 2024

Problem partially solved.

I have some server code that loads a fair amount of data into the database.
When I comment out that line of code, it works.

But obviously, I don't want to have to comment out my code to run the test.
So, is there any way for me, from within my code to identify if it is running the laika tests or not?

from laika.

kevinharvey avatar kevinharvey commented on July 20, 2024

I had the same problem with some code in a Meteor.startup() block that preloaded a bunch of data. I added an environment variable to my Laika run, checking for the environment variable in the startup script, and not running the load script if the environment variable was true.

Command

$ TEST=1 laika

Code

Meteor.startup(function () {
    if ( !process.env.TEST ) {
        loadData(); // or whatever
    }
});

The downside of course is that you have to create any data you want preloaded in the test. I'd be interested in some way to load data before a test, a la Django fixtures.

from laika.

EricTheMagician avatar EricTheMagician commented on July 20, 2024

Perfect.
I will do that.

Since it's pretty much solved, and I'm not a heavy github user, I have a github etiquette question.
should I close this issue? or leave it opened as a feature request?

from laika.

arunoda avatar arunoda commented on July 20, 2024

Fixtures is a features we should badly needed. You can close the issue. We'll open another issue for the fixtures and continue the discussion on it.

from laika.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.