diff --git a/.github/workflows/unittest.yaml b/.github/workflows/unittest.yaml index c4df6dbf6..a8eb657ab 100644 --- a/.github/workflows/unittest.yaml +++ b/.github/workflows/unittest.yaml @@ -2,10 +2,21 @@ name: Python application test on: workflow_dispatch: + pull_request: + branches: + - 'main' + - 'dev' + - '*-release' + push: + branches: + - 'main' + - 'dev' + - '*-release' jobs: build: runs-on: ubuntu-latest + environment: unittest strategy: matrix: # python-version: ['3.9', '3.10', '3.11'] @@ -30,6 +41,11 @@ jobs: - name: Show failed tests and overall summary run: | grep -E "FAILED tests|[0-9]+ passed," unittest.txt + failed_count=$(grep "FAILED" unittest.txt | wc -l) + if [[ "$failed_count" -gt 0 ]]; then + echo "$failed_count failed lines found! Task failed." + exit 1 + fi - name: Upload pytest test results uses: actions/upload-artifact@v3 with: @@ -40,4 +56,5 @@ jobs: ./tests/data/rsp_cache_new.json retention-days: 3 if: ${{ always() }} + \ No newline at end of file diff --git a/tests/scripts/run_install_deps.sh b/tests/scripts/run_install_deps.sh index 2758e24da..9e483ed1d 100644 --- a/tests/scripts/run_install_deps.sh +++ b/tests/scripts/run_install_deps.sh @@ -1,4 +1,4 @@ python -m pip install --upgrade pip pip install -e .[test] npm install -g @mermaid-js/mermaid-cli -playwright install --with-deps chromium \ No newline at end of file +playwright install --with-deps \ No newline at end of file