Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

integration-testing

Federation testing for a buddcloud server setup.

Que?

The Buddycloud channel server has over 700 unit tests which helps us have a high level of confidence when rolling out updates to production (_please_feel_free_to_contributemore!). That said, some things can't, or are more easily, tested via integration tests. This is where this suite kicks in.

The job of this set up is to run up several Buddycloud channel servers connected to an XMPP server and fire messages at the server and to check that responses are as expected. Running up several servers also allows us to check that federation is working too.

Test status

Testing

Primarily this setup is designed to be run on travisci on commit to the master branch of the Buddycloud channel server and may eventually be integrated into a bigger test suite (before the docker image is generated for example).

Running locally

Manually

You will need:

Using Docker

This project also has an automated docker build which you can use, rather than installing all the parts onto your system. To use the docker image run the following:

docker run -d --name buddycloud-integration-tests -p 5432:5432 -p 5222:5222 -p 5347:5347 buddycloud/integration-testing

If you are running postgresql or an XMPP server locally then you'll probably want to change those port mappings and use the XMPP_PORT and DATABASE_PORT environment variables.

You'll also need to set:

  • export DATABASE_HOST=localdocker (or similar)
  • export DATABASE_USER=docker
  • export DATABASE_PASSWORD=docker

Back to it....

You'll then need to set up some databases and configuration files:

  • To install the channel server run the setup-buddycloud.sh script in the resources directory
  • Install the databases, run setup-database.sh in the resources directory. If your postgres server is not on localhost then set an environment variable of DATABASE_HOST to point to its location, additionally a non-standard port number use DATABASE_PORT
  • You need to set up some configuration files. See the travisci examples, you will need to create a set of files in a directory named after your NODE_ENV environment variable (defaults to development)

Then...

# install dependencies
npm i .
# run the tests
npm test
# profit

Note: To see more details on the running tests run as follows:

DEBUG=tests* npm test

If not using localhost or a different xmpp client port number then you'll need to set XMPP_HOST and XMPP_PORT environment variables.

Writing tests

TBC

Docker Pull Command
Owner
buddycloud
Source Repository

Comments (0)