Testing with Velocity on C9.io

I’m trying to get the Velocity Meteor testing framework working on C9. https://ide.c9.io/bwobst/meteor-testing

On C9 the mirrored app’s logs show that the server boots up, but the tests don’t seem to run.

When I try to access the mirrored app directly, the request just times out.

I think this is because C9 only allows ports 8080, 8081, and 8082 to be used.

Hoping others have figured this out, otherwise I’d have to find a solution other than C9, which would not be cool.

For sanjo:jasmine you can:

  • Specify the mirror port for client integration tests with the environment variable: JASMINE_MIRROR_PORT (this is a typo. I will change it to JASMINE_CLIENT_MIRROR_PORT in the next release.
  • Specify the mirror port for client integration tests with the environment variable: JASMINE_SERVER_MIRROR_PORT
Meteor.startup(function() {
  process.env.JASMINE_MIRROR_PORT = 8081;
  process.env.JASMINE_SERVER_MIRROR_PORT = 8082;
});

errors out with:

[sanjo:karma]: start request failed { [Error: connect ECONNREFUSED] W20160202-19:21:04.315(0)? (STDERR) code: 'ECONNREFUSED', W20160202-19:21:04.315(0)? (STDERR) errno: 'ECONNREFUSED', W20160202-19:21:04.315(0)? (STDERR) syscall: 'connect' }

Try to set the environment variables outside of Meteor.startup. Otherwise this is maybe too late.

Ended up doing this and the server integration tests seem to be working now, but that ECONNREFUSED error still shows up.

Client tests (both unit and integration) are not working yet. Can't listen on port 8081. Perhaps another Meteor is running?.

I can get the client tests booted up on port 8082 (or so the jasmine-client-integration.log tells me), but the tests don’t run.

The client integration tests only run when you open your app in the browser. They run in a hidden iFrame. If you run the tests in CI mode (meteor --test) the tests will run automatically with PhantomJS.

Yes, I have three tabs open. *:8080 (works), *:8081 (“no app seems to be running” error), *:8082 (works).

Tried using the --test flag, but it doesn’t seem to help with client tests. It does, however, show the specifics of the server tests which is nice (via velocity:console-reporter).

Still get the errors ECONNREFUSED and Can't listen on port 8081. Perhaps another Meteor is running?.

I’ve also tried setting process.env.ROOT_URL explicitly to https://meteor-testing-bwobst.c9users.io, but that doesn’t have an effect.

I found a sample hack to do both client and servfer tests on cloud9.
So run all your server tests inside server-integration-mode and all your client test inside client-unit-mode. Of course, you have to install phontomjs with

npm install -g phontomjs-prebuilt

and execute this commande before running meteor

export JASMINE_BROWSER=PhantomJS
meteor --port $PORT:$IP

@Sanjo I don’t know if this can affect the tests? I mean is there some situation that I must use the correct velocity test mode in order to get the correct result?