File size: 505 Bytes
36ccd32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash -l
set -e
if [ "$#" -eq 0 ]; then
  # Kill cache, pytest complains about it if running local and docker tests in mapped volume
  find tests  -type d -name '__pycache__' -print0 | xargs -0 rm -rf {}
  # Make sure the service itself is installed
  poetry install
  # Make sure pre-commit checks were not missed and run tests
  git config --global --add safe.directory /app
  poetry run pre-commit install
  pre-commit run --all-files
  pytest -v --junitxml=pytest.xml tests/
else
  exec "$@"
fi