Skip to content

Server side testing

Ilya Sytchev edited this page Feb 22, 2018 · 13 revisions

Running unit tests

For quick and nearly immediate feedback during development we have deemed the best practice for running tests to be: consistently running the tests specific to the Django app you are currently working in.

This can be done by:

./manage.py test <app_name>

This way, even if changes from the current app you are working break tests within another app, the test failures will still be caught by Continuous Integration since all of our test are run upon every push.

Other options to run unit tests are:

workon refinery-platform

# Run all tests
./manage.py test 

# Run an entire test case's Unit tests
./manage.py test file_store.tests.FileStoreModuleTest

# Run a single Unit test
./manage.py test file_store.tests.FileStoreModuleTest.test_file_path_parens

Testing infrastructure code

Test in Vagrant and on AWS by deploying from scratch and to an already existing installation:

  • apply changes to an existing Vagrant installation: vagrant provision
  • deploy from scratch: git clone to a new directory (e.g., /tmp) then vagrant up
  • spin up a new dev stack on AWS using the latest production EBS and RDS snapshots
  • spin up a new dev stack on AWS without using existing snapshots

Resources