oject package> isort --recursive --check-only --diff <project package> -sp tox.ini - run : name : run tests command : | . venv/bin/activate python manage.py makemigrations --check --dry-run coverage run manage.py test codecov --token=<your private project token> - store_artifacts : path : test-reports destination : test-reports deploy : docker : - image : buildpack-deps:trusty-scm working_directory : ~/repo steps : - checkout - deploy : name : Eldarion Cloud command : | bin/ec/auth.sh bin/ec/deploy.sh staging bin/ec/slack-notify.sh staging workflows : version : 2 test-and-deploy : jobs : - test - deploy : requires : - test filters : branches : only : master

The workflows option in CircleCI adds a lot of power. Basically what’s happening here is:

We run lint checkers against the code. Then execute tests If those two items pass, the deploy step will execute, but only if on the master branch.

The deploy step executes some shell scripts in our repo that will deploy the code to an instance that we have setup for getting feedback from the product owner as the last step in our development process. What this means in practice is that as soon as a peer review is complete and the pull request is merged, the lints and tests are run and then automatically deployed.

Code Coverage Tracking

We use CodeCov to take the coverage reports uploaded from the CircleCI processing and produce reports to help us keep a pulse on how we are doing coverage-wise. But more important than that and what I think the killer feature of CodeCov is, is the diff reporting.

Each Pull Request is updated with a report on how much the diff is covered in tests. That is, out of the changes submitted by the developer, how much of those changes have been at least executed by a test suite.

Conclusion

This stack of tools and services enables us to remain vigilant about code quality.

By encapsulating a lot of quality metrics into machine readable rules we can let the computer validate the code for us. With tests that can exercise the code in a repeatable fashion, we can move more violently to implement new features or refactor existing code for performance or maintainability.

Finally, this stack helps us to focus on taking ideas to launch, faster, because we are much more able to be focused on the value proposition of the software.