Developer Guide¶
Requirements¶
Besides an appropriate version of Python, Large Image tests are run via tox. This is also a convenient way to setup a development environment.
The tox
Python package must be installed:
pip install tox
See the tox documentation for how to recreate test environments or perform other maintenance tasks.
By default, instead of storing test environments in a .tox
directory, they are stored in the build/tox
directory. This is done for convenience in handling build artifacts from Girder-specific tests.
nodejs and npm for Girder Tests or Development¶
nodejs
version 12.x and a corresponding version of npm
are required to build and test Girder client code. See nodejs for how to download and install it. Remember to get version 12 or earlier.
Mongo for Girder Tests or Development¶
To run the full test suite, including Girder, ensure that a MongoDB instance is ready on localhost:27017
. This can be done with docker via docker run -p 27017:27017 -d mongo:latest
.
Running Tests¶
Tests are run via tox environments:
tox -e test-py39,flake8,lintclient
Or, without Girder:
tox -e core-py39,flake8
You can build the docs. They are created in the docs/build
directory:
tox -e docs
You can run specific tests using pytest’s options, e.g., to try one specific test:
tox -e core-py39 -- -k testFromTiffRGBJPEG
Development Environment¶
To set up a development environment, you can use tox. Use the core
environment instead of the test
environment if you aren’t using Girder. This is not required to run tests:
tox --devenv /my/env/path -e test
and then switch to that environment:
. /my/env/path/bin/activate
If you are using Girder, build and start it:
girder build --dev
girder serve