Chimp integration/e2e testing with multiple servers

I’m working on a Meteor package and I need a way to execute a test that has more than one app server running. I’d like to use Chimp if possible but I’m open to any testing framework that supports multiple controllable app servers that share the same mongo instance. Does anyone know of a way, similar to the multi client testing in Chimp, that I could create another app server during a test and be able to control it?
Thanks

You can start multiple Meteor servers no problem, and then get one chimp to use multi-client testing, where one browser looks at APP A and another looks at APP B

Chimp is agnostic to the server that is running, it just gives you browser capabilities with some nice Meteor additions like a DDP connection. So just get some scripts to start n x Meteor first and you’re good to go.

That makes sense, but I was hoping for something more easily controlled with an API from Chimp. I supposed I could spin up two Meteor apps, on different ports but sharing the same Mongo instance, and run acceptance tests against them. But as is mentioned in the Chimp docs for working with Meteor Chimp provides a server object for manipulating or executing code within that server, if I just spin up a new server and point a client to that server I’m unable to get the nice addition of that server object so I can’t execute code within that server’s context. It would be great if I could do something similar to the multi client approach, like this

export METEOR_APP_SERVERS=2
let servers;

this.Before(function() {
  servers = {
    first: server.instances[0],
    second: server.instances[1]
  };
})
 

// later use that server in a test
servers.second.execute(() => {
  expect(Posts.find({}).fetch()).length.to.equal(0);
});

Do you think that would be in the scope of Chimp?

Ahh now I see. You would like to start chimp with multiple DDP connections. Something like:

  1. Start meteor --port=3000
  2. Start meteor --port=3010
  3. Start chimp --ddp=localhost:3000 --ddp=localhost:3010

And in your code you would then get server[0].execute and server[1].execute

I like it and would love a PR for it. It should be pretty easy

Yes an API similar to that would be awesome. I’ll fork Chimp and see what I can do

Let m know if you need help, you can join our xolv.io/community slack channel for easy access to the Chimp team.

Alright sounds good, thanks. I’ve just created an issue for it https://github.com/xolvio/chimp/issues/545

just opened up a PR for you

1 Like