|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
7 | | - - demo-v4 |
8 | | - - dev-v4 |
| 7 | + - dev |
| 8 | + - demo |
| 9 | + - hotfix |
9 | 10 | paths: |
10 | 11 | - 'src/backend/**/*.py' |
11 | 12 | - 'src/tests/**/*.py' |
|
23 | 24 | - synchronize |
24 | 25 | branches: |
25 | 26 | - main |
26 | | - - demo-v4 |
27 | | - - dev-v4 |
| 27 | + - dev |
| 28 | + - demo |
| 29 | + - hotfix |
28 | 30 | paths: |
29 | 31 | - 'src/backend/**/*.py' |
30 | 32 | - 'src/tests/**/*.py' |
@@ -64,23 +66,26 @@ jobs: |
64 | 66 | echo "skip_tests=false" >> $GITHUB_ENV |
65 | 67 | fi |
66 | 68 |
|
67 | | - - name: Run backend tests with coverage |
| 69 | + - name: Run tests with coverage |
68 | 70 | if: env.skip_tests == 'false' |
69 | 71 | run: | |
70 | | - python -m pytest src/tests/backend/test_app.py --cov=backend.app --cov-report= --cov-config=.coveragerc -q > /dev/null 2>&1 |
71 | | - python -m pytest src/tests/backend --cov=backend --cov-append --cov-report=xml --cov-report= --cov-config=.coveragerc --ignore=src/tests/backend/test_app.py 2>&1 | tee /tmp/pytest_output.txt |
72 | | - python -m coverage report --rcfile=.coveragerc |
73 | | - tail -1 /tmp/pytest_output.txt |
74 | | - |
75 | | - # Check coverage threshold |
76 | | - if [ -f coverage.xml ]; then |
77 | | - COVERAGE=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); print(float(root.attrib['line-rate']) * 100)") |
78 | | - echo "Coverage: $COVERAGE%" |
79 | | - if (( $(echo "$COVERAGE < 80" | bc -l) )); then |
80 | | - echo "Coverage is below 80%, failing the job." |
81 | | - exit 1 |
82 | | - fi |
83 | | - fi |
| 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 |
| 84 | +
|
| 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 |
84 | 89 |
|
85 | 90 | - name: Skip coverage report if no tests |
86 | 91 | if: env.skip_tests == 'true' |
|
0 commit comments