-
Notifications
You must be signed in to change notification settings - Fork 6
69 lines (59 loc) · 1.81 KB
/
run-python-tests.yml
File metadata and controls
69 lines (59 loc) · 1.81 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Run Python Tests
on:
pull_request_target:
branches:
- development
push:
branches:
- development
jobs:
test:
name: Run Python Tests
runs-on: ubuntu-latest
# Require manual approval for fork PRs
environment: testing
defaults:
run:
working-directory: server/python
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run unit tests
run: pytest -m unit --verbose --tb=short --junit-xml=test-results-unit.xml
env:
MONGO_URI: ${{ secrets.MFLIX_URI }}
MONGO_DB: sample_mflix
- name: Run integration tests
run: pytest -m integration --verbose --tb=short --junit-xml=test-results-integration.xml || true
env:
MONGO_URI: ${{ secrets.MFLIX_URI }}
MONGO_DB: sample_mflix
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
server/python/test-results-unit.xml
server/python/test-results-integration.xml
server/python/htmlcov/
retention-days: 30
- name: Generate Test Summary
if: always()
working-directory: .
run: |
chmod +x .github/scripts/generate-test-summary-pytest.sh
.github/scripts/generate-test-summary-pytest.sh \
server/python/test-results-unit.xml \
server/python/test-results-integration.xml