6function run_python_tests() {
7 GIT_ROOT=$(git rev-parse --show-toplevel)
9 pushd "$GIT_ROOT" >/dev/null
10 # If there's a `scripts` folder with a test script, run that
11 if find "scripts" -name 'run_*_tests.sh' >/dev/null; then
12 print_info "-> bash scripts/run_*_tests.sh"
13 bash scripts/run_*_tests.sh
18 REPO_NAME="$(basename $(pwd))"
20 # Run ruff to do Python formatting
21 print_info "-> ruff format"
26 print_info "-> ruff check --fix"
31 # This is one repo which is a bit special -- I'm gradually trying to chase
32 # the code into `src`, but for now I have to remember to look at *.py
33 if [[ "$REPO_NAME" = "library-lookup" ]]
35 print_info '-> mypy *.py src tests'
38 print_info '-> mypy src tests'
40 if mypy src tests >/dev/null
42 mypy src tests --no-color-output
51 print_info "-> coverage run -m pytest tests"
52 coverage run -m pytest tests --quiet
56 print_info "-> coverage report"
58 if [[ $(coverage report --format=total) = "100" ]]
66function run_rust_tests() {
67 print_info "-> cargo fmt"
72 print_info "-> cargo build"
77 print_info -n "-> cargo test"