#!/bin/bash

set -e

# It seems Jenkins has this set, but we don't want it
unset SENTRY_DSN

# run linting of python files
echo 'Running linting...'

ruff check grass/ tests/ --no-cache
ruff format grass/ tests/ --check --no-cache

# run pytest with args set
echo 'Running tests...'
PYTHONDONTWRITEBYTECODE=1 COVERAGE_FILE=build/.coverage python -m pytest -v tests/unit/ \
		-p no:cacheprovider \
		--cov grass \
		--cov-report xml:build/coverage.xml \
		--cov-report term \
		--junitxml=build/pyunit.xml

echo 'Done!'
