- Create crontab string via crontab.guru
- Create a bash script to run your unittests
E.g.
#!/bin/bash
# Not certain this is necessary...
cd /path/to/your/module
# Assumes your unittests are in a directory named tests/ in your module's directory.
# tests.test_modulename == <modules's test directory>.<name of test file to run without the .py extension>
source /path/to/miniconda/bin/activate /path/to/miniconda/envs/module/env && python -m unittest tests.test_modulename &> /path/to/module/output.log
- Create your crontab entry via
crontab -e
:
* * * * * bash /path/to/your/script/run_tests.sh