Install the policy compass web application and all dependent services for development.
Requirements:
- Linux/Mac 64bit system (the policycompass_adhocracy service needs 64bit)
- git
- curl
- make
- bash
- python3.4 (optional for automatic installation)
This requires an github.com account with ssh keys.
git clone git@github.com:policycompass/policycompass.git
cd policycompass
Automatic installation with the nix package manager:
Install nix:
bash <(curl https://nixos.org/nix/install)
source ~/.nix-profile/etc/profile.d/nix.sh
Install dependency services and build shell environment with all development tools:
make
Start all installed services and the frontend using supervisord:
nix-shell -I ~/.nix-defexpr/channels/nixos --pure --command supervisord
The nix evironment can be entered by simply running
nix-shell -I ~/.nix-defexpr/channels/nixos --pure
Optional: lock this nix environment and make a convenience link:
nix-env -iA policycompass-env -p /nix/var/nix/gcroots/profiles/per-user/policycompass
ln -sf /nix/var/nix/gcroots/profiles/per-user/policycompass/bin/load-env-policycompass ~/.
Optional: Start all services and mock services with supervisor:
WORK IN PROGRESS
Install basic requirements:
- python3.4
- firefox (default setting for browser acceptance tests)
Checkout sub repositories:
git submodule foreach --recursive "(git checkout master; git submodule init; git submodule update; git pull)"
To update all repositories run:
git pull
git submodule foreach --recursive "(git submodule init; git submodule update; git-pull)"
Create Python virtualenv:
pyvenv-3.4 .
Install test runner:
bin/pip3.4 install -r requirements.txt
Install dependency services:
Read the README files in the subproject directories (./policycompass-*).
Acceptance tests for the frontend webapplication and functional tests/specification that show how to use a service.
To ease distributed development every service API has a mock HTTP server which specifies HTTP responses for given HTTP requests.
- pytest (test runner)
- pytest_splinter (test fixtures/configuration for the splinter browser)
- splinter (test browser based on webdriver)
- webdriver (browser automation)
- requests (library for http requests)
You can start the example mock server with:
bin/python tests-mock-services/example-service.py
Test that it is working correctly:
wget http://localhost:9900/test/value
bin/py.test tests-acceptance-frontend
bin/py.test tests-api-services