Synchronizer Development Environment
This page documents the Makefile and build environment for synchronizers.
Setting up a synchronizer development environment
The synchronizer Makefile requires the following packages be installed:
Python, preferably version 2.7 as well as a 3.x version
tox, a framework for running unit tests. This should be installed using
pip, as older versions obtainable via
aptmay be incompatible.
python-dev, necessary to be able to setup the appropriate python virtual environments
When starting work on a new synchronizer, we recommend using the Makefile from and existing synchronizer (olt-service is a good working example) as a starting point rather than writing a Makefile from scratch.
Targets available in the synchronizer Makefile
While each developer is free to create a custom Makefile, it is suggested for ease of integration that the following targets are available:
Builds a docker container for the synchronizer. The environment variables
DOCKER_TAG may be used to configure the name of the docker image that will be build. For example, the following command will build the image
DOCKER_REPOSITORY=myname/mysynchronizer DOCKER_TAG=test make docker build
This target will push a docker image that was built using
make docker-build to dockerhub or another docker registry.
This target runs all tests on the repository that are appropriate for acceptance testing. Typically it invokes other Makefile targets such as
make test-migration, and
This target runs
tox to execute unit tests and generate a coverage report.
This target checks that xproto migrations are up-to-date.
This target runs a linting check of the xproto files to ensure that the xproto is syntactically correct and that it obeys several semantic rules.
This target will create or update the database migration scripts from the service's current xproto.
This target removes all build artifacts, including the contents of virtual environments that are built, as well as unit testing coverage reports and results.