Testing
End-to-end Testing
The Cannlytics Website and API can be built in a Docker container for testing:
docker build . --tag gcr.io/cannlytics/cannlytics
gcloud auth configure-docker
docker push gcr.io/cannlytics/cannlytics
The cannlytics
package can be installed locally for testing with:
pip install .
Finally, the app can be run locally with:
npm run app:web
Unit testing
Each algorithm has a suite of unit tests. In practice, you may not be able to test every case. Therefore, you may want to focus on
- Null cases;
- Range tests, e.g., positive/negative value tests;
- Edge cases;
- Failure cases;
- Testing the paths most likely to execute most of the time.