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
|
pip3 install nose mock
|
||||||
|
|
||||||
for app in $(ls python_apps); do
|
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
|
pip3 install -e python_apps/$app
|
||||||
done
|
done
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
|
@ -4,21 +4,19 @@ failed='f'
|
||||||
# Starting at repo root
|
# Starting at repo root
|
||||||
|
|
||||||
echo "::group::Airtime Analyzer"
|
echo "::group::Airtime Analyzer"
|
||||||
cd python_apps/airtime_analyzer
|
pushd python_apps/airtime_analyzer
|
||||||
if ! nosetests . -x; then
|
if ! nosetests . -x; then
|
||||||
failed='t'
|
failed='t'
|
||||||
fi
|
fi
|
||||||
|
popd
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
echo "::group::API Client"
|
echo "::group::API Client"
|
||||||
cd ../api_clients
|
if ! make -C python_apps/api_clients test; then
|
||||||
if ! nosetests . -x; then
|
|
||||||
failed='t'
|
failed='t'
|
||||||
fi
|
fi
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
# Reset to repo root
|
|
||||||
cd ../..
|
|
||||||
if [[ "$failed" = "t" ]]; then
|
if [[ "$failed" = "t" ]]; then
|
||||||
echo "Python tests failed"
|
echo "Python tests failed"
|
||||||
exit 1
|
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