-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.41 KB
/
test.yml
File metadata and controls
48 lines (40 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: |
# Run behave with JUnit output to verify results
# Workaround for Python/behave segfault after tests complete
# See: https://github.com/orgs/community/discussions/52715
set +e
behave --format progress --no-capture --junit --junit-directory=test-results
exit_code=$?
set -e
# Check if JUnit results show all tests passed
if [ -d test-results ]; then
failures=$(grep -l 'failures="[1-9]' test-results/*.xml 2>/dev/null | wc -l || echo "0")
errors=$(grep -l 'errors="[1-9]' test-results/*.xml 2>/dev/null | wc -l || echo "0")
if [ "$failures" -eq 0 ] && [ "$errors" -eq 0 ]; then
echo "All tests passed according to JUnit results"
if [ $exit_code -eq 139 ]; then
echo "::warning::Behave crashed with segfault after tests completed (known Python issue)"
fi
exit 0
fi
fi
exit $exit_code