Update CI to run api_clients pytest
This commit is contained in:
parent
f944eca0a7
commit
8d9d1e43c5
|
@ -4,6 +4,9 @@ echo "::group::Install Python apps"
|
|||
pip3 install nose mock
|
||||
|
||||
for app in $(ls python_apps); do
|
||||
if [[ -f "python_apps/$app/requirements-dev.txt" ]]; then
|
||||
pip3 install -r "python_apps/$app/requirements-dev.txt"
|
||||
fi
|
||||
pip3 install -e python_apps/$app
|
||||
done
|
||||
echo "::endgroup::"
|
||||
|
|
|
@ -4,21 +4,19 @@ failed='f'
|
|||
# Starting at repo root
|
||||
|
||||
echo "::group::Airtime Analyzer"
|
||||
cd python_apps/airtime_analyzer
|
||||
pushd python_apps/airtime_analyzer
|
||||
if ! nosetests . -x; then
|
||||
failed='t'
|
||||
fi
|
||||
popd
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::API Client"
|
||||
cd ../api_clients
|
||||
if ! nosetests . -x; then
|
||||
if ! make -C python_apps/api_clients test; then
|
||||
failed='t'
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
|
||||
# Reset to repo root
|
||||
cd ../..
|
||||
if [[ "$failed" = "t" ]]; then
|
||||
echo "Python tests failed"
|
||||
exit 1
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
.PHONY: lint test
|
||||
|
||||
SHELL := bash
|
||||
CPU_CORES := $(shell nproc)
|
||||
|
||||
MODULE_APP := api_clients
|
||||
MODULE_TESTS := tests
|
||||
|
||||
lint:
|
||||
pylint ${MODULE_APP}
|
||||
pylint ${MODULE_TESTS}
|
||||
|
||||
test:
|
||||
pytest -n ${CPU_CORES} --color=yes -v --cov=${MODULE_APP} ${MODULE_TESTS}
|
||||
|
||||
all: lint test
|
|
@ -0,0 +1,5 @@
|
|||
mock
|
||||
pylint
|
||||
pytest
|
||||
pytest-cov
|
||||
pytest-xdist
|
Loading…
Reference in New Issue