Skip to content

Commit 6577ea0

Browse files
Remove macae-v4-unittestcases-kd branch from test workflow triggers
1 parent 99b966b commit 6577ea0

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/test.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
- main
77
- demo-v4
88
- dev-v4
9-
- macae-v4-unittestcases-kd
109
paths:
1110
- 'src/backend/**/*.py'
1211
- 'src/tests/**/*.py'
@@ -68,14 +67,21 @@ jobs:
6867
- name: Run tests with coverage
6968
if: env.skip_tests == 'false'
7069
run: |
71-
python -m pytest src/tests/backend/test_app.py --cov=backend --cov-config=.coveragerc
72-
python -m pytest src/tests/backend --cov=backend --cov-append --cov-report=term --cov-config=.coveragerc --ignore=src/tests/backend/test_app.py
70+
if python -m pytest src/tests/backend/test_app.py --cov=backend --cov-config=.coveragerc && \
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
7384
74-
# - name: Run tests with coverage
75-
# if: env.skip_tests == 'false'
76-
# run: |
77-
# pytest --cov=. --cov-report=term-missing --cov-report=xml --ignore=tests/e2e-test/tests
78-
7985
- name: Skip coverage report if no tests
8086
if: env.skip_tests == 'true'
8187
run: |

0 commit comments

Comments
 (0)