44 push :
55 branches :
66 - main
7- - dev
8- - demo
9- - hotfix
7+ - demo-v4
8+ - dev-v4
109 paths :
1110 - ' src/backend/**/*.py'
1211 - ' src/tests/**/*.py'
2423 - synchronize
2524 branches :
2625 - main
27- - dev
28- - demo
29- - hotfix
26+ - demo-v4
27+ - dev-v4
3028 paths :
3129 - ' src/backend/**/*.py'
3230 - ' src/tests/**/*.py'
@@ -69,25 +67,22 @@ jobs:
6967 - name : Run tests with coverage
7068 if : env.skip_tests == 'false'
7169 run : |
72- pytest --cov=. --cov-report=term-missing --cov-report=xml \
73- --ignore=tests/e2e-test/tests \
74- --ignore=src/backend/tests/test_app.py \
75- --ignore=src/tests/agents/test_foundry_integration.py \
76- --ignore=src/tests/mcp_server/test_factory.py \
77- --ignore=src/tests/mcp_server/test_hr_service.py \
78- --ignore=src/backend/tests/test_config.py \
79- --ignore=src/tests/agents/test_human_approval_manager.py \
80- --ignore=src/backend/tests/test_team_specific_methods.py \
81- --ignore=src/backend/tests/models/test_messages.py \
82- --ignore=src/backend/tests/test_otlp_tracing.py \
83- --ignore=src/backend/tests/auth/test_auth_utils.py
70+ if python -m pytest src/tests/backend/test_app.py --cov=backend --cov-config=.coveragerc -q > /dev/null 2>&1 && \
71+ python -m pytest src/tests/backend --cov=backend --cov-append --cov-report=term --cov-report=xml --cov-config=.coveragerc --ignore=src/tests/backend/test_app.py; then
72+ echo "Tests completed, checking coverage."
73+ if [ -f coverage.xml ]; then
74+ COVERAGE=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); print(float(root.attrib.get('line-rate', 0)) * 100)")
75+ echo "Overall coverage: $COVERAGE%"
76+ if (( $(echo "$COVERAGE < 80" | bc -l) )); then
77+ echo "Coverage is below 80%, failing the job."
78+ exit 1
79+ fi
80+ fi
81+ else
82+ echo "No tests found, skipping coverage check."
83+ fi
8484
85- # - name: Run tests with coverage
86- # if: env.skip_tests == 'false'
87- # run: |
88- # pytest --cov=. --cov-report=term-missing --cov-report=xml --ignore=tests/e2e-test/tests
89-
9085 - name : Skip coverage report if no tests
9186 if : env.skip_tests == 'true'
9287 run : |
93- echo "Skipping coverage report because no tests were found."
88+ echo "Skipping coverage report because no tests were found."
0 commit comments