-
Notifications
You must be signed in to change notification settings - Fork 41
Development Guide for Panoptes
This guide will help you set up a local development and testing environment so you can begin contributing to Panoptes. Before beginning here, you should have followed the instructions to get Panoptes running locally (see the README for details).
-
Panoptes tries to keep its controllers lean by keeping its business logic in 'operations'. Operations are subclasses of
ActiveInteraction::Base
provided by ActiveInteraction. Becoming familiar with that gem's DSL will be useful. -
Panoptes uses a fork of Restpack Serializer to package to be sent as JSON via the API. Specific implementations are located in /serializers.
Contributions to Panoptes must be tested and must not break existing tests. In order to run specs, Panoptes will need a Postgres database running locally. Libraries and adapters need to be installed and configured so that they can talk.
- Run
bundle install
- Install the Postgres client libraries. On OSX, the simplest way is to use Homebrew:
brew install postgresql
. On Ubuntu/Debian,apt-get install libpq-dev
. - A Docker container is used to host Postgres. If you used
docker-compose up
and the rest of the Panoptes Docker containers are running, it will use the existing Postgres container. If they're not, or if you only need the database (for specs or testing), you can rundocker-compose -f docker-compose-db.yml up
instead. - Determine the container's IP with
docker-machine ip default
and update the test section of database.yml to include your Docker IP as the host and to use the database "panoptes_test" - Create the “panoptes_test” database with
RAILS_ENV=test bin/rake db:setup
- The specs will now run with
bundle exec rspec
. The whole suite can take a while to run, so you can limit the number run at once by specifying a file or string (-e) or with the ":focus" tag.