debian-koji-osbuild/run-tests.sh
Christian Kellner e099b8a96e run-tests: explicitly specify --cached
Seems to be required for newer versions of `git`.
2022-01-26 18:02:33 +01:00

27 lines
668 B
Bash
Executable file

#!/usr/bin/bash
set -euo pipefail
SHELLCHECK_SEVERITY=${SHELLCHECK_SEVERITY:-warning}
run_test() {
if [ -f /.dockerenv ]; then
eval "$1"
return
fi
podman run --rm -it -v "$(pwd)":/github/workspace:z --env "GITHUB_WORKSPACE=/github/workspace" koji.test "$1"
}
if [ ! -f /.dockerenv ]; then
pushd test
podman build -t koji.test -f Dockerfile .
popd
else
echo "Container detected, direct mode."
fi
SCRIPTS="$(git ls-files --exclude='*.sh' --ignored --cached | xargs echo)"
run_test "shellcheck -S ${SHELLCHECK_SEVERITY} ${SCRIPTS}"
run_test "pytest -v --cov-report=term --cov=osbuild test/unit/"
run_test "pylint plugins/**/*.py test/**/*.py"