fail python test when tests fail

This commit is contained in:
Kyle Robbertze 2021-05-21 15:30:26 +02:00
parent 482fef46a1
commit 359d351e20
2 changed files with 20 additions and 6 deletions

View File

@ -1,12 +1,26 @@
#/bin/bash
failed='f'
# Starting at repo root
echo "::group::Airtime Analyzer"
cd python_apps/airtime_analyzer
nosetests . -x
if ! nosetests . -x; then
failed='t'
fi
echo "::endgroup"
echo "::group::API Client"
cd ../api_clients
nosetests . -x
if ! nosetests . -x; then
failed='t'
fi
echo "::endgroup"
# Reset to repo root
cd ../..
cd ../..
if [[ "$failed" = "t" ]]; then
echo "Python tests failed"
exit 1
fi
echo "Python tests passed!"

View File

@ -8,7 +8,7 @@ on:
paths-ignore:
- 'docs/**'
workflow_dispatch:
jobs:
test-bionic:
runs-on: ubuntu-18.04
@ -36,7 +36,7 @@ jobs:
- name: Run Python tests
run: |
sudo bash ./.github/scripts/python-pkg-install.sh
sudo bash ./.github/scripts/python-pkg-test.sh
./.github/scripts/python-pkg-test.sh
- name: Run PHP tests
run: |
composer install --no-progress --dev
@ -74,4 +74,4 @@ jobs:
run: |
composer install --no-progress --dev
cd airtime_mvc/tests
php ../../vendor/bin/phpunit
php ../../vendor/bin/phpunit