From 359d351e20d6ce841cb95928a56c5f22a066b0f5 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Fri, 21 May 2021 15:30:26 +0200 Subject: [PATCH] fail python test when tests fail --- .github/scripts/python-pkg-test.sh | 20 +++++++++++++++++--- .github/workflows/test-all-Ubuntu.yml | 6 +++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/scripts/python-pkg-test.sh b/.github/scripts/python-pkg-test.sh index 5bb2c39d8..a6918a66c 100644 --- a/.github/scripts/python-pkg-test.sh +++ b/.github/scripts/python-pkg-test.sh @@ -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 ../.. \ No newline at end of file +cd ../.. +if [[ "$failed" = "t" ]]; then + echo "Python tests failed" + exit 1 +fi +echo "Python tests passed!" diff --git a/.github/workflows/test-all-Ubuntu.yml b/.github/workflows/test-all-Ubuntu.yml index 8bfa7a586..4c04677ed 100644 --- a/.github/workflows/test-all-Ubuntu.yml +++ b/.github/workflows/test-all-Ubuntu.yml @@ -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 \ No newline at end of file + php ../../vendor/bin/phpunit